1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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).
This commit is contained in:
Lars Ingebrigtsen 2020-12-07 16:36:09 +01:00
parent b218c8b6b5
commit 3ee94cc7bb

View File

@ -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))))