It's possible to let tangling generate comments that will link back to the literate file where you defined the function. https://orgmode.org/manual/Extracting-Source-Code.html See the comment header arg.
Then you could advise the relevant functions that do emacs function lookup to check whether there's such a "link comment" near the definition and jump to that instead. All this is rather hackish and I stopped doing my init files in literate org. Immanuel On Mon, Jul 4, 2022 at 4:07 PM Stephen Eglen <sj...@cam.ac.uk> wrote: > > I see many users are switching to using a 'literate programming' > approach to tangling their .emacs file from an org file. > > Has anyone solved the following problem though? If I have a file called > config.org containing: > > * test > > #+begin_src emacs-lisp > (defun quick-test () > "interactive" > (* 3 9) > ) > #+end_src > > > and then in my .emacs file I do: > > (org-babel-load-file "~/config.org") > > quick-test is indeed defined, but when I do C-c f RET quick-test RET it > takes me to config.el (a tangled file, suitable for computers, not > humans), rather than config.org. Is it possible instead to get the > editor to jump to the definition in config.org? > > Stephen > > -- -- A man must either resolve to point out nothing new or to become a slave to defend it. -- Sir Isaac Newton