GNU bug report logs - #16949
24.3; [PATCH] insert-pair now leaves the point where the docstring says it should

Previous Next

Package: emacs;

Reported by: Dima Kogan <gnuplot <at> dima.secretsauce.net>

Date: Thu, 6 Mar 2014 07:27:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.3

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16949 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <gnuplot <at> dima.secretsauce.net>
Cc: 16949 <at> debbugs.gnu.org
Subject: Re: bug#16949: 24.3;
 [PATCH] insert-pair now leaves the point where the docstring says it
 should
Date: Wed, 24 Feb 2016 13:54:47 +1100
Dima Kogan <gnuplot <at> dima.secretsauce.net> writes:

> 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.
>
>>From 5ae4b68706e4a1c8daa0bb91602a62911c29a9a8 Mon Sep 17 00:00:00 2001
> From: Dima Kogan <dima <at> 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"))

Thanks; applied to emacs-25.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 9 years and 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.