]> code.delx.au - gnu-emacs/commitdiff
Make `insert-pair' always leave the cursor where documented
authorDima Kogan <gnuplot@dima.secretsauce.net>
Wed, 24 Feb 2016 02:54:17 +0000 (13:54 +1100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 24 Feb 2016 02:54:17 +0000 (13:54 +1100)
* 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

index 3540fd1426148b1649cf797c2356c4b29c7b3111..c3de7730485f14678bee6a34394511a8d9a4f4de 100644 (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"))