GNU bug report logs - #20975
Replacing text add also the comma

Previous Next

Package: emacs;

Reported by: Angelo Graziosi <angelo.graziosi <at> alice.it>

Date: Fri, 3 Jul 2015 22:16:01 UTC

Severity: normal

Done: Artur Malabarba <bruce.connor.am <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Angelo Graziosi <angelo.graziosi <at> alice.it>
Cc: 20975 <at> debbugs.gnu.org, Artur Malabarba <bruce.connor.am <at> gmail.com>
Subject: Re: bug#20975: Replacing text add also the comma
Date: Sun, 05 Jul 2015 00:07:34 +0300
> Suppose one has a file with this text
>
> $ cat foo.log
> abcd r8 efg
> foo(a_r8,b_r8,c_r8)
>
> Try to replace 'r8' with 'DP', i.e. in the minibuffer,
>
> M-% <RETURN>
> Query replace:
> r8 <RETURN>
> Query replace r8 with: DP
>
> The 'r8' on the first row is replaced correctly while on the second row
> also the comma is added to the text 'r8' to be replaced.
>
> foo.log becomes
>
> $ cat foo.log
> abcd DP efg
> foo(a_DPb_DPc_DP)
>
> Is this intentional or a bug?

Thanks for the report, this is an unintentional bug.

'8' matches the adjacent comma because (character-fold-to-regexp "8")
contains "8[,.]"

The culprit is #x1f109 “DIGIT EIGHT COMMA” with decomposition: (compat
'8' ',') and #x248f “DIGIT EIGHT FULL STOP” with decomposition: (compat
'8' '.')

We don't need to match the decomposition “8,” when searching for “8”.
We only need to match the char #x1f109 when searching for “8”.

Maybe Artur has an idea how to fix this regexp?




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

Previous Next


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