You can execute arbitrary elisp code from a link:
[[elisp:(message "Hello")][Greeting]]
Clicking on the link runs the code and you get a greeting in the echo area.
All you have to do is figure out what code to run. The first step is to find out the keybinding of C-h f
, so do C-h c C-h f RET
and you see that C-h f
is bound to the command describe-function
. Now you can do C-h f describe-function RET
to get help for this command and find out how to call it. It says that it takes a symbol as argument, e.g. (describe-function 'describe-function)
gives you the same help. So
you could say:
[[elisp:(describe-function 'find-file)][Help for find-file]]
to do what you asked for.
There are two annoyances:
you need a separate link for each separate function whose doc string you want to examine. I don't know about you but I'd rather do C-h f
and enter which function I'm interested in. Or put the cursor on the name and do C-h f
, so even if I write notes about a function, all I need is the name of the function and the doc string is a couple of keystrokes away.
when you click on an elisp link, you are asked for confirmation. That's a security precaution: you want to look at the code and make sure that there is nothing dangerous there (either by design or by accident). Being able to execute arbitrary code at the click of a link is dangerous. You can customize the variable org-link-elisp-confirm-function
to modify this behavior, but check its docstring and heed the warning.