3

I installed magit, and it appears to have come with documentation I can access in info-mode:

> cd ~/emacs.d/elpa
> ls -1 magit-2.8.0/{dir,*.info*}
magit-2.8.0/dir
magit-2.8.0/magit.info
magit-2.8.0/magit.info-1
magit-2.8.0/magit.info-2

But when I run info in emacs, I don't see any entry for Magit in the directory. I've also tried running info-apropos to search for magit, and found nothing. What do I need to do to get it to show up?

I'm using use-package, if that's significant:

(use-package magit
  :load-path ("elpa/magit-2.8.0"
              "elpa/with-editor-2.5.2"
              "elpa/git-commit-2.8.0"
              "elpa/magit-popup-2.8.0")
  :config
  (setq vc-handled-backends (delq 'Git vc-handled-backends)))

I'm also using the newest version of Emacs I could find, GNU Emacs 25.1.1

However, I've intentionally avoided calling package-initialize in my init.el except as needed (e.g. when installing new packages), which is why I'm specifying a load-path in the use-package declaration above. Maybe that's related; I'm pretty sure package-initialize populates the load-path so packages can be found -- does it also populate Info-directory-list?

  • I don't know enough to answer, but I seem to recall often having this problem in the distant past, while with modern emacsen, new packages automagically get an entry in the top level Info node. I am not sure by what mechanism … but anyway, is your emacs an old one? – Harald Hanche-Olsen Aug 27 '16 at 16:06
  • Yes, let us know what Emacs version you have, as the package system has changed quite a bit over time. – Drew Aug 27 '16 at 17:11
3

Add the directory containing the *.info files to Info-directory-list, using add-to-list.

If it provides an Info manual, the package should have taken care of this for you. Node Multi-File Packages of the Elisp manual says this:

If the content directory contains a file named dir, this is assumed to be an Info directory file made with install-info. *Note Invoking install-info: (texinfo)Invoking install-info. The relevant Info files should also be present in the content directory. In this case, Emacs will automatically add the content directory to Info-directory-list when the package is activated.

  • This worked. I ended up adding this to the :config section of my use-package declaration: (eval-after-load 'info '(add-to-list 'Info-additional-directory-list "~/.emacs.d/elpa/magit-2.8.0/")) – ivan Aug 27 '16 at 21:27
  • 2
    @ivan: note that this should not be necessary since package.el should do that for you when package-initialize is called. Of course, if you use use-package, maybe you're preventing package.el from doing its job, in which case you're s.o.l. – Stefan Aug 28 '16 at 15:59
  • Are there examples of any ELPA/MELPA packages that do this properly? (Preferably MELPA, to be perfectly honest.) – Sean Allred Mar 6 '18 at 3:54

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.