An all-in-one document reader for all formats in Emacs, backed by MuPDF.
  • C 44.2%
  • C++ 25.6%
  • Emacs Lisp 24.7%
  • Makefile 2.7%
  • Scheme 2.7%
  • Other 0.1%
Find a file
tusharhero 3f4af37bbe
Revert "chore: update straight recipe in README"
This reverts commit 754f6f864d.

Having ‘emacs-reader’ in the use-package declaration leads to
error. Otherwise the declarations are the same. The reason for this
change was a mistaken report by a user who had copied the MacOS
straight use-package declaration instead of the one for
GNU/Linux (#147).
2026-01-16 15:32:42 +05:30
doc Add notes of stream 2025-05-18 20:05:09 +00:00
extras chore: remove demonstration gif 2025-06-30 21:12:00 +05:30
render chore: rename threadpool_destroy to threadpool_shutdown 2026-01-16 07:28:49 +00:00
test/vm doc: add info about GNU Guix vm for testing 2025-06-27 22:21:20 +05:30
.clang-format Add .clang-format 2025-06-14 11:54:14 +00:00
.dir-locals.el chore: dev: dir-locals enable ‘sentence-end-double-space’ 2026-01-16 15:32:11 +05:30
.envrc refactor: use functions from direnv's stdlib 2026-01-06 23:18:07 -03:00
.gitignore chore: dev: rename emacs-reader-autoloads to reader-autoloads 2025-08-02 22:12:11 +05:30
CONTRIBUTORS chore: add teeoius to CONTRIBUTORS 2026-01-15 09:19:57 +00:00
COPYING chore: rename LICENSE to COPYING 2025-08-27 10:14:02 +05:30
default.nix chore: add gdb to default.nix 2025-06-28 19:52:07 +00:00
Makefile chore: build system: add checkdoc to Makefile 2026-01-15 16:45:09 +05:30
manifest.scm chore: add gdb to manifest.scm 2025-06-28 23:50:50 +05:30
NEWS chore: update NEWS file 2025-10-09 21:26:44 +05:30
reader-bookmark.el fix: only jump to bookmark if the file stil exists 2025-07-28 14:26:29 +05:30
reader-outline.el fix: imenu: take into account 0-indexing 2025-08-26 21:09:49 +05:30
reader-saveplace.el chore: apply checkdoc recommendations. 2026-01-15 16:46:22 +05:30
reader.el refactor: switch ‘reader-open-doc’ to a more functional approach 2026-01-15 18:09:34 +05:30
README.org Revert "chore: update straight recipe in README" 2026-01-16 15:32:42 +05:30

The GNU Emacs Reader

/procyberian/emacs-reader/media/branch/master/extras/emacs-reader-logo.png

An all-in-one document reader for GNU Emacs, supporting all major document formats. This package intends to take from doc-view, nov.el, and pdf-tools and make them better. And as such, it is effectively a drop-in replacement for them.

Supported Formats

The Emacs Reader (via MuPDF) can open all the formats below.

Well-supported Formats

  • PDF
  • EPUB
  • MOBI
  • FB2
  • XPS/OpenXPS
  • CBZ

Office Document Formats

These formats below are not really for document reading, and as such while they are supported by MuPDF and can be opened fine, it’s just not going to be that good of an experience. It should only be used for quickly checking the textual contents of the document, and certainly cannot be edited inside Emacs. (You may use LibreOffice for that.)

Open Document Formats (LibreOffice)

  • ODT
  • ODS
  • ODP
  • ODG

Proprietary Micro$oft Formats

Using these formats is heavily discouraged, you should always prefer the above formats from LibreOffice (Which can also you help you edit these formats if you need to). But since MuPDF does come with some very minimal support for these proprietary formats as well, they can also be viewed:

  • DOCX
  • PPTX
  • XLSX

Dependencies

The only thing this package depends on is mupdf, at minimum v1.26.0.

Installation

For now, until the package has been published to GNU ELPA, the only way to install and use it is through locally cloning the repo and building it. This is different across platforms:

GNU/Linux

On GNU/Linux, all you need is: gcc and make. Then you can simply install through the Emacs’ built-in package-vc (available in Emacs 30.1 or higher)or the straight package manager. The built-in package-vc still has some quirks, but here are the recipes for both:

  • use-package with package-vc:

      (setq package-vc-allow-build-commands t)
      (use-package reader
        :vc (:url "https://codeberg.org/divyaranjan/emacs-reader"
      	    :make "all"))
  • use-package with straight

      (use-package reader
        :straight '(reader :type git :host codeberg :repo "divyaranjan/emacs-reader"
      	      :files ("*.el" "render-core.so")
      	      :pre-build ("make" "all")))

Note that sometimes you may need to run make clean all to get rid of old artifacts before recompiling.

Debian GNU/Linux

Follow this write up.

GNU Guix

Using the GNU Guix package manager, you can get emacs-reader through the divya-lambda Guix channel. Follow the instructions there to add the Guix channel to your configuration. Then all that remains to do is,

  guix install emacs-reader

This will get the latest release of emacs-reader. However, if you want to get latest features, bug fixes (and bugs!) to help us with testing emacs-reader, you should use the master branch. You can instruct Guix to get it for you, like so,

  guix install emacs-reader --with-branch=emacs-reader=master

You can also upgrade an already installed package with,

  guix upgrade emacs-reader --with-branch=emacs-reader=master

You may replace the branch name as you need.

Nix

Follow the instructions here.

MacOS

Install MuPDF using Homebrew,

  brew install gcc
  brew install make
  brew install mupdf

And then use the straight or package-vc recipe from the GNU/Linux section. But you need to modify the straight recipe, like so,

  (use-package reader
    :straight '(reader :type git :host codeberg :repo "divyaranjan/emacs-reader"
     		     :files ("*.el" "render-core.dylib")
     		     :pre-build ("make" "all")))

Find more information here.

Windows

With Windows, you need MSYS2 toolchain, first install MSYS2, then choose one of the environment that MSYS2 provided, on a modern 64bit Windows system, you want either MINGW64 or UCRT64. If you have never tried MSYS2 before, we recommend MINGW64 since this is the environment that used to build the official GNU Emacs' Windows version.

The following steps assume you use MINGW64:

First install the build dependencies:

pacman -S make mingw-w64-x86_64-gcc git pkg-config mingw-w64-x86_64-libmupdf

After that, you can run git clone https://codeberg.org/divyaranjan/emacs-reader.git and then:

make all

Manual

This section is about how to install this package manually. Intended to be used by developers and testers.

After cloning the repository, follow the instructions from the previous section to install dependencies on your respective operating system.

Then, you run make in the git repository, as noted earlier this may take a few depending on if it is fetching and building mupdf.

After this, you add the path to emacs-reader git repository to load-path,

  (add-to-list 'load-path "/path/to/emacs-reader")

You can also utilize use-package to do the same,

  (use-package reader
    :vc t
    :load-path "/path/to/emacs-reader")

To test emacs-reader in a default Emacs config, first generate the auto loads using make autoloads.

  emacs -Q -L . -l reader-autoloads.el

This command adds the current directory to path, and loads reader-autoloads.el.

You can also try using package-vc-install-from-checkout, this video demonstrates how to do that.

Key Bindings

  • n for going to next page
  • p for going to previous page
  • C-n for scrolling down.
  • C-p for scrolling up.
  • C-b for scrolling left.
  • C-f for scrolling right.
  • Q for closing the Emacs Reader buffer.
  • M-< for going to the first page.
  • M-> for going to the last page.
  • M-g g for going to a particular page.
  • M-v or Page Up for scrolling to the top of the page.
  • C-v or Page Down for scrolling to the end of the page.
  • SPC, S-SPC , and DEL make the above two commands keep scrolling the pages.
  • =, +, and C-<wheel-up> for zooming into the page.
  • - and C-<wheel-down> for zooming out of the page.
  • H to make the page fit the height of the current window.
  • W to make the page fit the width of the current window.

How It Works

This package is entirely distinct from DocView and pdf-tools in both its architecture and implementation. It leverages Emacs’ dynamic/native modules which allows it to interoperate with other programming languages outside of its Emacs Lisp environment.

Thus, we rely on the efficient MuPDF library as a shared object with which our dynamic modules work. All the tasks that require manual memory management, efficiently dealing with the rendered pages, and so on are delegated to the C backend, and Emacs takes care of exclusively what it’s good at: displaying produced pages, buffer management, and all round integration with the rest of Emacs.

For understanding how dynamic modules work within Emacs, please consult the following article I wrote:

https://www.phimulambda.org/blog/emacs-dynamic-module.html

Live Streams

I have been streaming the development of this package on my PeerTube channel: (phi (mu (lambda))).

The streams happen on Sundays, biweekly at around 2:30 PM UTC. Follow the channel on Peertube or my Mastodon to be notified when I stream. You can also find some stream notes here.

If you wish to join the discussion for the package, you should join the IRC channel #phi-mu-lambda on Libera.

License

Unless another license is listed, all files in emacs-reader are licensed under the GNU General Public License version 3 (or at your option, any later version). See COPYING and CONTRIBUTORS for further details.

The logo of the project was made by Divya Ranjan Pattanaik and is shared under CC-BY-SA-4.0. The logo uses the following artworks from GNU:

The interesting history of different Emacs logos is outlined by Luis Fernandes, in his article on The Design of the Emacs Logo.