From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring eglot--managed-mode, which is not for interactive use Date: Tue, 05 Jul 2022 22:40:53 +0300 Message-ID: <83v8sb73ga.fsf@gnu.org> References: <87y1x7pd53.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10379"; mail-complaints-to="usenet@ciao.gmane.io" Cc: terra@diku.dk, 56407@debbugs.gnu.org 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 Tue Jul 05 21:42:13 2022 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 1o8oR2-0002Wt-NL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 21:42:12 +0200 Original-Received: from localhost ([::1]:34332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8oR1-0003PJ-9w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 15:42:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8oQt-0003OH-1p for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 15:42:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8oQs-0005RK-Iu for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 15:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8oQs-0006ro-Ga for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 15:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jul 2022 19:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56407 X-GNU-PR-Package: emacs Original-Received: via spool by 56407-submit@debbugs.gnu.org id=B56407.165705007126318 (code B ref 56407); Tue, 05 Jul 2022 19:42:02 +0000 Original-Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 19:41:11 +0000 Original-Received: from localhost ([127.0.0.1]:51748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8oQ3-0006qQ-6M for submit@debbugs.gnu.org; Tue, 05 Jul 2022 15:41:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8oQ1-0006po-78 for 56407@debbugs.gnu.org; Tue, 05 Jul 2022 15:41:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8oPt-00059I-1g; Tue, 05 Jul 2022 15:41:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=r7mHrJmBKcNEM65WZ4H3Y+7AQvcRi+xZu6qqH8kavKs=; b=UQkuw+ZxwXTb+2V4zQVM 7T5IBciKao2/cPBwtnwEicVpYpyUMtSLQC6rffBzAW0p/cBgJVAuM6JqkIrLNJhHKGEu0/JJaFnc5 TGMQ2rKGftLnHh/yp+Y9OPkxsBhT4+oDTVvm+ej4jIvkPe00n0Nf4Rlrmn3bMHzwAJ+/a2et+Dv2e Xx6bEKyVZQa9y6gPILgJJQGGnN6poR3HxvSxo5bbUJW0FZ4czYpWLlXGDMvX6Zj7tSHdroFtVVIHZ eD4TOxTtu85D0I2pZr6WZhXz8lSQEGT9DDH8o89dGBGobrBIib6Z1Jib/+JxTj3gvxu2/N2wfttMh myAD/PTfYmKH2g==; Original-Received: from [87.69.77.57] (port=1879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8oPs-0002Vk-HJ; Tue, 05 Jul 2022 15:41:00 -0400 In-Reply-To: <87y1x7pd53.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Tue, 05 Jul 2022 20:34:16 +0100) 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" Xref: news.gmane.io gmane.emacs.bugs:236174 Archived-At: > Cc: Morten Welinder > From: João Távora > Date: Tue, 05 Jul 2022 20:34:16 +0100 > > Hi Morten, maintainers, > > Recently, in https://github.com/joaotavora/eglot/issues/990, we found > out that users of both eglot.el and desktop.el were getting errors when > restarting Emacs. That's because desktop.el attempts to re-enable the > eglot--managed-mode minor mode which was "on" when they saved the > session (presumably on exit). > > I confirmed this with a stack trace requested from the user and came up > with this workaround in the user's config: > > (add-to-list 'desktop-minor-mode-handlers > '(eglot--managed-mode . ignore)) > > This works, but we should come up with something better. But why is the above not good enough? You could also use desktop-minor-mode-table, which is a defcustom. IOW, desktop.el already has the machinery to not restore some modes, and I see no need to make a general change like you suggest just because the mode in your case happened to have a symbol which looks like an internal one. Your change also precludes anyone to have such a mode restored, ever -- why? > This probably works (though I haven't tested), but maybe we could come > up with some other way around this, like having eglot.el propertize its > 'eglot--managed-mode' symbol so that desktop.el doesn't even write it > onto the user's save file. Or something like that. Why invent new machinery, when we already have more than enough to handle this problem (and many similar ones)?