all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: Dmitry Gutov <dmitry@gutov.dev>, Eli Zaretskii <eliz@gnu.org>,
	67463@debbugs.gnu.org, Pengji Zhang <kunhtkun@gmail.com>
Subject: bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server
Date: Sun, 07 Jan 2024 00:20:43 -0500	[thread overview]
Message-ID: <jwva5ph4tox.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CALDnm506xc2tNizomodzVFGb0zX8cDLYCh=_W7nzwdz42dZaMA@mail.gmail.com> ("João Távora"'s message of "Sun, 7 Jan 2024 01:57:59 +0000")

>> On 06/01/2024 18:01, Stefan Monnier via Bug reports for GNU Emacs, the
>> Swiss army knife of text editors wrote:
>> > -(define-derived-mode js-json-mode js-mode "JSON"
>> > +(define-derived-mode js-json-mode prog-mode "JSON"
>> > +  (js-mode) ;; For expediency, reuse js-mode, but not as parent (bug#67463).
>>
>> Nice.
>
> I agree.  If this works, I think it's quick, but not necessarily
> dirty.

It's dirty because it means `kill-all-local-variables` is called twice.
And there might be other bad side effects.

I suggest the patch below instead, which also "quick" but much less dirty.

>> Add a tool like `derived-mode-remove-parent`.
> Also agree, but the things we're doing in that symbol-plist
> seem to have gotten rather complicated lately, so I wouldn't
> be surpsied this is buggy in some edge case.

We'd first have to decide what is the behavior we want from it.
Note that `derived-mode-add-parents` doesn't really "add", it just sets
(i.e. overwrites) the list of extra-parents, so a corresponding behavior
would be for `derived-mode-remove-parent` to set a new property
`derived-mode-muted-parents`.

This said, I'm not at all sure we want/need that.  It seems that its
only use-cases would be to fix erroneous inheritance as we have here in
`js-json-mode`, which are better fixed at the source.
If users wants to work around the problem before it's fixed at its
source, they can already do something like

    (put 'js-json-mode 'derived-mode-parent nil)


-- Stefan






  reply	other threads:[~2024-01-07  5:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-26 21:15 bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server Pengji Zhang
2023-12-02 12:51 ` Eli Zaretskii
2023-12-03 18:14   ` João Távora
2023-12-03 20:51     ` João Távora
2023-12-07  1:32       ` Pengji Zhang
2023-12-16  9:30         ` Eli Zaretskii
2023-12-16 12:01           ` João Távora
2024-01-06 16:01             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06 18:04               ` Dmitry Gutov
2024-01-07  1:57                 ` João Távora
2024-01-07  5:20                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-08  0:20                     ` João Távora
2024-01-08  3:21                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-15  3:17                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=jwva5ph4tox.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67463@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=kunhtkun@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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.