From: Dima Kogan Date: Wed, 24 Feb 2016 02:54:17 +0000 (+1100) Subject: Make `insert-pair' always leave the cursor where documented X-Git-Tag: emacs-25.0.92~48 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=370eb67;p=emacs.git 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). --- 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"))