Is it possible to link to a function definition in a source code file, rather than a fixed line number?
Using the suggested global binding
C-c l for storing a link when you are visiting any file (not just an org-mode file) and the one for inserting a link into an org file,
C-c C-l, should work fine. It does not do the elisp
find-function bit that John Kitchin describes in his answer, but it should be adequate for almost all situations. But you need
org-context-in-file-links to be set to
t: AFAICT that has been the default since 2008, but if you get line numbers instead of context in file links, check the setting of that variable.
For elisp that is certainly possible. The general strategy might be something like:
You could add a description if you wanted to also, e.g.
For other languages it wouldn't be that easy. You can make a link like this:
which will open that file and search for the contents after the ::. Those contents are escaped.
Yes, it is in fact possible to link directly to a help page, which should serve the purpose of linking to a function. Although it's not yet documented on https://orgmode.org/org.html#External-Links, the
help: link type works, at least since 2016. For example,
[[help:org-link-parameters]] links to the function where the
help: link (and many of the other built-in ones) are defined. Furthermore, running
C-c l) on a Help page will store a link to the Help page.