From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 54296@debbugs.gnu.org, philipk@posteo.net, larsi@gnus.org
Subject: bug#54296: Add buffer-matching functionality
Date: Tue, 14 Jun 2022 21:43:41 +0300 [thread overview]
Message-ID: <5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru> (raw)
In-Reply-To: <834k0ovket.fsf@gnu.org>
On 13.06.2022 15:04, Eli Zaretskii wrote:
>> Date: Mon, 13 Jun 2022 03:21:13 +0300
>> Cc: 54296@debbugs.gnu.org, larsi@gnus.org
>> From: Dmitry Gutov <dgutov@yandex.ru>
>>
>> On 14.03.2022 15:38, Philip Kaludercic wrote:
>>> The issue isn't that the default value couldn't be updated, but that if
>>> anyone has e.g. been using `project-kill-buffer-conditions' over the
>>> last 1½ years and has relied on the specific distinction between
>>> `major-mode' and `derived-mode', they would run in to unexpected
>>> results, that might result in more buffers being killed than intended,
>>> potentially data being lost that the user might not expect because of an
>>> update.
>>
>> I see that this point hasn't been addressed at all.
>>
>> Eli?
>
> Do you agree with Philip that deprecating or removing major-mode would
> be a problem for users of project-kill-buffer-conditions etc.?
Yes. I also mentioned that here:
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00650.html
Not for all users, only for some of those who customized the value,
etc... but we're usually more concerned about backward compatibility
than the present development seems to have indicated.
If we can argue over several days (or weeks?) about removing a key
binding that nobody uses, changing DSL in an incompatible way has to be
considered a problem.
> I kinda gave up because Philip felt extremely uneasy with dropping
> major-mode, leaving us with just derived-mode, but I still think we
> shouldn't encourage Lisp programs to use major-mode. So if you don't
> think it would be a problem, I'd be happier if we removed major-mode
> and used derived-mode instead.
If I didn't think Philip's point had merit, I wouldn't have brought it
up now.
The idea of discouraging the (eq major-mode ...) semantics (instead of
derived-mode-p) has merit, but so far we have one complex prior art for
this functionality, and it did find a use for this distinction. Two
uses, to be exact.
Another example where we might migrate to buffer-matches-p is
'turn-on-font-lock-if-desired'. And that one also currently uses
(memq major-mode font-lock-global-modes)
rather than derived-mode-p. There probably are reasons for this as well.
We could try some methods that discourage the use of 'major-mode' as
opposed to 'derived-mode'. Maybe by calling them 'major-mode-eq' and
'major-mode' (where the longer version feels more awkward and thus less
desirable). But FWIW I like the current couple of 'derived-mode' and
'major-mode' because it feels "transparent" for an experienced Elisp
programmer. Rather than having one guess that 'major-mode' uses the
derived-mode-p predicate or search for that info in the docs.
And if we change the keywords in project-kill-buffer-conditions, I
suppose it will require some migration strategy. Which is going to be a
pain.
next prev parent reply other threads:[~2022-06-14 18:43 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 22:33 bug#54296: Add buffer-matching functionality Philip Kaludercic
2022-03-09 16:20 ` Lars Ingebrigtsen
2022-03-09 20:34 ` martin rudalics
2022-03-10 10:05 ` Philip Kaludercic
2022-03-10 11:53 ` Eli Zaretskii
2022-03-10 12:13 ` Philip Kaludercic
2022-03-10 14:52 ` bug#54296: [External] : " Drew Adams
2022-03-10 16:56 ` Eli Zaretskii
2022-03-11 16:21 ` Philip Kaludercic
2022-03-11 18:34 ` Eli Zaretskii
2022-03-13 20:40 ` Philip Kaludercic
2022-03-14 3:21 ` Eli Zaretskii
2022-03-14 8:21 ` Philip Kaludercic
2022-03-14 13:00 ` Eli Zaretskii
2022-03-14 13:38 ` Philip Kaludercic
2022-06-13 0:30 ` Dmitry Gutov
[not found] ` <add2d2d0-9cdf-9048-1a62-f34e585c582e@yandex.ru>
2022-06-13 12:04 ` Eli Zaretskii
2022-06-14 18:43 ` Dmitry Gutov [this message]
2022-06-14 18:47 ` Eli Zaretskii
2022-06-14 19:36 ` Dmitry Gutov
2022-06-15 2:33 ` Eli Zaretskii
2022-06-15 11:48 ` Dmitry Gutov
2022-06-15 13:20 ` Eli Zaretskii
2022-06-15 15:56 ` Dmitry Gutov
2022-06-15 16:17 ` Eli Zaretskii
2022-06-15 16:51 ` Dmitry Gutov
2022-06-15 17:29 ` Eli Zaretskii
2022-06-16 0:47 ` Dmitry Gutov
2022-06-16 5:51 ` Eli Zaretskii
2022-06-17 1:21 ` Dmitry Gutov
2022-06-17 5:48 ` Eli Zaretskii
2022-06-17 13:39 ` Dmitry Gutov
2022-06-15 16:59 ` Philip Kaludercic
2022-06-17 1:22 ` Dmitry Gutov
2022-04-14 8:25 ` Philip Kaludercic
2022-04-15 6:56 ` Eli Zaretskii
2022-04-15 10:57 ` Philip Kaludercic
2022-06-13 0:30 ` Dmitry Gutov
[not found] ` <b4bf095c-7210-61ee-87af-3d8031caba89@yandex.ru>
2022-06-13 12:13 ` Eli Zaretskii
2022-06-14 19:00 ` Dmitry Gutov
2022-06-14 19:17 ` Eli Zaretskii
2022-06-14 19:46 ` Dmitry Gutov
2022-06-15 2:34 ` Eli Zaretskii
2022-06-15 11:54 ` Dmitry Gutov
2022-03-12 10:23 ` Augusto Stoffel
2022-03-12 11:07 ` Philip Kaludercic
2022-03-10 15:42 ` martin rudalics
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=5eb376b4-5f7e-6b00-286a-8bd0950dae22@yandex.ru \
--to=dgutov@yandex.ru \
--cc=54296@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=philipk@posteo.net \
/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.