diff --git a/modules/feature/popup/+hacks.el b/modules/feature/popup/+hacks.el index b77abbd19..47ded5e64 100644 --- a/modules/feature/popup/+hacks.el +++ b/modules/feature/popup/+hacks.el @@ -142,14 +142,20 @@ the command buffer." ;; `helpful' (after! helpful - (defun +popup*helpful--navigate (orig-fn &rest args) - (let (origin) + (defun +popup*helpful--navigate (button) + (let ((path (substring-no-properties (button-get button 'path))) + origin) (save-popups! - (apply orig-fn args) + (find-file path) + ;; We use `get-text-property' to work around an Emacs 25 bug: + ;; http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f7c4bad17d83297ee9a1b57552b1944020f23aea + (-when-let (pos (get-text-property button 'position + (marker-buffer button))) + (goto-char pos)) (setq origin (selected-window)) (recenter)) (select-window origin))) - (advice-add #'helpful--navigate :around #'+popup*helpful--navigate)) + (advice-add #'helpful--navigate :override #'+popup*helpful--navigate)) ;; `neotree'