unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dima Kogan <gnuplot@dima.secretsauce.net>
To: 16949@debbugs.gnu.org
Subject: bug#16949: 24.3; [PATCH] insert-pair now leaves the point where the docstring says it should
Date: Wed, 05 Mar 2014 23:17:01 -0800	[thread overview]
Message-ID: <87ob1j4x02.fsf@secretsauce.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

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. This small patch fixes it.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-insert-pair-now-behaves-like-its-docstring-says.patch --]
[-- Type: text/x-diff, Size: 1122 bytes --]

From 5ae4b68706e4a1c8daa0bb91602a62911c29a9a8 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Wed, 5 Mar 2014 23:10:57 -0800
Subject: [PATCH] insert-pair now behaves like its docstring says

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
---
 lisp/emacs-lisp/lisp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 0487515..420b205 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -536,7 +536,7 @@ This command assumes point is not in a string or comment."
       (if (and transient-mark-mode mark-active)
           (progn
             (save-excursion (goto-char (region-end))       (insert close))
-            (save-excursion (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"))
-- 
1.9.0


             reply	other threads:[~2014-03-06  7:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  7:17 Dima Kogan [this message]
2016-02-24  2:54 ` bug#16949: 24.3; [PATCH] insert-pair now leaves the point where the docstring says it should Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob1j4x02.fsf@secretsauce.net \
    --to=gnuplot@dima.secretsauce.net \
    --cc=16949@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).