[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20975: Replacing text add also the comma

From: Juri Linkov
Subject: bug#20975: Replacing text add also the comma
Date: Sun, 05 Jul 2015 00:07:34 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu)

> 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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]