reddit / emacs

Info-directory-path frustrations

quokka70 · 2022-10-16 00:47
Edit: title should be "Info-directory-list frustrations" I run Emacs on a Mac. I install it via homebrew. I install packages with straight-use-package. `INFOPATH` isn't defined in my environment. When I enter Info in the usual way (`C-h i`) what I see is not optimal. 1. There is no entry for Emacs Lisp, among others. 1. There are things for which there is no actual Info help. Example: "Info-find-file: Info file ‘ada-mode’ does not exist; consider installing it" 1. There are almost 350 lines in the top level of Info and it is full of things I don't care about, such as EUDC, 'Gawk work flow', and 22 separate entries for things in GNU Gettext Utilities. `Info-directory-list` looks like this (where <$HOME> actually represents my correct home directory) "<$HOME>/.emacs.d/straight/build/auctex/" <several other entries for packages that all appear in Info just fine> "/usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1/share/info/emacs/" "/usr/local/share/info/" "/usr/share/info/" Now, `/usr/share/info/dir` is apparently the source of things like "Ada Mode", which doesn't actually exist on my system, and EUDC, which I don't care about. It's an oldish file (2020) and is implacable in the face of my attempts to update it. I don't have `update-info-dir` installed on my system, and `install-info` won't change it. I can manually remove it from the Emacs variable `Info-directory-list` but when I do that *not even Emacs itself appears* with `info (C-h i)`. Somehow, this file is the only reason Emacs appears inside info in the first place. The file `/usr/local/share/info/dir` is full of cruft. The directory `usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1/share/info/emacs/` appears to contain much of what I want to see, like elisp.info.gz and emacs.info.gz. But nothing in that directory appears at the top level of Info. My guess is that this is because it doesn't contain a `dir` file. So, at the moment info is a frustrating experience. I can get into, say, the Elisp manual by bringing up help for something like `memq` with `C-h f` and then selecting "View in Manual". This means that the files are available to Emacs - perhaps via the `[...]/emacs-28.2-mac-9.1/share/info/emacs` entry in my path - but the Elisp manual doesn't appear at the top level of Info. I have a vague memory of similar struggles with Info many years ago but I don't remember how I sorted things out. TL;DR: * Why is Emacs defaulting to including stale, garbagy entries like `/usr/share/info` in `Info-directory-list` when I'm not asking it to? * Can info files in a directory that doesn't contain a `dir` file be made to appear in the top-level info node?
bram85 · 2022-10-16 05:39
What if you run `update-info-dir`, which updates the info database?
eli-zaretskii · 2022-10-16 06:52
What you describe is several unrelated installation problems. First, your `/usr/share/info/dir` is full of manuals that aren't installed; this may or may not be a problem, depending on how you use the menu of the Info `DIR` node. Second, your Emacs installation somehow doesn't have its own `dir` file. When Emacs is built and installed, it does install a `dir` file, but somehow the distribution you installed lacks or doesn't install it, or something. The way to fix the problems is first to make sure the Info files that come with Emacs have their entries in some `dir` file in a directory mentioned by `Info-directory-list`. If nothing else helps, create and edit that file by hand, but the usual way is to run the `install-info` command on the directory where you have the Emacs Info manuals.
quokka70 · 2022-10-16 22:19
Thanks to you and u/bram85 for the quick and helpful responses. `/usr/share/info/dir` is indeed full of stuff that isn't installed. As u/bram85 says this should be fixable with `update-info-dir` but that doesn't exist on my OS X system. Either Apple has dropped the ball somewhere or I've messed up a configuration. I will make another attempt to modify the file by hand. The issue with `dir` in my Emacs distrubution is apparently known: https://github.com/railwaycat/homebrew-emacsmacport/issues/242. I have created a `dir` file as suggested in that bug's discussion with `install-info`. `C-h i` now much nicer. Thanks for your help.
quokka70 · 2022-10-16 22:19
Alas, that doesn't exist on my system. I'm not sure why.