1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-13 16:38:14 +00:00

Make `insert-pair' always leave the cursor where documented

* lisp/emacs-lisp/lisp.el (insert-pair): The docstring of
insert-pair states that after insertion, the point ends up
after the opening character. This was not true if the pair was
inserted to surround a region (bug#16949).
This commit is contained in:
Dima Kogan 2016-02-24 13:54:17 +11:00 committed by Lars Ingebrigtsen
parent b594393d4d
commit 370eb67604

View File

@ -618,8 +618,10 @@ This command assumes point is not in a string or comment."
(if (and open close)
(if (and transient-mark-mode mark-active)
(progn
(save-excursion (goto-char (region-end)) (insert close))
(save-excursion (goto-char (region-beginning)) (insert open)))
(save-excursion
(goto-char (region-end))
(insert close))
(goto-char (region-beginning)) (insert open))
(if arg (setq arg (prefix-numeric-value arg))
(setq arg 0))
(cond ((> arg 0) (skip-chars-forward " \t"))