unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with desktop.el after reecent local-mior-modes changes
@ 2021-03-11 20:59 Andy Moreton
  2021-03-11 21:07 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Moreton @ 2021-03-11 20:59 UTC (permalink / raw)
  To: emacs-devel

Hi,

Has anyone else observed recent problems with desktop.el ?

After updating master today (to commit 1d4195856b), I find that emacs
built from the emacs-27 branch fails to restore a desktop save file, and
complains that `local-minor-modes' is not defined as a variable.

Desktop save files used to work interchangeably between branches up
unito a few days ago, so there is a regression somewhere.

Adding this to init.el suppresses the problem in emacs-27:
    (when (version< emacs-version "28")
      (defvar-local local-minor-modes nil))

...however I'm not sure what saved state has not been restored.

Is there some rework needed for desktop-minor-mode-handlers etc ?

    AndyM





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 20:59 Problems with desktop.el after reecent local-mior-modes changes Andy Moreton
@ 2021-03-11 21:07 ` Lars Ingebrigtsen
  2021-03-11 21:10   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-11 21:07 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

Andy Moreton <andrewjmoreton@gmail.com> writes:

> After updating master today (to commit 1d4195856b), I find that emacs
> built from the emacs-27 branch fails to restore a desktop save file, and
> complains that `local-minor-modes' is not defined as a variable.

Say "make bootstrap".

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 21:07 ` Lars Ingebrigtsen
@ 2021-03-11 21:10   ` Lars Ingebrigtsen
  2021-03-11 22:35     ` Andy Moreton
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-11 21:10 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Andy Moreton <andrewjmoreton@gmail.com> writes:
>
>> After updating master today (to commit 1d4195856b), I find that emacs
>> built from the emacs-27 branch fails to restore a desktop save file, and
>> complains that `local-minor-modes' is not defined as a variable.
>
> Say "make bootstrap".

Sorry, I didn't read that closely enough.  Is this error in Emacs 27,
when trying to restore a desktop save file made with Emacs 28?

Can you (setq debug-on-error t)?  That'll give you a backtrace that'll
tell you where it's bugging out.  

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 21:10   ` Lars Ingebrigtsen
@ 2021-03-11 22:35     ` Andy Moreton
  2021-03-11 22:42       ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Moreton @ 2021-03-11 22:35 UTC (permalink / raw)
  To: emacs-devel

On Thu 11 Mar 2021, Lars Ingebrigtsen wrote:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Andy Moreton <andrewjmoreton@gmail.com> writes:
>>
>>> After updating master today (to commit 1d4195856b), I find that emacs
>>> built from the emacs-27 branch fails to restore a desktop save file, and
>>> complains that `local-minor-modes' is not defined as a variable.
>>
>> Say "make bootstrap".
>
> Sorry, I didn't read that closely enough.  Is this error in Emacs 27,
> when trying to restore a desktop save file made with Emacs 28?

Yes.

The odd thing is that local-minor-modes does not exist in emacs-27 and
is not mentioned in the desktop save file.

> Can you (setq debug-on-error t)?  That'll give you a backtrace that'll
> tell you where it's bugging out.  

Having bootstrapped emacs-27 from a clean tree, I see:

Debugger entered--Lisp error: (void-variable local-minor-modes)
  override-global-mode(1)
  desktop-create-buffer(208 "~/.emacs.d/init.el" "init.el" emacs-lisp-mode (eldoc-mode override-global-mode) 26985 (27333 nil) nil nil ((show-trailing-whitespace . t) (buffer-display-time 24650 38542 784259 0) (buffer-file-coding-system . utf-8-unix)) ((mark-ring (27060 27332 27249 27205 27300 27205 27174 27060 27332 27332 27332 27332 27251 25536 25536 26985))))
  eval-buffer(#<buffer  *load*> nil "c:/home/ajm/.emacs.d/desktop/.ntemacs.desktop" nil t)  ; Reading at buffer position 28147
  load-with-code-conversion("c:/home/ajm/.emacs.d/desktop/.ntemacs.desktop" "c:/home/ajm/.emacs.d/desktop/.ntemacs.desktop" t t)
  load("c:/home/ajm/.emacs.d/desktop/.ntemacs.desktop" t t t)
  desktop-read()
  #f(compiled-function () #<bytecode 0x905e172dad>)()
  run-hooks(after-init-hook delayed-warnings-hook)
  command-line()
  normal-top-level()

The `override-global-mode' minor mode is from the "bind-key" package, a
dependency of "use-package" (both from MELPA).

After some more experimentation, it seems that this is another workaround:
  (add-to-list 'desktop-minor-mode-handlers
               '(override-global-mode . ignore))

It is not obvious what is referring to `local-minor-modes' in this
setup.

    AndyM




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 22:35     ` Andy Moreton
@ 2021-03-11 22:42       ` Stefan Monnier
  2021-03-11 23:03         ` Andy Moreton
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2021-03-11 22:42 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

> Debugger entered--Lisp error: (void-variable local-minor-modes)
>   override-global-mode(1)

Presumably the `override-global-mode` was compiled with Emacs-28, so
when you use it with Emacs-27 you get into trouble.


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 22:42       ` Stefan Monnier
@ 2021-03-11 23:03         ` Andy Moreton
  2021-03-11 23:23           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Moreton @ 2021-03-11 23:03 UTC (permalink / raw)
  To: emacs-devel

On Thu 11 Mar 2021, Stefan Monnier wrote:

>> Debugger entered--Lisp error: (void-variable local-minor-modes)
>>   override-global-mode(1)
>
> Presumably the `override-global-mode` was compiled with Emacs-28, so
> when you use it with Emacs-27 you get into trouble.

Thanks Stefan, that is indeed the problem: the reference was in
bind-key.elc. I must have updated the package recently while running
emacs built from master.

Is there a general way to avoid this kind of problem ?
Perhaps I need to use separate elpa dirs for each emacs version.

    AndyM




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 23:03         ` Andy Moreton
@ 2021-03-11 23:23           ` Lars Ingebrigtsen
  2021-03-12 19:10             ` Andy Moreton
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-11 23:23 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

Andy Moreton <andrewjmoreton@gmail.com> writes:

>> Presumably the `override-global-mode` was compiled with Emacs-28, so
>> when you use it with Emacs-27 you get into trouble.
>
> Thanks Stefan, that is indeed the problem: the reference was in
> bind-key.elc. I must have updated the package recently while running
> emacs built from master.
>
> Is there a general way to avoid this kind of problem ?
> Perhaps I need to use separate elpa dirs for each emacs version.

I think `define-minor-mode' could be more helpful here -- that is, it
could check run-time whether the variables in question are bound.  This
should fix this problem when moving between Emacs versions.

I think I'll make that change to Emacs 28 now.

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-11 23:23           ` Lars Ingebrigtsen
@ 2021-03-12 19:10             ` Andy Moreton
  2021-03-12 20:39               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Moreton @ 2021-03-12 19:10 UTC (permalink / raw)
  To: emacs-devel

On Fri 12 Mar 2021, Lars Ingebrigtsen wrote:

> Andy Moreton <andrewjmoreton@gmail.com> writes:
>
>>> Presumably the `override-global-mode` was compiled with Emacs-28, so
>>> when you use it with Emacs-27 you get into trouble.
>>
>> Thanks Stefan, that is indeed the problem: the reference was in
>> bind-key.elc. I must have updated the package recently while running
>> emacs built from master.
>>
>> Is there a general way to avoid this kind of problem ?
>> Perhaps I need to use separate elpa dirs for each emacs version.
>
> I think `define-minor-mode' could be more helpful here -- that is, it
> could check run-time whether the variables in question are bound.  This
> should fix this problem when moving between Emacs versions.
>
> I think I'll make that change to Emacs 28 now.

Thanks Lars, this seems to fix things without the need for any
workarounds.

I tested by reinstalling the bind-key package in emacs-28, and checking
that bind-key.elc has a reference to local-minor-modes. After that the
desktop restore works without complaint on emacs-27.

    AndyM




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with desktop.el after reecent local-mior-modes changes
  2021-03-12 19:10             ` Andy Moreton
@ 2021-03-12 20:39               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-12 20:39 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

Andy Moreton <andrewjmoreton@gmail.com> writes:

> I tested by reinstalling the bind-key package in emacs-28, and checking
> that bind-key.elc has a reference to local-minor-modes. After that the
> desktop restore works without complaint on emacs-27.

Thanks for checking.

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-12 20:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 20:59 Problems with desktop.el after reecent local-mior-modes changes Andy Moreton
2021-03-11 21:07 ` Lars Ingebrigtsen
2021-03-11 21:10   ` Lars Ingebrigtsen
2021-03-11 22:35     ` Andy Moreton
2021-03-11 22:42       ` Stefan Monnier
2021-03-11 23:03         ` Andy Moreton
2021-03-11 23:23           ` Lars Ingebrigtsen
2021-03-12 19:10             ` Andy Moreton
2021-03-12 20:39               ` Lars Ingebrigtsen

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