emacs-diffs
[Top][All Lists]
Advanced

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

master 0c330be: Avoid problems when calling desktop-read twice


From: Lars Ingebrigtsen
Subject: master 0c330be: Avoid problems when calling desktop-read twice
Date: Mon, 7 Dec 2020 12:54:04 -0500 (EST)

branch: master
commit 0c330bed24ef045732a1bfe61d20ed8328dd0b28
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Avoid problems when calling desktop-read twice
    
    * lisp/desktop.el (desktop-read): Don't reload the desktop file if
    it's already been loaded, because the later query may lead to
    desktop-dirname being set to nil (bug#9765).
---
 lisp/desktop.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/desktop.el b/lisp/desktop.el
index 7a7f1d0..4be3303 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1222,7 +1222,13 @@ This function is a no-op when Emacs is running in batch 
mode.
 It returns t if a desktop file was loaded, nil otherwise.
 \n(fn DIRNAME)"
   (interactive "i\nP")
-  (unless noninteractive
+  (if (or noninteractive
+          (and (desktop-owner)
+               (= (desktop-owner) (emacs-pid))))
+      (message "Not reloading the desktop%s"
+               (if noninteractive
+                   ""
+                 "; already loaded"))
     (setq desktop-dirname
           (file-name-as-directory
            (expand-file-name



reply via email to

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