8

Emacs has self-documentation as one of its goals, and it achieves this pretty well for Emacs Lisp with commands like describe-variable, describe-function, etc. Packages like company-quickhelp make this even more convenient by providing help in tooltips, which reduces the need to constantly switch attention to a Help buffer.

The built-in Info reader is also very convenient for browsing Info manuals. Helm improves upon this by providing helm-info, which allows for choosing from all installed Info files and searching a file's index via incremental completion.

I find the above tools important because, by making documentation look-up easier, they encourage me to do more of it.

However, it's difficult to replicate the ease with which I can look up documentation about Emacs, Emacs Lisp, etc. with other tools and languages. For example, if I forget what a CSS rule does, I still find myself Googling for answers, which is slow and shifts attention away from Emacs.

So, what are some good ways (both general and specific to particular tools/languages) to look-up documentation or check manuals in Emacs?

Common Lisp, for example, has SLIME, which tries to do for Common Lisp what Emacs does for Emacs Lisp, although it doesn't get as far because many references are made to the Common Lisp HyperSpec.

Tianxiang Xiong
  • 3,848
  • 16
  • 27
  • 4
    I've heard that https://github.com/areina/helm-dash is a good option. (I'm writing this as a comment and not an answer because I don't have any experience with it.) – Constantine Feb 06 '16 at 04:35
  • Oh, that's interesting! I was under the impression Dash was Mac-only, but it looks like the docsets themselves are available on any platform. – Tianxiang Xiong Feb 06 '16 at 05:07
  • 1
    This would depend on a (programming) language you work with... For some languages documentation can be browsed using their own tools, possibly integrated into Emacs. For others, you could view documentation through Emacs' web browser (but since it doesn't support JavaScript, that might not always work). You can make SLIME, for eg. to look up HyperSpec locally (if you have a local copy). With CSS you could use eww or w3m to access it online eg. https://www.w3.org/TR/selectors4/ with `occur` you could even make an ad hoc interactive table of contents. – wvxvw Feb 06 '16 at 11:09
  • 1
    Interesting question in general, but probably too broad in the absence of a unified method. Could you please make the question more specific (eg, which language in particular?)? – Dan Feb 06 '16 at 15:13
  • 1
    If a tool provides an Info manual, use that. If not, look for information on the web. (And yes, it's OK to leave Emacs. ;-)) – Drew Feb 06 '16 at 16:18
  • @Dan I don't really have a particular language in mind (although at the time I was writing this I was looking at CSS). I think this post is mostly about recognizing that documentation lookup is a pattern of activity applicable to any language you're working in, and it would be incredibly useful to have a common interface/process for doing it. @Constantine's mention of `helm-dash` is a great example of a common interface (Helm) to lookup docs for different languages. – Tianxiang Xiong Feb 06 '16 at 20:20
  • @Drew I do wish more languages/tools provided Info manuals, but alas, Info does not seem popular beyond GNU and Lisp-related projects. How great would it be if the CLHS was available as an Info manual like the Elisp reference (although I'm aware of the complex legal issues that make this impossible)? – Tianxiang Xiong Feb 06 '16 at 20:23

1 Answers1

1

Info is great, if it is available for a particular tool or language. Icicles can help with browsing and searching Info books (doc sets).

  • Completion is more flexible (regexp, fuzzy, progressive/incremental - combine patterns).
  • Create virtual books from any set of Info nodes from any manuals.
  • Visit nodes matching an input pattern in any order, selectively.
  • Sort matches in *Completions* in various ways (book order, alphabetic, etc.).
  • Limit matches of your input pattern to nodes that follow the current node (i.e., in the remainder of the current manual).
  • g can match node name or node content, or both, so you can search a set of nodes (or a manual) and choose from the list of matching nodes.

More information...

Drew
  • 75,699
  • 9
  • 109
  • 225