Zip-Archive 模式适用于具有压缩/解压缩功能的系统。你如何让它在 Wnidows 上工作?
最佳答案
EMACS 使用外部程序进行压缩/解压缩。它所需要的只是知道要使用的正确程序。
一些扩展讨论:
正如我所说,我没有 Windows 框,但 LISP 代码位于 arc-mode.el 中大约第 230 行:
(defcustom archive-zip-extract
(if (and (not (executable-find "unzip"))
(executable-find "pkunzip"))
'("pkunzip" "-e" "-o-")
'("unzip" "-qq" "-c"))
"*Program and its options to run in order to extract a zip file member.
Extraction should happen to standard output. Archive and member name will
be added."
:type '(list (string :tag "Program")
(repeat :tag "Options"
:inline t
(string :format "%v")))
:group 'archive-zip)
观察函数executable-find
。它在您的 EMACS exec-path
中搜索,其中包括一些不在您的正常 PATH 变量中的 EMACS 可执行目录。就我而言,它是:
("/usr/bin"
"/bin"
"/usr/sbin"
"/sbin"
"/Applications/Emacs.app/Contents/MacOS/libexec"
"/Applications/Emacs.app/Contents/MacOS/bin"
"~/bin"
"/usr/local/bin"
"/usr/X11R6/bin")
其中包括 EMACS 包内的两个目录。您的 Windows 安装将在 EMACS 安装程序的内部某处包含等效目录。如果可执行文件不在您的常规路径中,那是查找可执行文件的地方。
您可以从 this site 下载 pkunzip ,安装它,并使用 (add-to-list 'exec-path "c:/path/to/pkunzip")
关于windows - 如何让 emacs Zip-Archive 模式在 Windows 上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/872507/