5

I am writing documentation for some emacs-lisp code.

The code has docstrings, but I am writing a manual using org-mode.

It would be cool if I could embed links to the code within this manual. Click on the link, and it brings up the Enacs Help function (describe variable or function) on it.

So I guess really what I am asking for is a way to link to the two Emacs help functions.

1

1 Answer 1

6

You can include arbitrary elisp code as a link, so something like this works:

[[elisp:(describe-function 'find-file)][find-file]]

This displays as find-file, and when you click it, it opens the help for find-file.

By default, Emacs will ask you to confirm that you want to run the elisp code, as this could potentially be dangerous. You can turn off this check by customizing the variable org-link-elisp-skip-confirm-regexp. For example, setting it to ".*" will cause all lisp to be evaluated without confirmation.

1
  • 1
    There is a better method: using help links. See the duplicate question for details.
    – NickD
    Apr 24, 2022 at 1:04

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .