[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 370eb67 1/2: Make `insert-pair' always leave the
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] emacs-25 370eb67 1/2: Make `insert-pair' always leave the cursor where documented |
Date: |
Wed, 24 Feb 2016 02:56:55 +0000 |
branch: emacs-25
commit 370eb6760435436c9b6b4d60df628d108464d20d
Author: Dima Kogan <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 3540fd1..c3de773 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"))