help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Not reloading the desktop; already loaded


From: Eli Zaretskii
Subject: Re: Not reloading the desktop; already loaded
Date: Fri, 28 Oct 2022 09:03:21 +0300

> Date: Thu, 27 Oct 2022 14:41:42 -0800
> From: Tim Johnson <tim@akwebsoft.com>
> 
> I have written my own project management module using 'desktop.
> If I have loaded a desktop file for a project and attempt to switch to a 
> different project
> I get the following message:
> 
> "Not reloading the desktop; already loaded"
> 
> and the loading of the second desktop file is suppressed.
> 
> I suspect that the problem will be solved by customizing 'desktop,
> but do not know how to proceed.

Look at the code which issues this message:

  (if (or noninteractive
          (and (desktop-owner)
               (= (desktop-owner) (emacs-pid))))
      (message "Not reloading the desktop%s"
               (if noninteractive
                   ""
                 "; already loaded"))

I assume yours is an interactive (i.e., no "--batch") session, so the
condition that applies in your case is the one about the "owner" of
the desktop file.  So the problem is that the desktop file was (of
course) written by the same Emacs process as the current one, and you
need to work around that.  One way is to override the definition of
desktop-owner.  Another way is to release the desktop file lock before
you load the second one, and then re-lock it afterwards.  And there
are probably others.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]