GNU bug report logs - #70784
Abolish string resizing

Previous Next

Package: emacs;

Reported by: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Date: Sun, 5 May 2024 12:35:02 UTC

Severity: wishlist

Full log


Message #104 received at 70784 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 70784 <at> debbugs.gnu.org
Subject: Re: bug#70784: Abolish string resizing
Date: Wed, 15 May 2024 19:30:43 +0200
To minimise even low-probability trouble, I've looked for standard Elisp functions that might run into the resizing mutation trouble if used in a specific way. There's not a lot, but so far I've done:

- cl-substitute[-if[-not]]
- cl-sort (not that sorting strings is very common)
- subst-char-in-string with INPLACE = nil

I'm going to leave functions that explicitly mutate strings alone since code may depend on them doing that which is completely fine.

The manual would benefit from some light editing, just to make it clear that mutating multibyte strings is not usually the best programming style. I'll post a suggested patch.

Also, I'm leaning toward removing `store-substring` from the manual because while it probably felt like a good addition at the time, circumstances have changed and it has hardly seen any use at all. (We can mark it obsolete or keep it indefinitely but it doesn't really deserve top billing these days.)





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.