I use emacs (v on windows 10, and I am impressed by all the funtionality of dired+. One function I use often is peep-dired, so I can preview my text files when scrolling down my files in dired. For some reason jpg files are also previewed, not as code, but as a picture. Is it possible to preview pdf, doc, docx, and xls files also, not as their code, but readable for humans?

  • I use qlmanage on OSX to give me a quick human look -- without actually opening the file in a new buffer. A cursory Google search lead me to seer: sourceforge.net/projects/ccseer I would recommend looking at things like that and setting up a start-process and use something similar to the delete process function in the following link to help delete numerous processes with the same beginning name but the suffix is numbered: stackoverflow.com/a/20023781/2112489 That thread/link also contains a sample method of using start-process to launch the quick look viewer. – lawlist May 9 '16 at 19:36
  • This comment is an update/follow-up to my previous comment. Unfortunately, the free program seer has no command-line support. I've put in a feature request to the seer developer and will update if there is any news. As the original poster of this thread noted in a different thread, doc-view-mode supports: "For PostScript files, GhostScript is a hard requirement. For DVI files, dvipdf or dvipdfm is needed. For OpenDocument and Microsoft Office documents, the unoconv tool is needed." On OSX, unoconv is not available with macports -- but it is available with homebrew. – lawlist May 12 '16 at 4:48

Customize option auto-mode-alist so that it has an entry that assigns .pdf to the mode you use for visualizing PDF files. E.g., if that mode is my-pdf-mode then add an entry such as this to option auto-mode-alist:

("\\.pdf$" . my-pdf-mode)

Normally, you can use doc-view-mode for this (i.e., ("\\.pdf$" . doc-view-mode), after loading library doc-view), provided your Emacs build supports it. See the Emacs manual, node Document View, including this footnote.

  • Hi, and thanks. It did not work, yet. But I read somewhere that I have to install ghostscript in order to make doc-view let me see previews of pdf. How do I tell emacs where to find my ghostscript installation? – myotis May 9 '16 at 20:41
  • You also need some dll files placed in the bin directory where the Emacs executable is located. There are several threads that can be found on Google about viewing pdf and png on Emacs for Windows, and I also wrote up a thread that describes how to build Emacs master branch with full image support. Eli Z. has a page with all the dll files. There are also pre-built Emacs installations with all the dll files already built-in. To view pdf with the help of ghostscript within Emacs, search Google for emacs doc-view windows – lawlist May 9 '16 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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