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:
parent
b594393d4d
commit
370eb67604
1 changed files with 4 additions and 2 deletions
|
@ -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"))
|
||||
|
|
Loading…
Add table
Reference in a new issue