add-hook 绑定函数错误提示不友好

发现在 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, 这错误提示也太不友好了。

应该是 org-open-file 的问题吧 我猜测 org-execute-file-search-functions 里可以是函数或者字符串,然后发现 org-link-search-lisp 不是函数,把他当字符串了