When I try to open a zip file in emacs I just see the binary file instead of a listing of the files.

I get the following backgrace:

Debugger entered--Lisp error: (args-out-of-range 36585 36589)
  set-auto-mode-0(archive-mode nil)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer cmyk.zip> "~/Downloads/cmyk.zip" nil nil "~/Downloads/cmyk.zip" (9179932 64513))
  find-file-noselect("/home/thayne/Downloads/cmyk.zip" nil nil nil)

The numbers in args-out-of-range change depending on the zip file.

I have googled around and can't find anything that works. This happens for EVERY zip file.


I am using emacs 24.3.1, I can get a listing when I use emacs -q, so I guess it is something in my configuration.

I am using Prelude with a number of plugins installed, I'm not sure how to narrow down on what plugin and/or configuration is causing the problem though.

  • Constantine wrote some code to extract the contents of zip archives to the hard drive once they have been displayed in archive-mode, perhaps something like that would be what you are looking for?: emacs.stackexchange.com/a/3843/2287 I know you are interested in archive-mode, however, dired-mode is more sophisticated in some respects and it can be configured to unzip *.zip files (but not display their contents beforehand, absent a modification to the code).
    – lawlist
    Commented Mar 19, 2015 at 18:05
  • archive-mode lists the contents of the zip archive, instead of uncompressing it. It can extract a file from the zip archive to a buffer (but not extract a file from the zip archive to the hard drive without using code similar to what Constantine wrote).
    – lawlist
    Commented Mar 19, 2015 at 18:12
  • 2
    What version of Emacs do you have? Does this happen if you run emacs -q? if you run emacs -Q? Commented Mar 19, 2015 at 21:58
  • sorry I wasn't more clear in the original post. I meant that it wasn't listing the contents, just showing a bunch of gibberish on the screen.
    – Thayne
    Commented Mar 20, 2015 at 0:33

1 Answer 1


I figured it out. I had the following line in my configuration:

(setq coding-system-for-read 'utf-8)

Deleting this line fixed it. I originally put this in because a website recommended doing this to make utf-8 the default coding system, however I later found a different way to do it, and the documentation for coding-system-for-read actually says not to set it globally. I feel like an idiot.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.