发现在 emacs lisp org-store-link 存储以后无法精确跳转到代码所在行,于是为 org-execute-file-search-functions 添加了一个 hook function
(defun org-link-search-elisp (addressing-string)
(when (eq major-mode 'emacs-lisp-mode)
(goto-char (point-min))
(and (search-forward addressing-string nil t)
(goto-char (match-beginning 0)))
t))
(add-hook 'org-execute-file-search-functions #'org-link-search-lisp)
然后一直报错
org-open-file: Wrong type argument: stringp, org-link-search-lisp
折腾了好久才发现是绑定的函数名写错了,elisp 写成 lisp, 这错误提示也太不友好了。