all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Angelo Graziosi <angelo.graziosi@alice.it>
Cc: 20975@debbugs.gnu.org, Artur Malabarba <bruce.connor.am@gmail.com>
Subject: bug#20975: Replacing text add also the comma
Date: Sun, 05 Jul 2015 00:07:34 +0300	[thread overview]
Message-ID: <87si93d42x.fsf@mail.linkov.net> (raw)
In-Reply-To: <55970987.1060809@alice.it> (Angelo Graziosi's message of "Sat, 04 Jul 2015 00:15:35 +0200")

> 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	other threads:[~2015-07-04 21:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 22:15 bug#20975: Replacing text add also the comma Angelo Graziosi
2015-07-04 21:07 ` Juri Linkov [this message]
2015-07-04 21:31   ` Artur Malabarba
2015-07-05  2:46     ` Eli Zaretskii
2015-07-05 15:47       ` Artur Malabarba
2015-07-05 21:07         ` Angelo Graziosi
2015-07-05 21:32           ` Artur Malabarba

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

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

  git send-email \
    --in-reply-to=87si93d42x.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=20975@debbugs.gnu.org \
    --cc=angelo.graziosi@alice.it \
    --cc=bruce.connor.am@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.