mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +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:
parent
b218c8b6b5
commit
3ee94cc7bb
1 changed files with 9 additions and 4 deletions
|
|
@ -312,10 +312,15 @@ automatically, and you are prompted to fill in the variable parts.")))
|
||||||
(save-excursion (insert "\n")))
|
(save-excursion (insert "\n")))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(setq prompt (cond ((stringp prompt)
|
(setq prompt (cond ((stringp prompt)
|
||||||
(read-string (format prompt skeleton-subprompt)
|
;; The user may issue commands to move
|
||||||
(setq initial-input
|
;; around (like `C-M-v'). Ensure that we
|
||||||
(or initial-input
|
;; insert the skeleton at the correct
|
||||||
(symbol-value 'input)))))
|
;; (initial) point.
|
||||||
|
(save-excursion
|
||||||
|
(read-string (format prompt skeleton-subprompt)
|
||||||
|
(setq initial-input
|
||||||
|
(or initial-input
|
||||||
|
(symbol-value 'input))))))
|
||||||
((functionp prompt)
|
((functionp prompt)
|
||||||
(funcall prompt))
|
(funcall prompt))
|
||||||
(t (eval prompt))))
|
(t (eval prompt))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue