emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3ee94cc: Insert skeletons at the correct point


From: Lars Ingebrigtsen
Subject: master 3ee94cc: Insert skeletons at the correct point
Date: Mon, 7 Dec 2020 10:36:17 -0500 (EST)

branch: master
commit 3ee94cc7bb657f0d3186d344fb1236b50edd5f69
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Insert skeletons at the correct point
    
    * lisp/skeleton.el (skeleton-read): Don't insert the skeleton at
    an arbitrary point if the user moves around (bug#17752).
---
 lisp/skeleton.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 6e2c10d..5578a93 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -312,10 +312,15 @@ automatically, and you are prompted to fill in the 
variable parts.")))
         (save-excursion (insert "\n")))
     (unwind-protect
        (setq prompt (cond ((stringp prompt)
-                            (read-string (format prompt skeleton-subprompt)
-                                         (setq initial-input
-                                               (or initial-input
-                                                   (symbol-value 'input)))))
+                            ;; The user may issue commands to move
+                            ;; around (like `C-M-v').  Ensure that we
+                            ;; insert the skeleton at the correct
+                            ;; (initial) point.
+                            (save-excursion
+                              (read-string (format prompt skeleton-subprompt)
+                                           (setq initial-input
+                                                 (or initial-input
+                                                     (symbol-value 'input))))))
                            ((functionp prompt)
                             (funcall prompt))
                            (t (eval prompt))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]