I have discovered the noweb syntax, and in particular how it can be used in org
source blocks, very recently, and I have grown quite fond of it.
But inserting the references (is there a better term?) seems to be unnecessarily painful: it seems that I have to either remember the name of the source block I want to link to.
My current workflow for long references is to insert a space after <<
and use dabbrev-expand
(which requires that I choose unique-enough prefixes).
I could certainly scrap together a completion feature automating this, or add a completion source scanning #+name
and #+srcname
. However, I do not like duplicating work (yes I am very lazy), and with all the completion features offered by org and 3rd-party packages, it strikes me as odd that nothing seems to provide completion for noweb references.
Are there any way of inserting noweb references with completion? And if not, is there a good reason for that?
MWE.org:
#+srcname: snippet-with-an-annoyingly-long-name
#+begin_src emacs-lisp
(message "Hello")
#+end_src
#+begin_src emacs-lisp
;; I would like to be able to insert the line below with the help of completion
<<snippet-with-an-annoyingly-long-name>>
#+end_src