In emacs, how does the "hyperlink" in the * Help * buffer work?

I am trying to understand how a "hyperlink" works in the *Help* buffer (so that I can implement something like this at the output of Mx compilation). Here is a more detailed description of the behavior I want to emulate: Mx describe-function find-file opens the buffer *Help* . The first line of this buffer (for me) shows: find-file is an interactive Lisp function in files.el. files.el is underlined and pressing (or pressing enter when the dot is there) opens a new buffer with .el files and the dot located in the find-file definition. Executing the key-description for says calls the button in button.el that tells me Perform the action specified by a button at location pos - but how can I define a button and associate an action with this button in my own buffer?

+4
source share
1 answer

The main buffer mode *Help* is help-mode . In its source code ( help-mode.el ) you will find the help-make-xrefs that "Parse [s] and hyperlink [s] cross-reference documentation in this BUFFER". You can check how this was implemented.

Otherwise, I would suggest using org-mode instead, which uses the simple form [[URI][caption]] to mark hyperlinks .

+2
source

All Articles