all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: 20975@debbugs.gnu.org, Angelo Graziosi <angelo.graziosi@alice.it>
Subject: bug#20975: Replacing text add also the comma
Date: Sat, 4 Jul 2015 22:31:45 +0100	[thread overview]
Message-ID: <CAAdUY-+KN8MAPfm1zHWAwh2SgQEOTh4dxewQnEbn3Tge07hjHg@mail.gmail.com> (raw)
In-Reply-To: <87si93d42x.fsf@mail.linkov.net>

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

On Jul 4, 2015 10:07 PM, "Juri Linkov" <juri@linkov.net> wrote:
>
> >
> '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?

Yes, it's simple enough to fix.
The reason why we set characters to also match the decomposition of other
unicode characters is that this lets us match a letter combined with a non
spacing accent.
Within that, I've already added a clause to avoid matching when the
decomposition has more than one letter (this prevents "a" from matching
"am").

Clearly, we need another clause to avoid this situation here.
If no one has a different opinion, I'll add a clause so that a
decomposition is folded only if it contains at least one non-spacing
character. (though I'm not sure how to check for this, at the phone right
now).

That would fix this situation, and wouldn't affect how ascii characters are
allowed to match unicode characters. This would only affect how ascii
characters are allowed to match decompositions.

[-- Attachment #2: Type: text/html, Size: 1707 bytes --]

  reply	other threads:[~2015-07-04 21:31 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
2015-07-04 21:31   ` Artur Malabarba [this message]
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=CAAdUY-+KN8MAPfm1zHWAwh2SgQEOTh4dxewQnEbn3Tge07hjHg@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=20975@debbugs.gnu.org \
    --cc=angelo.graziosi@alice.it \
    --cc=juri@linkov.net \
    /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.