From: Eli Zaretskii <eliz@gnu.org>
To: Adam Porter <adam@alphapapa.net>,
Stefan Kangas <stefankangas@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 65555@debbugs.gnu.org
Subject: bug#65555: 29.1; Please un-obsolete buffer-local-value as a generalized variable
Date: Thu, 31 Aug 2023 10:22:06 +0300 [thread overview]
Message-ID: <83sf7zekwx.fsf@gnu.org> (raw)
In-Reply-To: <793bf8b7-251c-fe73-a2a4-e076a216cfe3@alphapapa.net> (message from Adam Porter on Sat, 26 Aug 2023 16:09:33 -0500)
Stefan and Stefan, any comments to the below?
> Date: Sat, 26 Aug 2023 16:09:33 -0500
> From: Adam Porter <adam@alphapapa.net>
>
> Hi,
>
> In 915efbff9833ea36aeb364e032a639391516912d the BUFFER-LOCAL-VALUE
> function's generalized variable forms were marked as obsolete. The
> discussion happened over a few years in bug #26624. After a delay of
> 4-5 years, the obsolescence was finally marked in the aforementioned
> commit.
>
> I understand that there were some non-obvious side effects in edge
> cases. However, in common cases, the generalized variable form is very
> helpful for writing more concise code. For example:
>
> (setf (buffer-local-value 'ement-notifications-retro-loading buffer) nil)
>
> ...is more concise than:
>
> (with-current-buffer buffer
> (setq-local ement-notifications-retro-loading nil))
>
> It also expresses its intent more directly, as it's clear that the only
> purpose of the form is to set a variable in the buffer rather than
> anything else that could happen when the current buffer is changed (i.e.
> in context of more code, the benefit is more obvious than in this
> minimal example).
>
> As far as I can tell, the objections to the generalized variable
> (i.e. the edge cases with non-obvious behavior) were theoretical in
> nature, without any concrete problems being noted in real code (that is,
> the report was not of a bug encountered in actual use). In
> contrast, in several places in Emacs's own code, forms were rewritten to
> be more awkward as a result of this change, without solving any
> problems in the changed code. And as I've noted, there is Elisp outside
> of emacs.git that uses (and would like to continue using) this idiom.
>
> As was mentioned in the discussion on #26624, rather than obsoleting the
> code and removing a useful feature from Elisp, the rare, non-obvious
> behavior related to using CL-LETF could be documented as an
> idiosyncrasy, like other rarely encountered rough edges in Elisp.
>
> As well, late last year I asked on emacs-devel that the
> mass-obsolescence of several generalized variables be reverted, and I
> was asked to individually request specific ones to be un-obsoleted.
> <https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01406.html>
> I can't say that I will be able to find the time to make such a
> comprehensive defense of all the ones I would like to keep using, but
> please consider this to be at least one of my responses to that request.
>
> Thanks for your consideration, and your work on Emacs.
>
> Adam
>
>
>
>
next prev parent reply other threads:[~2023-08-31 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-26 21:09 bug#65555: 29.1; Please un-obsolete buffer-local-value as a generalized variable Adam Porter
2023-08-31 7:22 ` Eli Zaretskii [this message]
2023-08-31 17:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31 19:27 ` Stefan Kangas
2023-09-02 7:46 ` Eli Zaretskii
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=83sf7zekwx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=65555@debbugs.gnu.org \
--cc=adam@alphapapa.net \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@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).