minad / marginalia

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

Annotate info menu #131

Closed matzebond closed 2 years ago

matzebond commented 2 years ago

The info manual (info#Help-M) mentions that the menu entries have a syntax for a description

* Foo:  Node about FOO.      This tells about FOO.

Maybe marginalia could add support for annotating Info-menu :-)

minad commented 2 years ago

I've considered this, but so far didn't add it for a few mostly personal reasons around my experiences with Info:

  1. The info goto node command is a pretty bad one in my opinion. It implements its own step wise completion and the implementation is even broken (throws errors and does not use completion boundaries). The completion table is Info-read-node-name-1.
  2. So far we avoided to add expensive annotators to Marginalia, but we've recently weakened that a bit with the addition of the library annotor which relies heavily on caching.
  3. I consider the Info reader as not good. By not good I don't mean the content - the content is of course very good. I mean the layout, how it splits the pages, the lack of markup, the presentation and so on. To me it looks as if the Info reader part of Emacs hasn't seen much love for a long time. I don't enjoy reading Info manuals within Emacs, in contrast to reading for example Org files in Emacs. In my opinion Emacs should do away with Info and replace it with an Org-based infrastructure :)
  4. The situation around Info is even more weird. For example Debian does not even install the Emacs info manuals by default due some weird (nonsensical) licensing issue. I am not sure who's fault this is and I am not sure if only Debian is affected, but this adds on top of the bad experience that a new Emacs user will go through with regards to Info. I also went through this and it soured the Info reader somehow for me :shrug:

Regarding 1. there was the idea to maybe add a Consult variant consult-info to search through all info manuals in a more convenient way (maybe flattened like consult-imenu vs imenu). If such a command would be added then annotations could be provided by that command directly. Alternatively we could provide the annotations in Marginalia for both the builtin Info commands and consult-info. Anyways, if you want to work on this, feel free to do so, but I don't have plans to add this in the near future.

okamsn commented 2 years ago

For reference, here is an example of finding the descriptions:

https://github.com/raxod502/selectrum/wiki/Useful-Commands#jumping-to-an-info-node

minad commented 2 years ago

@okamsn Yes, there is also the selectrum info command (written by you?), which could be turned into a Consult command. I think you even proposed the addition of consult-info to Consult but we ultimately didn't went through with it due to some complications?

matzebond commented 2 years ago

@minad You are right. I was just curious too see how easy such an integration into marginalia would be but it seems info's 30ish years of crust don't warrant the effort. Thanks for this package and the other packages!

hmelman commented 2 years ago

I agree that annotating some of the Info items would be helpful.

I don't use Info-goto-node, in fact I had forgotten it existed. This bug report was for Info-menu which I do use all the time and I think uses a different completion table than Info-goto-node, see Info-complete-menu-item which is also used for Info-index which I also use all the time. I think the costs of computing annotations for Info-menu and Info-index should be cheaper than for Info-goto-node since the data is found in just the current node, or a handful of (long) index nodes.

If you know of bugs in the Info completion tables please report them. I reported Emacs bug#38614, an issue with the ordering of candidates in Info-complete-menu-item and it did get fixed in Emacs 28, so it's possible. 😄

FWIW I use Info a lot for emacs stuff and mostly like it. I agree some formatting could be better, that's mostly a limitation of the format which is shared with the standalone info reader (which I'm not sure anyone uses) which makes changing the emacs Info reader more complicated than just changing elisp code. I was unaware of the Debian info issue. It seems to only affect Debian and Ubuntu. I agree it's nonsensical and it is easily worked around with an additional package install and it shouldn't affect this bug.

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.