Better goto-definition when the function is verbatim

This commit is contained in:
Howard Abrams 2022-05-22 22:06:26 -07:00
parent d27db0a84d
commit f46d6080af

View file

@ -65,6 +65,9 @@ I love packages that add functionality but I dont have to learn anything. How
(defun ha-org-code-block-jump (str pos) (defun ha-org-code-block-jump (str pos)
"Go to a literate org file containing a symbol, STR. "Go to a literate org file containing a symbol, STR.
The POS is ignored." The POS is ignored."
;; Sometimes I wrap a function name in `=' characters, and these should be removed:
(when (string-match (rx "=" (group (one-or-more any)) "=") str)
(setq str (match-string 1 str)))
(ignore-errors (ignore-errors
(let* ((default-directory (projectile-project-root)) (let* ((default-directory (projectile-project-root))
(command (format "rg --json '\\(def[^ ]+ %s ' *.org" str)) (command (format "rg --json '\\(def[^ ]+ %s ' *.org" str))