branch: externals/consult-denote
commit 83303e0aab8d734fa3d02567f4ec15707634c36e
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Prevent consult-denote-outline-prompt from moving the point
---
 consult-denote.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/consult-denote.el b/consult-denote.el
index 7b713c898a..19655756eb 100644
--- a/consult-denote.el
+++ b/consult-denote.el
@@ -241,9 +241,10 @@ FILE has the same meaning as in 
`denote-org-extras-outline-prompt'."
      (denote-get-completion-table (denote-org--get-outline current-file) 
'(category . imenu))
      :state (lambda (_action candidate)
               (with-current-buffer (current-buffer)
-                (when-let* ((_ candidate)
-                            (line (string-to-number (car (split-string 
candidate)))))
-                  (forward-line (- line 1)))))
+                (save-excursion
+                  (when-let* ((_ candidate)
+                              (line (string-to-number (car (split-string 
candidate)))))
+                    (forward-line (- line 1))))))
      :prompt (format "Select heading inside `%s': " (propertize 
(file-name-nondirectory current-file) 'face 'denote-faces-prompt-current-name))
      :require-match t)))
 

Reply via email to