unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: master 49e243c0c85: Avoid resizing mutation in subst-char-in-string, take two
Date: Wed, 15 May 2024 21:15:35 +0300	[thread overview]
Message-ID: <86o797j60o.fsf@gnu.org> (raw)
In-Reply-To: <5E014BBB-D2F5-4B3E-8555-6B7A8D11F15E@gmail.com> (message from Mattias Engdegård on Wed, 15 May 2024 19:29:04 +0200)

> From: Mattias Engdegård <mattias.engdegard@gmail.com>
> Date: Wed, 15 May 2024 19:29:04 +0200
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> 15 maj 2024 kl. 14.40 skrev Eli Zaretskii <eliz@gnu.org>:
> 
> > One important use case where this is not rare at all is when replacing
> > characters from the same Unicode block (= "script").
> 
> It is very rare to see replacement exclusively confined to single block, except for block 0 (ASCII). Scripts, even Latin, generally transcend blocks and even planes. 

"Rare" is in the eye of the beholder.  Imagine processing of Arabic or
Greek or Cyrillic text -- these replacements are natural there.

> Text written in one script also tends to include characters from blocks not related to that script, such as symbols, spaces, combining marks, numerals etc.

That's true, but replacing punctuation and symbols by letters is
_really_ rare, at least IME.

> The usefulness of equal-length multibyte `aset` is very small,

I guess we'll have to agree to disagree about this.

> One reason why single-character multibyte replacement (`aset`, `subst-char-in-string`, `store-substring`, most of the cl-lib functions etc) is so rare is that in the world of Unicode, a 'character' can be a sequence of scalar values (combining chars, modifiers etc) so a one-for-one value replacement is just too inflexible and limiting.

But Emacs doesn't (yet) support such "characters", except in the
display engine.  If you search for such sequences with Emacs commands,
you will generally not find the corresponding precomposed characters
and other equivalents (we have "character-folding" in search commands,
but that's a trick, really, not a fundamental support of character
equivalence).

So I think these last aspects are not really relevant to the issue at
hand.



  reply	other threads:[~2024-05-15 18:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 17:53 master 49e243c0c85: Avoid resizing mutation in subst-char-in-string, take two Eli Zaretskii
2024-05-13 19:20 ` Mattias Engdegård
2024-05-14  6:06   ` Eli Zaretskii
2024-05-14 10:44     ` Mattias Engdegård
2024-05-14 11:35       ` Eli Zaretskii
2024-05-15 12:29         ` Mattias Engdegård
2024-05-15 12:40           ` Eli Zaretskii
2024-05-15 17:29             ` Mattias Engdegård
2024-05-15 18:15               ` Eli Zaretskii [this message]
2024-05-15 20:19                 ` Mattias Engdegård

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86o797j60o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattias.engdegard@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).