How to get emacs Zip-Archive archiving mode to work on Windows

Zip-Archive mode works on systems with zip / unzip. How can you work on Wnidows?

+6
windows emacs zip
source share
3 answers

EMACS uses an external compression / compression program. All he needs to do is know the right program to use.


Some extended discussion:

As I said, I don’t have a Windows window, but the LISP code is in arc-mode.el along line 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) 

Watch the executable-find function. It searches your EMACS exec-path , which includes some EMACS executables that are not in your regular PATH variable. In my case, this is:

 ("/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") 

which includes two directories inside the EMACS package. Your Windows installation will include equivalent directories somewhere in the guts of the EMACS installation. This is where to look for executables if they are not in your normal path.

You can download pkunzip from this site , install it and add the installation path using (add-to-list 'exec-path "c:/path/to/pkunzip")

+7
source share

How emacs handles compressed files can be a bit confusing, but here's an attempt to summarize the situation. There are two main compression packages: arc-mode (for example, zip-archive mode) and jka-compr ( auto-compression-mode ).

  • arc-mode : displays a table of contents (i.e. a simple list of file names contained in the archive) of multi-file archives (arc, lzh, zip, zoo), without requiring an appropriate third-party tool to exist on your system. If you really want to do any viewing / editing of the actual files contained in the archive using the arc mode, you definitely need a third-party tool that will be installed on your system and in the appropriate place. For example. for zip files, the default is zip / unzip in exec-path (this is the PATH environment for operating systems). This can be configured using archive-zip-extract and archive-zip-expunge .
  • jka-compr ( auto-compression-mode ): automatically compresses / decompresses single-file archives (gz, z, bz2, tbz, etc.) and requires the appropriate third-party tool on your system.

So, in order to fully work in zip-archive mode on Windows, you just need to find the zip / unzip command line version on the Windows command line and put them in the directory that is in your PATH (for example, see unpack the package in http: // gnuwin32.sourceforge.net/ ).

+2
source share

You can use [chololatey]: https://chocolatey.org/ , a management pack for Windows, to install unzip.

 choco install unzip 
0
source share

All Articles