GNU bug report logs - #56407
29.0.50; desktop.el shouldn't be saving/restoring eglot--managed-mode, which is not for interactive use

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: João Távora <joaotavora@HIDDEN>; dated Tue, 5 Jul 2022 19:34:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 11:29:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 07:29:29 2022
Received: from localhost ([127.0.0.1]:52671 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o93Dk-0002m0-H7
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2022 07:29:28 -0400
Received: from mail-ot1-f45.google.com ([209.85.210.45]:44686)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o93Dh-0002lj-UU
 for 56407 <at> debbugs.gnu.org; Wed, 06 Jul 2022 07:29:26 -0400
Received: by mail-ot1-f45.google.com with SMTP id
 m24-20020a0568301e7800b00616b5c114d4so11600205otr.11
 for <56407 <at> debbugs.gnu.org>; Wed, 06 Jul 2022 04:29:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=e13im42bzhuUDPoNVYOvO0GO+mMA0EUpR5E/mr6hSdo=;
 b=pwsgPWu/ZY418je1sJsHn2Uqx995paqkFJVuMDKNEUTwhprvvfHTAQFBtTaDlqOnjt
 cf4q5OyCPkw1QTw8YsXf6OxCbVoYzAQ35JLgKAReFCMJyBiHUJgFF3kNSjAK/wNce3x/
 orYBC5KB24zNQAno7SraZvEzECJMN8LNOt029LCLYlPMMVvNgt8jzbX1AKb6V55qCQI9
 4firWcUB7DezrIm36T6yokLk8ANfsMz+YLnAbbj/cVvr1Nc4m0QXTmqYy9+WaQy6qjNG
 KtJg+DESYwWYpsxQi6NL28podLTpsYdsxzfArV5EsRe1VgAF3NVW+SvSb3JSM+Z5GBuw
 cgsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=e13im42bzhuUDPoNVYOvO0GO+mMA0EUpR5E/mr6hSdo=;
 b=qiILiKtF2lw9dPokqXUU35Lhi5S6KjwefEIUEzhaNmm3+tCefCySk5jG0u3vGgCawg
 VOw/TKPPCfIUKJb+G5ULSHz19/URzejPL/jD2eJHpJKOcRzgq6UegD2c0t2HR05BsOKe
 jbr5FJ0iydP+BK+z38xeBRA9n92JJhA8R3tGMwKa4KEWRouC+kOY6KcffrzDx4Cpv2iy
 YBDa3TYaKxAw2V1t1JWpy4JABAdD5Hps4h46TpGFXPjnm0Doep92fD3Mf9/DOQe8Jaj4
 9AvCX2nDp1rTfL7BbZ9KwYZMVk4utPY/TOtsVJBBnCXEwulWVuT3pjb/azMwmdlGeXAg
 PZLg==
X-Gm-Message-State: AJIora9PYE0MKzGf9bgVxnXk4b5RGlXx1B5rlyHuK0+5mB1ol69cYznl
 zf+SrUW0cbSAV3Vy5vsnbR+tX5wmRGm9woxh/yk=
X-Google-Smtp-Source: AGRyM1vb/WItpSGVB+bg3Ka86aYl8No2zk02VNtrBlbTWv1x2YJkIKRzSa6xdBD7LnwJ6wGn1A3bou+p9yprytyxJ+o=
X-Received: by 2002:a9d:4e91:0:b0:616:8273:76e6 with SMTP id
 v17-20020a9d4e91000000b00616827376e6mr17061067otk.340.1657106960138; Wed, 06
 Jul 2022 04:29:20 -0700 (PDT)
MIME-Version: 1.0
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87tu7vpc8y.fsf@HIDDEN> <83tu7v6kjv.fsf@HIDDEN>
 <CALDnm50VWdavgMGgoK4+t0iuL-NOXxhjNy73yFWsvjWDujRzUA@HIDDEN>
 <83r12y7b0y.fsf@HIDDEN>
In-Reply-To: <83r12y7b0y.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 6 Jul 2022 12:30:28 +0100
Message-ID: <CALDnm50JmcUCZ7zd+Pei=xJAhbezpgG2Gp7FW-XYTTwfqqkWNg@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000b6c66905e321475b"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000b6c66905e321475b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 6, 2022 at 12:09 PM Eli Zaretskii <eliz@HIDDEN> wrote:


> > Oh, it's an autoloaded variable.  OK then, it'll work. It'll load in
> desktop.el
> > though.
>
> I feel there's some misunderstanding here.  What I meant is simply add
> eglot--managed-mode to the default value of the variable in
> desktop.el.  Why would that require loading desktop.el?
>

Indeed, I misunderstood. I thought you meant adding that to eglot.el.

But then I'd say it is even worse, as you're informing desktop.el
about an implementation detail of eglot.el.  If I change that minor
mode's name, then I have to change desktop.el as well.

>  > I think I like Lars's solution best.
> >  I don't: it makes the information spread out and harder to find.
> > Depends on whether one thinks using the global symbol table in Elisp is
> > counts as "spread out". I don't.
> What do you mean by "global symbol table"?
>

The obarray.

What I meant is that having all the modes which desktop.el treats
> specially in one place in desktop.el makes it easier to find out which
> modes are those, than if each of the modes had something like
> "(put foo-mode 'desktop...)" in its own file.  Because in the latter
> case, if I want to know which modes are handled specially by desktop,
> I'd need to search the entire tree.
>

mapatoms is used all the time, it's fast and it can answer that.

But typically I think, the question would be: "Why isn't this mode X being
handled as I expect it to?", and then the answer would be easy.  Except
that even that question is hard to conceive in this particular case: why
would
someone be concerned about `eglot--managed-mode`, if it's an
implementation detail?

I think we use symbol properties very often and to good effect.  For exampl=
e
to describe the file-local safety of variables.


> > There's a nice upside to it, which is it prevents people like me not
> > interested in desktop.el at all from having it autoloaded just by loadi=
ng
> >  eglot.el.  The things eglot.el is trying to say to desktop.el is "stay
> out of
> > my minor mode" so it is strange that it has to pull in desktop.el every
> time
> > just to say that.
>
> See above: I don't think I understand why would you need to load
> desktop.el.  The variable desktop-minor-mode-table is of interest only
> when the desktop is saved or restored, and at that time desktop.el is
> already loaded, of course.  No other code anywhere else should need to
> consult desktop-minor-mode-table.  Or what am I missing?
>

See above. I thought you meant putting the line into eglot.el which would
work but needs loading desktop.el. Conversely, putting the eglot-specific
line
in desktop.el is putting eglot.el implementation details outside eglot.el,
which
is bad.

So, either way, using the desktop-minor-mode-table for this is a poor
choice,
which logically means that the information should be stored in the symbol,
which exists in the global symbol table (the obarray).

Interestingly, a hook variable doesn't have this drawback, btw.  In fact,
they seem to have been designed to avoid this class of problems. But
d-m-m-table is not a hook variable.

Jo=C3=A3o T=C3=A1vora

--000000000000b6c66905e321475b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Wed, Jul 6, 2022 at 12:09 PM Eli Zaretskii &lt;<a href=3D"mailto:=
eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><div>=C2=A0</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
&gt; Oh, it&#39;s an autoloaded variable.=C2=A0 OK then, it&#39;ll work. It=
&#39;ll load in desktop.el <br>
&gt; though.<br>
<br>
I feel there&#39;s some misunderstanding here.=C2=A0 What I meant is simply=
 add<br>
eglot--managed-mode to the default value of the variable in<br>
desktop.el.=C2=A0 Why would that require loading desktop.el?<br></blockquot=
e><div><br></div><div>Indeed, I misunderstood. I thought you meant adding t=
hat to eglot.el.</div><div><br></div><div>But then I&#39;d say it is even w=
orse, as you&#39;re informing desktop.el <br></div><div>about an implementa=
tion detail of eglot.el.=C2=A0 If I change that minor <br></div><div>mode&#=
39;s name, then I have to change desktop.el as well.=C2=A0 <br></div><div><=
/div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

&gt;=C2=A0 &gt; I think I like Lars&#39;s solution best.<br>
&gt;=C2=A0 I don&#39;t: it makes the information spread out and harder to f=
ind.<br>
&gt; Depends on whether one thinks using the global symbol table in Elisp i=
s<br>
&gt; counts as &quot;spread out&quot;. I don&#39;t.<br>
What do you mean by &quot;global symbol table&quot;?<br></blockquote><div><=
br></div><div>The obarray. <br></div><div><br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
What I meant is that having all the modes which desktop.el treats<br>
specially in one place in desktop.el makes it easier to find out which<br>
modes are those, than if each of the modes had something like<br>
&quot;(put foo-mode &#39;desktop...)&quot; in its own file.=C2=A0 Because i=
n the latter<br>
case, if I want to know which modes are handled specially by desktop,<br>
I&#39;d need to search the entire tree.<br></blockquote><div><br></div><div=
>mapatoms is used all the time, it&#39;s fast and it can answer that.<br></=
div><div><br></div><div>But typically I think, the question would be: &quot=
;Why isn&#39;t this mode X being</div><div>handled as I expect it to?&quot;=
, and then the answer would be easy.=C2=A0 Except</div><div>that even that =
question is hard to conceive in this particular case: why would <br></div><=
div>someone be concerned about `eglot--managed-mode`, if it&#39;s an <br></=
div><div>implementation detail?</div><div><br></div><div>I think we use sym=
bol properties very often and to good effect.=C2=A0 For example</div><div>t=
o describe the file-local safety of variables.<br></div><div>=C2=A0<br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; There&#39;s a nice upside to it, which is it prevents people like me n=
ot <br>
&gt; interested in desktop.el at all from having it autoloaded just by load=
ing<br>
&gt;=C2=A0 eglot.el.=C2=A0 The things eglot.el is trying to say to desktop.=
el is &quot;stay out of<br>
&gt; my minor mode&quot; so it is strange that it has to pull in desktop.el=
 every time<br>
&gt; just to say that.<br>
<br>
See above: I don&#39;t think I understand why would you need to load<br>
desktop.el.=C2=A0 The variable desktop-minor-mode-table is of interest only=
<br>
when the desktop is saved or restored, and at that time desktop.el is<br>
already loaded, of course.=C2=A0 No other code anywhere else should need to=
<br>
consult desktop-minor-mode-table.=C2=A0 Or what am I missing?<br></blockquo=
te><div><br></div><div>See above. I thought you meant putting the line into=
 eglot.el which would</div><div>work but needs loading desktop.el. Converse=
ly, putting the eglot-specific line</div><div>in desktop.el is putting eglo=
t.el implementation details outside eglot.el, which</div><div>is bad.</div>=
<div><br></div><div>So, either way, using the desktop-minor-mode-table for =
this is a poor choice, <br></div><div>which logically means that the inform=
ation should be stored in the symbol, <br></div><div>which exists in the gl=
obal symbol table (the obarray).<br></div><div><br></div><div>Interestingly=
, a hook variable doesn&#39;t have this drawback, btw.=C2=A0 In fact, <br><=
/div><div>they seem to have been designed to avoid this class of problems. =
But <br></div><div>d-m-m-table is not a hook variable.<br></div><br></div><=
div dir=3D"ltr" class=3D"gmail_signature">Jo=C3=A3o T=C3=A1vora</div></div>

--000000000000b6c66905e321475b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 11:09:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 07:09:48 2022
Received: from localhost ([127.0.0.1]:52628 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o92ui-0008Tp-7g
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2022 07:09:48 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55884)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1o92uf-0008Ta-JS
 for 56407 <at> debbugs.gnu.org; Wed, 06 Jul 2022 07:09:47 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42948)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o92ua-0007BL-CD; Wed, 06 Jul 2022 07:09:40 -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=vv4mwXut5LqlPDvFkXmzS/Pdn5p1Yh0ei4Z3F6FhQLA=; b=O+XW9Shr5WZCOBNBQxZS
 s7lgdyRhTpnnLNPMtfwlAHvONv5xi82dEYoKgsMl5vAfG380mAW9d0XXJPu3FN28WiWnKIAbJaDhz
 6JGhNe1bYme6TzgW/BZHaap5qxvLM+rS+Kuq/suNW1vNx3BHOzdzo1v+gSn9C5xUm1yEdH3xDIFOX
 e8ZDiFowUbQyBVDZ/0RXIfACOqVmkq+mdUM9QvCHbbu9lpvR9c5MwR2gpE4JqeaVS8S/j/RkGdNTp
 RlTK19s2AB3eJAtWpwwBujUU7xcoMNWlh4hfJNKW2T2OtbH3hWoA+Zl6biZvLbjt1BO/tFk0+CsZn
 Agf89XOX1Xk+8w==;
Received: from [87.69.77.57] (port=2917 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o92uZ-0000YB-Sg; Wed, 06 Jul 2022 07:09:40 -0400
Date: Wed, 06 Jul 2022 14:09:33 +0300
Message-Id: <83r12y7b0y.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <CALDnm50VWdavgMGgoK4+t0iuL-NOXxhjNy73yFWsvjWDujRzUA@HIDDEN>
 (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Wed, 6 Jul 2022 09:12:39
 +0100)
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87tu7vpc8y.fsf@HIDDEN> <83tu7v6kjv.fsf@HIDDEN>
 <CALDnm50VWdavgMGgoK4+t0iuL-NOXxhjNy73yFWsvjWDujRzUA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Date: Wed, 6 Jul 2022 09:12:39 +0100
> Cc: 56407 <at> debbugs.gnu.org
> 
>  I see no reason to require: you just add a value to the list, that's
>  all.
> 
> Oh, it's an autoloaded variable.  OK then, it'll work. It'll load in desktop.el 
> though.

I feel there's some misunderstanding here.  What I meant is simply add
eglot--managed-mode to the default value of the variable in
desktop.el.  Why would that require loading desktop.el?

>  > I think I like Lars's solution best.
> 
>  I don't: it makes the information spread out and harder to find.
> 
> Depends on whether one thinks using the global symbol table in Elisp is
> counts as "spread out". I don't.

What do you mean by "global symbol table"?

What I meant is that having all the modes which desktop.el treats
specially in one place in desktop.el makes it easier to find out which
modes are those, than if each of the modes had something like
"(put foo-mode 'desktop...)" in its own file.  Because in the latter
case, if I want to know which modes are handled specially by desktop,
I'd need to search the entire tree.

> There's a nice upside to it, which is it prevents people like me not 
> interested in desktop.el at all from having it autoloaded just by loading
>  eglot.el.  The things eglot.el is trying to say to desktop.el is "stay out of
> my minor mode" so it is strange that it has to pull in desktop.el every time
> just to say that.

See above: I don't think I understand why would you need to load
desktop.el.  The variable desktop-minor-mode-table is of interest only
when the desktop is saved or restored, and at that time desktop.el is
already loaded, of course.  No other code anywhere else should need to
consult desktop-minor-mode-table.  Or what am I missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 08:26:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 04:26:10 2022
Received: from localhost ([127.0.0.1]:52206 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o90MM-0003ay-7A
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2022 04:26:10 -0400
Received: from mail-oa1-f46.google.com ([209.85.160.46]:35774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o90MK-0003ak-NH
 for 56407 <at> debbugs.gnu.org; Wed, 06 Jul 2022 04:26:09 -0400
Received: by mail-oa1-f46.google.com with SMTP id
 586e51a60fabf-10be0d7476aso13641244fac.2
 for <56407 <at> debbugs.gnu.org>; Wed, 06 Jul 2022 01:26:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=z/ueSs7F7+AsyreicCdaButG88rBH1/kOge3MUwz6Jg=;
 b=AV5f60XUTYqWv9++26s0q6lId6Y2GfRg8yx6sQKgTQTYy2CILSlaxhm/WgUyDCMyBF
 Lu9QR3JDxGxcjRWQoQrIQuVjVX0/qzItvMdYPs25b0IjE+LZjbk3ARS3capIe/i/5jVE
 quw7hKtN7+ZOwHWwSToJ5oL9ec9GrURsm3SdlFyYjiklbUmS9KsgC7uux4ykg53t5JeG
 Ycei9cX5PNv8qukh2jUIP8MDfBxxBAFh0N7qnsIMz+ADgIMk9y4Xwi2YmhVoiyKkPYEf
 x7TBJ0AMJZTJZUDwKv2XLOZBYv8ZBnavec1QlLb83aotZpyRd8KbZaJNwBF6WJOXF+OD
 GP4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=z/ueSs7F7+AsyreicCdaButG88rBH1/kOge3MUwz6Jg=;
 b=1Oxhb+8kYvTx4MGbLgdzRYdfR15KL1W83DyIdR+9LuyhWh/4hEBIy4EbbSd4rOtOTR
 sUZjZ17ftErcQVtWdSE5kLv+kpK4ndGOilAt0BDn9rqO5VsJrMpd2etPMAD6vgxm+s0k
 NRdCwULDZlJ17bYcGI3i6HUPB0aMK9eDavq5IDbVFvkktsAmBcjwQuAvY+blu+4wk2UC
 bG8piQ43go0jqqxSDvJj8vLXYnZWDqvsiVNoiZfE8AEgAWKirbXUkrquwu1p0c2Tlf2F
 eIuuGD6z+Zxw/imyf8UtPsY1dffUZu033WFJHx0ABupWpIyS2a21kXIYwtAEBiTki/5C
 bwqA==
X-Gm-Message-State: AJIora9eSDqHNeE+1K4ssBGBKj7GNSXZW8EvcVVHgebVGtXY3zAqjwL1
 NAmUBiZ3LOJ3E5bMDzRVmfWxAGJpMaZzv/6waC8=
X-Google-Smtp-Source: AGRyM1sF3tqEArYf7qR30SOzWk/yHIojTljAffW68dSZ2iVeN1mnrDsKekSjCreBeqHVRnfJN5+bjhh1U1ArdAZEgsQ=
X-Received: by 2002:a05:6870:8925:b0:fe:4638:dc01 with SMTP id
 i37-20020a056870892500b000fe4638dc01mr24894777oao.209.1657095962516; Wed, 06
 Jul 2022 01:26:02 -0700 (PDT)
MIME-Version: 1.0
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87let7p3yk.fsf@HIDDEN> <83sfnf6kbl.fsf@HIDDEN>
In-Reply-To: <83sfnf6kbl.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 6 Jul 2022 09:27:10 +0100
Message-ID: <CALDnm50RNJf6AY+zPfNSnWxLa1PAzy4qO646QhO9JSX-s=C8xg@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000003461ea05e31eb897"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000003461ea05e31eb897
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 6, 2022 at 3:34 AM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
> > Cc: 56407 <at> debbugs.gnu.org
> > Date: Tue, 05 Jul 2022 23:52:35 +0100
> >
> > Eli Zaretskii <eliz@HIDDEN> writes:
> >
> > >  Your change also precludes anyone to have such
> > > a mode restored, ever -- why?
> >
> > I'm sorry, I realize I didn't answer this part of your email earlier.
> >
> > eglot--managed-mode is a special minor mode:
>
> I meant _any_ mode that has "--" in its symbol, not just
> eglot--managed-mode.  I don't want to preclude restoration of any such
> modes, from now to eternity, it's too heavy a promise to make.
>

I think there are no promises made on those modes anyway,
because they are implementation details, by their authors'
definition.

But I agree it's not the prettiest kludge.

Jo=C3=A3o

--0000000000003461ea05e31eb897
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Jul 6, 2022 at 3:34 AM Eli Zarets=
kii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">&gt; From: Jo=C3=A3o T=C3=A1vora &lt;<a href=3D"mailto:joaotavora@gmail=
.com" target=3D"_blank">joaotavora@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:56407 <at> debbugs.gnu.org" target=3D"_blank">56407@d=
ebbugs.gnu.org</a><br>
&gt; Date: Tue, 05 Jul 2022 23:52:35 +0100<br>
&gt; <br>
&gt; Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">el=
iz@HIDDEN</a>&gt; writes:<br>
&gt; <br>
&gt; &gt;=C2=A0 Your change also precludes anyone to have such<br>
&gt; &gt; a mode restored, ever -- why?<br>
&gt; <br>
&gt; I&#39;m sorry, I realize I didn&#39;t answer this part of your email e=
arlier.<br>
&gt; <br>
&gt; eglot--managed-mode is a special minor mode:<br>
<br>
I meant _any_ mode that has &quot;--&quot; in its symbol, not just<br>
eglot--managed-mode.=C2=A0 I don&#39;t want to preclude restoration of any =
such<br>
modes, from now to eternity, it&#39;s too heavy a promise to make.<br></blo=
ckquote><div><br></div><div>I think there are no promises made on those mod=
es anyway, <br></div><div>because they are implementation details, by their=
 authors&#39; <br></div><div>definition. <br></div></div><div><br></div><di=
v>But I agree it&#39;s not the prettiest kludge.</div><div><br></div><div>J=
o=C3=A3o<br></div><div><br></div></div>

--0000000000003461ea05e31eb897--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 08:11:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 06 04:11:39 2022
Received: from localhost ([127.0.0.1]:52181 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o908J-0003CM-CP
	for submit <at> debbugs.gnu.org; Wed, 06 Jul 2022 04:11:39 -0400
Received: from mail-oi1-f182.google.com ([209.85.167.182]:46818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o908H-0003C8-NT
 for 56407 <at> debbugs.gnu.org; Wed, 06 Jul 2022 04:11:38 -0400
Received: by mail-oi1-f182.google.com with SMTP id i3so19038894oif.13
 for <56407 <at> debbugs.gnu.org>; Wed, 06 Jul 2022 01:11:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=6X/BFXynYlBfGMaI4HjlOhGYEZq5SAsw93l63Bangs0=;
 b=aNFoSJaUPy8ngvuZ0UzzA0izIzkRkOVagZAGVNEgSojq65gWb8dkL/RvIWMTmI6/L7
 IiTG3cn14up/HBE2OwDQw/H5tPMTmsgroqQsjUPqek05EDsOtXqqfUhAJnjSRGd++h3x
 LRbPXGCEzjQKTGZqE3QMLqnHa7gdlYDlMfQvgsLLQhl6q6Pae+UFGj5n0l2ExMraaZRg
 7R/VE38xWz+q9D/uZH/3Y/QQB+ZPY2bOwZrNOwr2m0XZHYIRMucpGMlVnLwsq7Md3Ajv
 UpfXRWqVSguoNWje6Nj9BcmzeTAb7Mkp+kgzqBzCE1LyllQqvklWn00uchGZVZjiJ7bY
 G80w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=6X/BFXynYlBfGMaI4HjlOhGYEZq5SAsw93l63Bangs0=;
 b=GVBknQND41ez9CQzSnYJuY+SWTBuRVHhuGOBb+xdUfrWWCAaKEu4Pdj35sZRQ4QsQg
 FywHXBm0GT2x5fmh925pEfGv0qlkLlAGCxf48NEJSdI/LY55i3s+srV73cABsu5z7jCa
 546mfh4jgmU1Gy2fuiYmh46WQ85kUR9kgfNQoQJpe4E8yFbm9CWEHDHsdeq9xeeJBV39
 d+Wj4XydrulskqYfObfq2sSbmeQN5hRFM+BcuXSflcuuemOGzxt6KvhlDk176BSV/Lhe
 e8f9sgn6V/9qm4/o5JJ71K6omgK5M5OF72uZ+kvUelorrx6VPk5seo0XEDLmOCU/Zg35
 82DQ==
X-Gm-Message-State: AJIora8E+X+kZLD25QAilQ+Zc8vbFOn7GIn2nA+CI9L/m3DgcZbwgTIW
 on7JEXH+nNwF9hfmYZd/4YB59yXuq+PWSkGITt6g8YMw
X-Google-Smtp-Source: AGRyM1uMS3oUQWo7fFgnuWN7KqHGfyRMEo/MHY286snu9QbG7I3Kd6OygUbfNM1jtLWe7fSBIIIghDYh72NMaKYGf8w=
X-Received: by 2002:aca:4b90:0:b0:335:b574:6108 with SMTP id
 y138-20020aca4b90000000b00335b5746108mr19834071oia.19.1657095091771; Wed, 06
 Jul 2022 01:11:31 -0700 (PDT)
MIME-Version: 1.0
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87tu7vpc8y.fsf@HIDDEN> <83tu7v6kjv.fsf@HIDDEN>
In-Reply-To: <83tu7v6kjv.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Wed, 6 Jul 2022 09:12:39 +0100
Message-ID: <CALDnm50VWdavgMGgoK4+t0iuL-NOXxhjNy73yFWsvjWDujRzUA@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000004ddf8005e31e84df"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000004ddf8005e31e84df
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 6, 2022 at 3:29 AM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN>
> > Cc: 56407 <at> debbugs.gnu.org,  terra@HIDDEN
> > Date: Tue, 05 Jul 2022 20:53:33 +0100
> >
> > Eli Zaretskii <eliz@HIDDEN> writes:
> >
> > >> 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.
> >
> > At first I thought it was a customization variable and that would make
> > it user-specific overwritable etc.  But I see now that evidently it is
> > not.  According to the docstring of d-m-m-handlers, eglot.el could just
> > just contain the above invocation, indeed.
> >
> > But that has the downside that eglot.el must require "desktop.el" which
> > IMO opinion too strongly couples the two packages.
>
> I see no reason to require: you just add a value to the list, that's
> all.
>

Oh, it's an autoloaded variable.  OK then, it'll work. It'll load in
desktop.el
though.

> I think I like Lars's solution best.
>
> I don't: it makes the information spread out and harder to find.
>

Depends on whether one thinks using the global symbol table in Elisp is
counts as "spread out". I don't.

There's a nice upside to it, which is it prevents people like me not
interested in desktop.el at all from having it autoloaded just by loading
 eglot.el.  The things eglot.el is trying to say to desktop.el is "stay out
of
my minor mode" so it is strange that it has to pull in desktop.el every tim=
e
just to say that.

Jo=C3=A3o T=C3=A1vora

--0000000000004ddf8005e31e84df
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Jul 6, 2022 at 3:29 AM Eli Zarets=
kii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">&gt; From: Jo=C3=A3o T=C3=A1vora &lt;<a href=3D"mailto:joaotavora@gmail=
.com" target=3D"_blank">joaotavora@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:56407 <at> debbugs.gnu.org" target=3D"_blank">56407@d=
ebbugs.gnu.org</a>,=C2=A0 <a href=3D"mailto:terra@HIDDEN" target=3D"_blank=
">terra@HIDDEN</a><br>
&gt; Date: Tue, 05 Jul 2022 20:53:33 +0100<br>
&gt; <br>
&gt; Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">el=
iz@HIDDEN</a>&gt; writes:<br>
&gt; <br>
&gt; &gt;&gt; I confirmed this with a stack trace requested from the user a=
nd came up<br>
&gt; &gt;&gt; with this workaround in the user&#39;s config:<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt;=C2=A0 =C2=A0 =C2=A0(add-to-list &#39;desktop-minor-mode-handl=
ers<br>
&gt; &gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 &#39;(eglot--managed-mode . ignore))<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; This works, but we should come up with something better.<br>
&gt; &gt;<br>
&gt; &gt; But why is the above not good enough?=C2=A0 You could also use<br=
>
&gt; &gt; desktop-minor-mode-table, which is a defcustom.<br>
&gt; <br>
&gt; At first I thought it was a customization variable and that would make=
<br>
&gt; it user-specific overwritable etc.=C2=A0 But I see now that evidently =
it is<br>
&gt; not.=C2=A0 According to the docstring of d-m-m-handlers, eglot.el coul=
d just<br>
&gt; just contain the above invocation, indeed.<br>
&gt; <br>
&gt; But that has the downside that eglot.el must require &quot;desktop.el&=
quot; which<br>
&gt; IMO opinion too strongly couples the two packages.<br>
<br>
I see no reason to require: you just add a value to the list, that&#39;s<br=
>
all.<br></blockquote><div><br></div><div>Oh, it&#39;s an autoloaded variabl=
e.=C2=A0 OK then, it&#39;ll work. It&#39;ll load in desktop.el <br></div><d=
iv>though.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">
&gt; I think I like Lars&#39;s solution best.<br>
<br>
I don&#39;t: it makes the information spread out and harder to find.<br></b=
lockquote><div><br></div><div>Depends on whether one thinks using the globa=
l symbol table in Elisp is</div><div>counts as &quot;spread out&quot;. I do=
n&#39;t.<br></div><div><br></div><div>There&#39;s a nice upside to it, whic=
h is it prevents people like me not <br></div><div>interested in desktop.el=
 at all from having it autoloaded just by loading</div><div>=C2=A0eglot.el.=
=C2=A0 The things eglot.el is trying to say to desktop.el is &quot;stay out=
 of</div><div>my minor mode&quot; so it is strange that it has to pull in d=
esktop.el every time</div><div>just to say that.</div></div><br><div dir=3D=
"ltr" class=3D"gmail_signature">Jo=C3=A3o T=C3=A1vora</div></div>

--0000000000004ddf8005e31e84df--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 02:34:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 22:34:41 2022
Received: from localhost ([127.0.0.1]:51979 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8usC-0002NG-S4
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 22:34:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51840)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1o8usB-0002N4-E2
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 22:34:39 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58956)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o8us3-00047D-M6; Tue, 05 Jul 2022 22:34:32 -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=9FwMlRDm1moP/JuR8Bb+J4ukJhvrzSn6b+9nvKxqav8=; b=MwGh2460yyasO5Z1NBsY
 h3qZuuVqzH2/4sirtHpjvjcqnd/hD8mlEZ6VKSwAchbOw4haqrN7VJJWh1UA3z8O6b40RuhdIoAL0
 UKUjebxM1yvoXDB9KrE6WQKXUV/ZvidcMmgXdl6j1es3ECGt32PMj8FI/mOvfu0kgtWFCqMHN1B/3
 lHMLNmepKDxQgPU9is6aO8hJJPOvQMpyh1JLuL3oYorJVPCeExl+6ZTKYpPbig6KolqeapDZpvrRl
 KP32QUImr7Hs8vplwkJSoY2QIrYWNmvTIBwLX+RNUqYGBv8GJm/77fa1utgJ8Ww/A08Xbvm16d3rk
 zH/zprETf4KchQ==;
Received: from [87.69.77.57] (port=3321 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o8urj-0008Es-Mr; Tue, 05 Jul 2022 22:34:17 -0400
Date: Wed, 06 Jul 2022 05:34:06 +0300
Message-Id: <83sfnf6kbl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87let7p3yk.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Tue, 05 Jul 2022 23:52:35 +0100)
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87let7p3yk.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Cc: 56407 <at> debbugs.gnu.org
> Date: Tue, 05 Jul 2022 23:52:35 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >  Your change also precludes anyone to have such
> > a mode restored, ever -- why?
> 
> I'm sorry, I realize I didn't answer this part of your email earlier.
> 
> eglot--managed-mode is a special minor mode:

I meant _any_ mode that has "--" in its symbol, not just
eglot--managed-mode.  I don't want to preclude restoration of any such
modes, from now to eternity, it's too heavy a promise to make.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 6 Jul 2022 02:29:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 22:29:32 2022
Received: from localhost ([127.0.0.1]:51973 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8unE-0002ED-6c
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 22:29:32 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51110)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1o8unA-0002Dz-65
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 22:29:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:58756)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o8un2-0001ud-SR; Tue, 05 Jul 2022 22:29:21 -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=aEZfX5/oyZzOK7CBXoRxv7Yvn287D6iYCfQju1OfqoM=; b=VfM4Ug2gnV+vDGVmt1fl
 ARLTr3v5Uwf/EcFghia6m4PveNapGlUL2gSoK3D4LIJapUJh08dxhprH9Txaqv/je1PM3E44dWF3I
 SVdUFjSA2M9FYdAO+dtyKGrtcSvq9xKSw7HeoQEW4D/bvNuZySVsdH/VZKdiC3cDHx3i3XyDlcB5n
 7afFJrn9O4TPCjHqqSL43wuo4lw9Ms6w2pjM0qyTzmIbq0wOgySgzoNq079DUhPku2001RJHZXYze
 HXleFRUIr07EzV0DROGorVWUMMy6Mxx4vzPhLewaDoTsi3cUHe45PRVTkWdiCicz6Fh5AtdOpHaeB
 r/9/C/qczm0mnw==;
Received: from [87.69.77.57] (port=3022 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o8umx-00015k-Da; Tue, 05 Jul 2022 22:29:17 -0400
Date: Wed, 06 Jul 2022 05:29:08 +0300
Message-Id: <83tu7v6kjv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87tu7vpc8y.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Tue, 05 Jul 2022 20:53:33 +0100)
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
 <87tu7vpc8y.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56407
Cc: terra@HIDDEN, 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: João Távora <joaotavora@HIDDEN>
> Cc: 56407 <at> debbugs.gnu.org,  terra@HIDDEN
> Date: Tue, 05 Jul 2022 20:53:33 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> 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.
> 
> At first I thought it was a customization variable and that would make
> it user-specific overwritable etc.  But I see now that evidently it is
> not.  According to the docstring of d-m-m-handlers, eglot.el could just
> just contain the above invocation, indeed.
> 
> But that has the downside that eglot.el must require "desktop.el" which
> IMO opinion too strongly couples the two packages.

I see no reason to require: you just add a value to the list, that's
all.

> I think I like Lars's solution best.

I don't: it makes the information spread out and harder to find.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 22:51:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 18:51:42 2022
Received: from localhost ([127.0.0.1]:51889 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8rOB-0005OK-1l
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 18:51:42 -0400
Received: from mail-wr1-f49.google.com ([209.85.221.49]:36693)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o8rO9-0005O8-K5
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 18:51:26 -0400
Received: by mail-wr1-f49.google.com with SMTP id o4so19547655wrh.3
 for <56407 <at> debbugs.gnu.org>; Tue, 05 Jul 2022 15:51:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=Zc6Ass6N9+2WB+8s+DiRwMC5O1aEUAIFHew1Jxx8hiM=;
 b=DdRD011WG280dGSjSCnSJyhwNwSs60/Don5Yb4tMWQmPCxpVoq0bd2TlbbEJSfR2jb
 kqwiukp22ES/+41CYK0qmS0KvocRRQuZSdw05fXPJzanjYkHN431q75Rgy+GNBqTy6Qu
 HHyp3ciIjUsoiRbBDVF/4u3SfTvgW151AB69KmC/W5PhO2IFD4pVdARjZQQX6ghEt/Yb
 a0ArCG/PXnZDHJX0osTZHKqKuW5VlHiILwy09f8r6/15pWP9huX5QwbjVkwphYbd0XoO
 jGVx7bPibgdoMPiG/eX8CwOET8thrvuhPGxjpGmmub2DguaHVBy8eQv+JYN9zt+qEErZ
 wjIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=Zc6Ass6N9+2WB+8s+DiRwMC5O1aEUAIFHew1Jxx8hiM=;
 b=MeBDO1OOhyPeQnCAt0ZmD5HMM4Lne1gUp5LSXokMG1QYqbLctNA8LAqQCxKqZ6e0sg
 Aa7C52Tun3n2sdx+w0xA/ZdxSLBxFcrN4ev40Y5+BPq0dWIEMPS4Tr6Ge03URMbQJOnb
 FrGxoIs8dHnqoCLfuWilUYIZoiIXX1o6dHvGbwjaJgxx27V8ZENLqHblA+FWXEOYJ6IW
 ymgKD6FtZFOw7zSs1MRUPubAyo8J5rUyXqd/qlPOvRUukWBjC57TwLVD/lNmLEU7+JHr
 tLVeiQldxJ76rbDDZGwuiZCUtAukMrRNJENVtWDrfPQ1AbcbuaemrsLRTNQkilcoOXOx
 YgJA==
X-Gm-Message-State: AJIora+u8ratdGUi2Td6mZWru8Keyco859ymbA4BTX1USIJyMQdFpjfD
 SDxhGjxZ3rzUbQ8H9R3ye2CjPNd9pL0=
X-Google-Smtp-Source: AGRyM1u5PW7dLVrXzDSXOJqemLcgiVsWgxGidldgOeAWE9uoeFaNscxtaYpcU1BOhfDvfLn1kwGwYA==
X-Received: by 2002:a5d:4ccd:0:b0:21d:7369:e3b3 with SMTP id
 c13-20020a5d4ccd000000b0021d7369e3b3mr5196702wrt.585.1657061479118; 
 Tue, 05 Jul 2022 15:51:19 -0700 (PDT)
Received: from krug ([87.196.73.211]) by smtp.gmail.com with ESMTPSA id
 j8-20020a05600c190800b0039c5642e430sm26718636wmq.20.2022.07.05.15.51.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Jul 2022 15:51:18 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
Date: Tue, 05 Jul 2022 23:52:35 +0100
In-Reply-To: <83v8sb73ga.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 05 Jul
 2022 22:40:53 +0300")
Message-ID: <87let7p3yk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>  Your change also precludes anyone to have such
> a mode restored, ever -- why?

I'm sorry, I realize I didn't answer this part of your email earlier.

eglot--managed-mode is a special minor mode: although the function is
created by define-minor-mode, it is not meant to be turned interactively
for example.  It needs certain preconditions to be true before turning
it on and off.  If this was all there it could perhaps be arranged with
some of those special function, but a very important detail here is that
these preconditions cannot be on per-buffer.  The most important of them
regards a connection to an LSP server which has a view over _all_
buffers in a certain major mode within a certain project.  Eglot has
machinery to carefully manage this, and I'm not sure it is easy or wise
to transfer or invoke that machinery in desktop.el's mode-restoring
functions.

Also, eglot--managed-mode is really an implementation detail that is
subject to change.  Not only theoretically, but practically, too, as I
ponder the ability to have more than one server active for any given
buffer at a time.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 19:55:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:55:37 2022
Received: from localhost ([127.0.0.1]:51773 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8oe0-0007F9-S3
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:55:37 -0400
Received: from mail-wr1-f50.google.com ([209.85.221.50]:42662)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o8ody-0007Eu-0U
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:55:35 -0400
Received: by mail-wr1-f50.google.com with SMTP id s1so19026520wra.9
 for <56407 <at> debbugs.gnu.org>; Tue, 05 Jul 2022 12:55:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=y25AbWieGlp0tKXTfexpmeRb5949a8kFQdvsXt6/FVI=;
 b=SzIdonF0UWUkMSh7x3Blr8a10GynpW6atA/lC+4OralKY+e8NM1aYA8wQlIA346wbG
 H1jpxO1+7JQ4Ol/GD8gZwvuz2LIGdCc9MR6X1CaawT4wpK19jfyZQfciOZh7ukxAqMkQ
 YCxelcx1JWv8H90M9YdQD1X0V/a9+75/vaSdfZf3FLNpmkRDM4OI/vY5theQfRe/2trb
 h6LU9D4nPdDI4Kn97b2fvf0qL+9tcPz5ZE1pell4MixzvRj9HE4FrLW9flUbxGWAaAEk
 W1ytSMpzZ7d4ZgRe95BZQQNC0yWnShboHBvIjQvEcEiNswvRBtR/+Hy24FWR1QXpNhfG
 MN1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=y25AbWieGlp0tKXTfexpmeRb5949a8kFQdvsXt6/FVI=;
 b=jhaCMZ53aWd+dyfz7rhnH7e6xB7k/3nbH3oXF5ts1l3zMW7zQwnEuIA1WmdeVHJ07J
 Kk3UAX9IvEuYNRf/2JLx5sNLitqjDBSdR6wKuJaXCYZ02aH20q7M43e5g00pzpcoJYRW
 Zko2LjcMCgxF1o55ZNxlFozD2i1dWgVafY1F6j3vUKq25XUvshqdDhjArRhPBnX1INvj
 +0yhnr9iaDRDvMBu/hWkfaV2RsFtLu9CM2t9n5gYFtL6adETfE4UNS9b642nmIkgov90
 ATbRngVtY8EH0h51iEsgZnAcXBVXroIRX+Dh2eSv6uj1zC0Lk/OXOi8Yh0ydx5ZxBhaU
 xtEA==
X-Gm-Message-State: AJIora9KrG7UsiA/0Xhvl5CYzf3Ygejp/zFp0ediubdb7dOSEiLNZJ3O
 siXxN4L/aI+JCwMqsV0cWiA=
X-Google-Smtp-Source: AGRyM1tU3s+7sT+8fqo3SxDebh/dzYZzLrHIUAeY3sact9ozDfcmEpJb+v3aVsg2XWdYX2ryC1WPTg==
X-Received: by 2002:a05:6000:1c06:b0:21d:60ea:e757 with SMTP id
 ba6-20020a0560001c0600b0021d60eae757mr16953390wrb.418.1657050928228; 
 Tue, 05 Jul 2022 12:55:28 -0700 (PDT)
Received: from krug ([87.196.73.211]) by smtp.gmail.com with ESMTPSA id
 v7-20020adfa1c7000000b0021d6924b777sm7273153wrv.115.2022.07.05.12.55.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Jul 2022 12:55:27 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <877d4rmjop.fsf@HIDDEN>
Date: Tue, 05 Jul 2022 20:56:45 +0100
In-Reply-To: <877d4rmjop.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 05 Jul 2022 21:41:10 +0200")
Message-ID: <87pmijpc3m.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: Morten Welinder <terra@HIDDEN>, 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Yes, I think it'd be better to add a mechanism like
>
> (put 'eglot--managed-mode 'desktop-inhibit t)

Yes, I think I like this solution best.  Some desktop.el-agnostic name
that conveys "implementation-detail" would be even better, IMO.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 19:52:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:52:24 2022
Received: from localhost ([127.0.0.1]:51764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8oau-00079z-6Y
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:52:24 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:38844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o8oas-00079g-IL
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:52:23 -0400
Received: by mail-wm1-f42.google.com with SMTP id
 g39-20020a05600c4ca700b003a03ac7d540so10347063wmp.3
 for <56407 <at> debbugs.gnu.org>; Tue, 05 Jul 2022 12:52:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=AlIAF4gqJ2aAURiu8Sj23J2Iw+9lnBhB4RPh7voYbeM=;
 b=eHUICjwJa0Vxqzta02TxAVeMTW0tAq+sQTxIpJxw/CS8qqXlyYpZROZeS9CKHBCsmk
 /TyWmE0Y4JSHRStffFPLS6pCrWpau92YGXF85FBSsjyi1yjLVb06OItTuEF7fy9eIM+U
 5mRMwu7G1p9Z58Irdi6z6GR6BIcKkkrSJ/dJdpQwOo9ofoxWOziwr83YO2tKnHrtFAej
 hai1uQ27QSjrvV2WhiWm5OMuY7VVRCLKJHVVZDLrAak+dZ4mCilhqZ17Xz+LAWJJqNcP
 P7sFFSCvKyUkNNkvPdYsYiRDGzcHijk9JpiZf/L0xDb6YXKku9XHwp8zU8eLtLc95CGN
 /IAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=AlIAF4gqJ2aAURiu8Sj23J2Iw+9lnBhB4RPh7voYbeM=;
 b=RVoDvYx4plM+PvrS1LTNyTNxntFg0owVuaZYMZ580f4DLNh60KPhDoqmoX7xulwJ5I
 m/IyTsIOoeXthK9IiVt5dGWSlUSlfHhXadriVgWCku418iw7GbjnEwpNwNj8bf6CAbkG
 q/kmWVUUB5FlRu3icC6GFzzIMFOsVKFFMkscr0BSwXKW3Vtte3qKRVWmEpalMz4wDPyb
 vTCknPbztP5asQWxj81fICCWSYdYHsN5WUbbE78Th2+Q/dEdk4/u5IZXv4aH4rDA/7WH
 K+C8O2YypupF2i5bGJI5WUgY00fChiwfr5jPcH9JRWSX4fxsozpNfi63p4Ko+m3q9JPU
 Nhow==
X-Gm-Message-State: AJIora9aWwZD3XnqZkf66BbbJGrIqnpE+aSIA7hMgnsCcJZAT7SHD92V
 wOnC56C5KDLp6QjKyeZjw6w=
X-Google-Smtp-Source: AGRyM1tR45juzrZIGwKNA5hi1Ou2WBXGrkpX9ka8N8lx6PvyhMDwr//L70GNakeqtNpApxFUzP5Mfg==
X-Received: by 2002:a05:600c:4fc8:b0:3a1:987c:82d4 with SMTP id
 o8-20020a05600c4fc800b003a1987c82d4mr18875724wmq.26.1657050736518; 
 Tue, 05 Jul 2022 12:52:16 -0700 (PDT)
Received: from krug ([87.196.73.211]) by smtp.gmail.com with ESMTPSA id
 x12-20020a5d650c000000b0021d7050ace4sm3227563wru.77.2022.07.05.12.52.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Jul 2022 12:52:16 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN> <83v8sb73ga.fsf@HIDDEN>
Date: Tue, 05 Jul 2022 20:53:33 +0100
In-Reply-To: <83v8sb73ga.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 05 Jul
 2022 22:40:53 +0300")
Message-ID: <87tu7vpc8y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56407
Cc: terra@HIDDEN, 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> I confirmed this with a stack trace requested from the user and came up
>> with this workaround in the user's config:
>>=20
>>     (add-to-list 'desktop-minor-mode-handlers
>>                  '(eglot--managed-mode . ignore))
>>=20
>> 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.

At first I thought it was a customization variable and that would make
it user-specific overwritable etc.  But I see now that evidently it is
not.  According to the docstring of d-m-m-handlers, eglot.el could just
just contain the above invocation, indeed.

But that has the downside that eglot.el must require "desktop.el" which
IMO opinion too strongly couples the two packages.

I think I like Lars's solution best.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 19:41:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:41:22 2022
Received: from localhost ([127.0.0.1]:51751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8oQE-0006qt-Hk
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:41:22 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47552)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1o8oQC-0006qb-KZ
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:41:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=BXbQxzBJadglJqFN/dh98nHNH+ePVKFDgdxB+PyWu3A=; b=rKiP8JqM8lCMrIErW7tDzFIX77
 bPtUcckRntQnXqmgiSVkYALhfEoOnDwce3vojLHJ24E6lKd9rDen6ovz6c+HKgdCDkkzDvUneM2lS
 jPbmYNUZRcsskKOUx6CgO26TOHLM2JL3lVMYPNr9HSpnVWeeY47yJJnfm0J07exVRgk4=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1o8oQ3-0005DK-0R; Tue, 05 Jul 2022 21:41:13 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Subject: Re: bug#56407: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
In-Reply-To: <87y1x7pd53.fsf@HIDDEN> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?=
 =?utf-8?Q?a=22's?= message of "Tue, 05 Jul 2022 20:34:16 +0100")
References: <87y1x7pd53.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAKlBMVEVlABtpDCVyJzta
 BxxUFyZULTZaVVZMPkFYO0JYRkpTSUthYGBoNUP///8BXNtuAAAAAWJLR0QN9rRh9QAAAAd0SU1F
 B+YHBRMnM/JCsEcAAAC3SURBVDjLY2AY1ECQURAEMCWUFJWUhJSUBAbagTQEzC4uBtjEWULcSkKw
 SXi4dk4NCcaiIXhq1lYPd0wJDrf0tJ1hUwMwJCKnrZrSsWzaYgyJ7oxZW6IzZ6ZgSHTujJx8OmL1
 VAyJiM6pFiYzI0IxJKJcd86emuaKqcM1dYa3cWrmRAwJ0+i01pnZKQ2YHgxNa3ZLi8QSWqFuu9JS
 W7AFYlTVsuUOWIPXFXuwD38ggEvCYaBdhgAAbGIulyOF3ToAAAAldEVYdGRhdGU6Y3JlYXRlADIw
 MjItMDctMDVUMTk6Mzk6NTErMDA6MDCDUVqqAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA3LTA1
 VDE5OjM5OjUxKzAwOjAw8gziFgAAAABJRU5ErkJggg==
X-Now-Playing: King Crimson's _Discipline_: "Frame by Frame"
Date: Tue, 05 Jul 2022 21:41:10 +0200
Message-ID: <877d4rmjop.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  João Távora <joaotavora@HIDDEN> writes: > 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 doe [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56407
Cc: Morten Welinder <terra@HIDDEN>, 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN> writes:

> 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.

Yes, I think it'd be better to add a mechanism like

(put 'eglot--managed-mode 'desktop-inhibit t)

or the like, and get rid of

(defcustom desktop-minor-mode-table
  '((defining-kbd-macro nil)
    (isearch-mode nil)
    (vc-mode nil)
...

which is used for the same thing.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at 56407 <at> debbugs.gnu.org:


Received: (at 56407) by debbugs.gnu.org; 5 Jul 2022 19:41:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:41:11 2022
Received: from localhost ([127.0.0.1]:51748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8oQ3-0006qQ-6M
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:41:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1o8oQ1-0006po-78
 for 56407 <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:41:10 -0400
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 <eliz@HIDDEN>)
 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==;
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 <eliz@HIDDEN>)
 id 1o8oPs-0002Vk-HJ; Tue, 05 Jul 2022 15:41:00 -0400
Date: Tue, 05 Jul 2022 22:40:53 +0300
Message-Id: <83v8sb73ga.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
In-Reply-To: <87y1x7pd53.fsf@HIDDEN> (message from =?utf-8?B?Sm/Do28g?=
 =?utf-8?B?VMOhdm9yYQ==?= on Tue, 05 Jul 2022 20:34:16 +0100)
Subject: Re: bug#56407: 29.0.50;
 desktop.el shouldn't be saving/restoring eglot--managed-mode, which
 is not for interactive use
References: <87y1x7pd53.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56407
Cc: terra@HIDDEN, 56407 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Jul 2022 19:33:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:33:08 2022
Received: from localhost ([127.0.0.1]:51725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o8oIG-0006dI-0u
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:33:08 -0400
Received: from lists.gnu.org ([209.51.188.17]:55516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1o8oID-0006d8-KY
 for submit <at> debbugs.gnu.org; Tue, 05 Jul 2022 15:33:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49606)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joaotavora@HIDDEN>)
 id 1o8oID-0008L5-E6
 for bug-gnu-emacs@HIDDEN; Tue, 05 Jul 2022 15:33:05 -0400
Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38479)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <joaotavora@HIDDEN>)
 id 1o8oIA-0003rD-Og
 for bug-gnu-emacs@HIDDEN; Tue, 05 Jul 2022 15:33:05 -0400
Received: by mail-wm1-x332.google.com with SMTP id
 g39-20020a05600c4ca700b003a03ac7d540so10320449wmp.3
 for <bug-gnu-emacs@HIDDEN>; Tue, 05 Jul 2022 12:33:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=CwSCb+GVhKMhbMy8VhDbMSgGglXGf1JI1W70XUp8CaI=;
 b=DtF8KtrcrwsVIjDfB4djgu24BlTAJBgKsc9pRRpmBe6JG53LCdbOvTZ26ZbV5G3qqd
 6srUE5CvR3WGd1jeI1Znd2ULjyTApcN76ocP4ZtfeOd/ctujCo6mDIeTv8T2wD6OUzyZ
 J/2KNwNUg9R0G20HII9D9fy2Rtz4093WRJ7ZAfpHyHYkBuw7Moy9As1AdL+REBleUewW
 Az94d3Fgstmisai47pYfPaa4CJbM+k9Si14oJwMmKFsUwZQMIR5GwoC98Mi8/9PUzL0J
 by2b4/bSD5cBJ8C/ifKBLeGbmW7lkc1CSb4LIjqfY5thPWHWGqX4Wvb2HjTElN93MW6Y
 ruUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=CwSCb+GVhKMhbMy8VhDbMSgGglXGf1JI1W70XUp8CaI=;
 b=vnq5oNr/bRFDsrz1KK5rlPvjHF4fz+f+Pl4R/WqhfMTUQZ15Fm3VcAhmn9i8fXaU8U
 KiYWis3qux3CFZlUAT5oUPecvv4mHImvD0ZPruplw74ai2ttFUjaGNcyHY8IYt9pqL2c
 wcRhq0Q/nab18JtaU0xiFJnpHO9tJby+Zsm/5a2t8u2R5X4ZyMumRIv6jhiaCFolisGJ
 Jtv5vyaUSBdEQcCHCwcMtGzHKjmoZ3vuB6ZWUuhksPhUpthwPQ8EhDTKTmDOtDhB29z9
 r/XVCitDRAuLzF3VEooYAq4rssqeyqmQH18jLVqxQFTY0mLlik7vYGJGS6V5HSTIZ3Hs
 XN3Q==
X-Gm-Message-State: AJIora8LUTWKJ0Qt+QU3LSkjyhXNdG8mCTPejAUFhKxV8HCyPdRa3ltS
 DaqEF6VhlXuvSLcC2xsovGbFCVE/zfA=
X-Google-Smtp-Source: AGRyM1s7e9m/ih0cqp2+yOAfjbp5V4m4DVxwm5V/TVfmRiVH5ntlxQ6Kkcr7IYd7KkXxly0mMjBbng==
X-Received: by 2002:a7b:ce8a:0:b0:3a1:8ead:2ae5 with SMTP id
 q10-20020a7bce8a000000b003a18ead2ae5mr24654839wmj.100.1657049580448; 
 Tue, 05 Jul 2022 12:33:00 -0700 (PDT)
Received: from krug ([87.196.73.211]) by smtp.gmail.com with ESMTPSA id
 k6-20020a5d6286000000b0021d6e14a9ccsm4510850wru.16.2022.07.05.12.32.59
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 05 Jul 2022 12:32:59 -0700 (PDT)
From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; desktop.el shouldn't be saving/restoring
 eglot--managed-mode, which is not for interactive use
X-Debbugs-CC: Morten Welinder <terra@HIDDEN>
Date: Tue, 05 Jul 2022 20:34:16 +0100
Message-ID: <87y1x7pd53.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::332;
 envelope-from=joaotavora@HIDDEN; helo=mail-wm1-x332.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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.

In Eglot, the eglot--managed-mode minor mode is an implementation
detail, it is NOT meant to be called by the user, since it requires a
number of preconditions (like firing up a successful server) to be met.

Therefore, I have named the symbol with the "internal symbol"
convention.  In this very simple patch, I teach desktop.el to watch out
for this convention and not restart that mode.

diff --git a/lisp/desktop.el b/lisp/desktop.el
index 1a4103e209..a93703a77e 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1617,7 +1617,9 @@ desktop-create-buffer
 		   (let ((handler (cdr (assq minor-mode desktop-minor-mode-handlers))))
 		     (if handler
 			 (funcall handler desktop-buffer-locals)
-		       (when (functionp minor-mode)
+		       (when (or (functionp minor-mode)
+                                 (and (symbolp minor-mode)
+                                      (not (string-match "^[^-]+--" (symbo=
l-name minor-mode)))))
 			 (funcall minor-mode 1)))))))
 	  ;; Even though point and mark are non-nil when written by
 	  ;; `desktop-save', they may be modified by handlers wanting to set


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.

Thanks,
Jo=C3=A3o




Acknowledgement sent to João Távora <joaotavora@HIDDEN>:
New bug report received and forwarded. Copy sent to terra@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to terra@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#56407; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 6 Jul 2022 11:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.