minad / marginalia

:scroll: marginalia.el - Marginalia in the minibuffer
GNU General Public License v3.0
780 stars 27 forks source link

Annotations for info-display-manual #137

Closed hmelman closed 2 years ago

hmelman commented 2 years ago

Emacs 28 adds a new command info-display-manual (on C-h R) which reads a manual name with completion and opens it in Info. I'd like to have annotations on these, specifically the manual description as shown in Info's dir listing. This is different than #131 which as about all info menus.

The dir contents are collected from several directories (from various installed packages) and I know annotations shouldn't do expensive things like opening files, but Info-dir-contents is a buffer-local variable (in *info* buffers) that caches the assembled contents, including the descriptions. It's just a long string and parsing it shouldn't be hard.

Since my emacs sessions are long-lived, I'm fine with these annotations not working if Info hasn't been loaded. The default behavior of q in Info is to just bury the buffer, not kill it, so I think most people should have an *info* buffer around once it's first loaded and I think info-display-manual has to generate it on first use (though I'm not sure).

minad commented 2 years ago

As you know from #131, I am not a big fan of the info file format and the info completion commands of Emacs. But if someone creates a PR which implements annotations for the different info completion commands I am okay to add this here, also for Info-menu.

minad commented 2 years ago

Btw, info-display-manual is yet another poorly made completion command. Why does it include directories like ./ and ../? Given that I am not sure if adding support here is advised. The Emacs info infrastructure is just not on a level which I am comfortable with.

hmelman commented 2 years ago

All fair. I'll open a bug with emacs.

minad commented 2 years ago

Just fyi, @alphapapa made an interesting proposal to add a better info command to Consult. See https://github.com/minad/consult/issues/634. If there is interest, I would welcome a PR there.