windows - 如何让 emacs Zip-Archive 模式在 Windows 上工作

标签 windows emacs zip

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/

相关文章:

emacs - 需要一个 Elisp 函数来推回输入

Emacs:跳回到上一个查询替换位置

emacs - 反向(kbd)功能?

linux - 从未知名称的文件夹中解压缩?

java - 如何在java中将.zip压缩为.gz?

android - windows 生成签名 APK 不工作 [react-native]

python - 如何在所有操作系统中使用 pygame 播放声音?

php - 上传 Zip 文件并解压缩 Zip

windows - 如何在 Dos 终端中列出 com 设备?

windows - 在 Cygwin 中获取 Windows 版本