joddie / pcre2el

convert between PCRE, Emacs and rx regexp syntax
GNU General Public License v3.0
242 stars 25 forks source link

Fix: Obsolete `buffer-substring` function replaced with `buffer-subst… #58

Closed haowg closed 4 months ago

haowg commented 4 months ago

…ring-no-properties`

hardaker commented 4 months ago

Thanks!

tarsius commented 4 months ago

This change is wrong and breaks rxt--toggle-flag-minibuffer.

The function buffer-substring is not obsolete. What is obsolete is the use of that as a generalized variable, i.e., (setf (buffer-substring ...) ...). However just replacing that with (setf (buffer-substring-no-properties ...) ...) is a big step backward: while the former results in a warning, at least it works, while the latter results in an error, because that function is not even defined as a generalized variable.

hardaker commented 4 months ago

Ok, reverted the change. New proposals welcome :-)

tarsius commented 4 months ago

Also see https://github.com/magit/transient/issues/269#issuecomment-1859137832 as mentioned in #55.

New proposals welcome

IMO at least unless you also address the numerous other warnings[^1][^2], then not doing anything about this one additional warning, is a reasonable course of action.

[^1]: About advice.el finally being declared obsolete in Emacs 30, twelve years after the creation of nadvice.el. [^2]: Which I would actually urge you to do, when you find the time. (I'm estimating you have another four years or so, until advice.el is removed.)