unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: terra@diku.dk, 56407@debbugs.gnu.org
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	[thread overview]
Message-ID: <83v8sb73ga.fsf@gnu.org> (raw)
In-Reply-To: <87y1x7pd53.fsf@gmail.com> (message from João Távora on Tue, 05 Jul 2022 20:34:16 +0100)

> Cc: Morten Welinder <terra@diku.dk>
> From: João Távora <joaotavora@gmail.com>
> 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)?





  reply	other threads:[~2022-07-05 19:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 19:34 bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring eglot--managed-mode, which is not for interactive use João Távora
2022-07-05 19:40 ` Eli Zaretskii [this message]
2022-07-05 19:53   ` João Távora
2022-07-06  2:29     ` Eli Zaretskii
2022-07-06  8:12       ` João Távora
2022-07-06 11:09         ` Eli Zaretskii
2022-07-06 11:30           ` João Távora
2022-07-06 11:37             ` Lars Ingebrigtsen
2022-07-06 12:48             ` Eli Zaretskii
2022-07-06 12:59               ` João Távora
2022-07-06 13:12                 ` Eli Zaretskii
2022-07-06 13:19                   ` João Távora
2022-07-06 13:23                     ` João Távora
2022-07-06 13:39                       ` Stefan Kangas
2022-07-06 13:47                         ` João Távora
2022-07-06 13:52                           ` Stefan Kangas
2022-07-06 13:52                           ` Lars Ingebrigtsen
2022-07-06 13:59                             ` João Távora
2022-07-05 22:52   ` João Távora
2022-07-06  2:34     ` Eli Zaretskii
2022-07-06  8:27       ` João Távora
2022-07-05 19:41 ` Lars Ingebrigtsen
2022-07-05 19:56   ` João Távora

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=83v8sb73ga.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56407@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=terra@diku.dk \
    /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).