4

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 1
    Does this answer your question? [Is there a way to create an org-mode link that opens help?](https://emacs.stackexchange.com/questions/61730/is-there-a-way-to-create-an-org-mode-link-that-opens-help) – NickD Apr 24 '22 at 00:17

1 Answers1

5

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.

Tyler
  • 21,719
  • 1
  • 52
  • 92