feature/popup: fix wrong-num-of-args error following helpful links
This commit is contained in:
parent
988e70683e
commit
6e51dd249a
1 changed files with 10 additions and 4 deletions
|
@ -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'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue