From 370eb6760435436c9b6b4d60df628d108464d20d Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Wed, 24 Feb 2016 13:54:17 +1100 Subject: 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). --- lisp/emacs-lisp/lisp.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 3540fd14261..c3de7730485 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -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")) -- cgit v1.2.3 From e01c72f8f4987f9de71130b8b6d8224999fc6c6f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 24 Feb 2016 13:55:29 +1100 Subject: Fix white space in last checkin --- lisp/emacs-lisp/lisp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index c3de7730485..764d01ce6db 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -621,7 +621,8 @@ This command assumes point is not in a string or comment." (save-excursion (goto-char (region-end)) (insert close)) - (goto-char (region-beginning)) (insert open)) + (goto-char (region-beginning)) + (insert open)) (if arg (setq arg (prefix-numeric-value arg)) (setq arg 0)) (cond ((> arg 0) (skip-chars-forward " \t")) -- cgit v1.2.3