mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
feature/popup: fix wrong-num-of-args error following helpful links
This commit is contained in:
@ -142,14 +142,20 @@ the command buffer."
|
|||||||
|
|
||||||
;; `helpful'
|
;; `helpful'
|
||||||
(after! helpful
|
(after! helpful
|
||||||
(defun +popup*helpful--navigate (orig-fn &rest args)
|
(defun +popup*helpful--navigate (button)
|
||||||
(let (origin)
|
(let ((path (substring-no-properties (button-get button 'path)))
|
||||||
|
origin)
|
||||||
(save-popups!
|
(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))
|
(setq origin (selected-window))
|
||||||
(recenter))
|
(recenter))
|
||||||
(select-window origin)))
|
(select-window origin)))
|
||||||
(advice-add #'helpful--navigate :around #'+popup*helpful--navigate))
|
(advice-add #'helpful--navigate :override #'+popup*helpful--navigate))
|
||||||
|
|
||||||
|
|
||||||
;; `neotree'
|
;; `neotree'
|
||||||
|
Reference in New Issue
Block a user