I'd like to place a link to a tag or target inside a source code block.
#+BEGIN_SRC emacs-lisp
(use-package evil
:ensure t
:config
; enable per default
(evil-mode t)
; <<evil-bindings>>
:bind ("C-^" . evil-buffer) ; Switch to another buffer quickly
#+END_SRC
*** Key bindings
See [[file:::/<<evil-bindings>>/]]
Ideally this should jump the to position of ; |<<evil-bindings>>
inside the source block when followed via C-c C-o
.
I've tried See [[<<evil-bindings>>]]
before I tried "Method 2" in the answer from user Melioratus in How to reference source blocks in org text. My first try just prompts with No match - create this as a new heading? (yes or no)
in the minibuffer. The "Method 2" just calls occur as mentioned in the answer. But there's another problem. When going from my first try and editing the link via C-c C-l
and answering either just file:::
or file:::/regexp/
to the Link:
prompt, it errors out with org-insert-link: Args out of range: "file:::/<<evil-bindings>>/", 5, 4
. (I then activated and edited the link manually.)
NB: I haven't configured anything related to org-mode yet (not even (require 'org)
in my init.el). My emacs and org-mode version:
- GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-09-23, modified by Debian
- Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.1/lisp/org/)
Greetings, AWG