GNU bug report logs -
#70784
Abolish string resizing
Previous Next
Full log
Message #83 received at 70784 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> 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.
This bug report was last modified 141 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.