all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mattias.engdegard@gmail.com, 70784@debbugs.gnu.org,
	monnier@iro.umontreal.ca, drew.adams@oracle.com
Subject: bug#70784: Abolish string resizing
Date: Tue, 07 May 2024 21:41:10 +0800	[thread overview]
Message-ID: <874jb94u4p.fsf@yahoo.com> (raw)
In-Reply-To: <868r0lc1t1.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 May 2024 14:13:30 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> What _would_ matter is if there are important use cases out there
> where replacing one character by another character of a different
> multibyte length.  So if you, or anyone else, can come up with such
> situations (which are not made up specifically to argue here), please
> do, because knowing about such situations would be useful to make this
> discussion serious and based on facts.

There is certainly plenty of Emacs code that needs to replace characters
within strings whose contents are more or less arbitrary, so that
whether Mattias's proposal will disrupt them will vary in an
unpredictable manner from one string to the next.  I would venture to
suggest that _every_ invocation of aset with multibyte strings will
potentially be disrupted by the proposal in its mildest form, and it
will only be a matter of time before problems surface.  A wildly
variable length of time, for that matter, so it is infeasible to
anticipate their impact ahead of time, at least with the accuracy that
such a change deserves.

Nevertheless, examples are legion and one need search no further than
one's own init files for them:

      (progn
        [...]
	(if allow_unicode
	    (progn
	      (aset string pac-quote-start ?“)
              (aset string (1- pac-quote-close) ?”)
	      )
	  (progn
	    ;; Sometimes [...] prints unicode quotation marks
	    ;; surrounding pac captions so prevent inserting them into
	    ;; source code comments.
	    (aset string pac-quote-start ?\")
	    (aset string (1- pac-quote-close) ?\")
	    )
	  )
        [...]
	)

string is process output from shell-command-to-string, generated by a
Perl script I cannot publish.  Please don't ask for details as to the
script itself, since I am not at liberty to disclose them, and they have
absolutely no bearing on the matter at hand.





  reply	other threads:[~2024-05-07 13:41 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-05 12:33 bug#70784: Abolish string resizing Mattias Engdegård
2024-05-05 14:04 ` Eli Zaretskii
2024-05-05 14:18   ` Mattias Engdegård
2024-05-05 15:23     ` Eli Zaretskii
2024-05-05 16:55       ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-05 17:10         ` Eli Zaretskii
2024-05-05 18:09           ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-05 18:14             ` Eli Zaretskii
2024-05-05 20:08               ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06  1:01                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06  6:02                   ` Gerd Möllmann
2024-05-08 23:25                     ` Richard Stallman
2024-05-08 23:24           ` Richard Stallman
2024-05-09  1:14             ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26  9:02       ` Stefan Kangas
2024-05-26  9:17         ` Eli Zaretskii
2024-05-26 18:03           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 18:45             ` Eli Zaretskii
2024-05-27  3:42               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-28  2:23           ` Richard Stallman
2024-05-05 18:09     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-05 20:24       ` Mattias Engdegård
2024-05-05 21:14         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-11 15:20           ` Mattias Engdegård
2024-05-11 16:21             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 17:30             ` Mattias Engdegård
2024-05-15 17:47               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 19:35                 ` Mattias Engdegård
2024-05-25 11:24                 ` Mattias Engdegård
2024-05-25 11:37                   ` Eli Zaretskii
2024-05-25 13:01                     ` Mattias Engdegård
2024-05-06  0:53 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06  1:56   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06 11:35     ` Eli Zaretskii
2024-05-06 12:29       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-07 11:13         ` Eli Zaretskii
2024-05-07 13:41           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-06  2:41   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06  4:41     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-06 10:57     ` Eli Zaretskii
2024-05-06 11:26   ` Eli Zaretskii
2024-05-06 12:23     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-07 11:19       ` Eli Zaretskii
2024-05-08 23:25   ` Richard Stallman

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=874jb94u4p.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70784@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=mattias.engdegard@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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.