From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83fs0k938h.fsf@gnu.org> <834jgio5os.fsf@gnu.org> <2eeff48a-942a-463b-999c-4a615f67d052@gutov.dev> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , Eli Zaretskii , 67463@debbugs.gnu.org, Pengji Zhang To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 07 06:21:31 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rMLbH-000389-0d for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jan 2024 06:21:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMLaq-00005U-EB; Sun, 07 Jan 2024 00:21:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMLam-00005E-VM for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 00:21:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMLaj-0004Lj-6x for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 00:21:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMLao-0005ai-4l for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 00:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jan 2024 05:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67463 X-GNU-PR-Package: emacs Original-Received: via spool by 67463-submit@debbugs.gnu.org id=B67463.170460485821476 (code B ref 67463); Sun, 07 Jan 2024 05:21:02 +0000 Original-Received: (at 67463) by debbugs.gnu.org; 7 Jan 2024 05:20:58 +0000 Original-Received: from localhost ([127.0.0.1]:60559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMLak-0005aK-8L for submit@debbugs.gnu.org; Sun, 07 Jan 2024 00:20:58 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMLai-0005a7-Ic for 67463@debbugs.gnu.org; Sun, 07 Jan 2024 00:20:57 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 983BF10009E; Sun, 7 Jan 2024 00:20:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1704604844; bh=xHJlcOwooGu+RmvBCHoFEytU0B6fHcJFqpBnPiAXpbI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jWgObi0T3pKRartwRaxD0rNfCyzx1xQro0uz1AbRR1d0mSWkikwY6NdiMnCR2ITuF YV3CVvEckwg2dQKjvc125JMB9Axq9KIof9J6hWog7cCqbnWyWsYj+DSlu3CsyGLtJ3 joDin8enUvPj53onWnth40/nDc9BxgbRXJDxfsAYeOz7eXk1zgE8Yof5fmTDfZpA9L r+LQLsX9ZzBwueqr2WNTeOt6aaivAYSwomupQV68oMw67NF411MraGjATHrn3qR1Ba CvOmKES3qLDbQaFDXSFxX33fgnSMBiNHQa/lYQGdSdWvJvP/d+VgwcQtx7y3VtFaLo 8VqbIqggsTJfg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 99D0010004C; Sun, 7 Jan 2024 00:20:44 -0500 (EST) Original-Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 621DE120B70; Sun, 7 Jan 2024 00:20:44 -0500 (EST) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sun, 7 Jan 2024 01:57:59 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277492 Archived-At: >> 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