Subject: bug#17693: closed (Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 16 Jul 2014 04:31:03 +0000

Your bug report

#17693: 24.3.91.1; desktop-save-mode disables option -nw

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17693: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17693
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Wed, 16 Jul 2014 00:30:43 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.3.93

I applied a simple workaround. Hopefully good enough for now at least.

--- a/lisp/desktop.el	2014-07-03 23:48:24 +0000
+++ b/lisp/desktop.el	2014-07-16 04:28:42 +0000
@@ -1516,8 +1516,15 @@
         (setq command-line-args (delete key command-line-args))
         (desktop-save-mode 0)))
     (when desktop-save-mode
-      (desktop-read)
-      (setq inhibit-startup-screen t))))
+      ;; People don't expect emacs -nw, or --daemon,
+      ;; to create graphical frames (bug#17693).
+      ;; TODO perhaps there should be a separate value
+      ;; for desktop-restore-frames to control this startup behavior?
+      (let ((desktop-restore-frames (and desktop-restore-frames
+                                         initial-window-system
+                                         (not (daemonp)))))
+        (desktop-read)
+        (setq inhibit-startup-screen t)))))

Subject: 24.3.91.1; desktop-save-mode disables option -nw
From: Stefan Guath <[email-masked]>
To: [email-masked]
Date: Wed, 4 Jun 2014 20:34:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

VERSION:
GNU Emacs 24.3.91.1 (x86_64-apple-darwin13.2.0, NS apple-appkit-1265.20) of 2014-05-23 on angelofdeaths-MacBook-Air.local

TO REPRODUCE BUG:

In OS X 10.9.3:
1) Create a .emacs file with only one expression:
    (desktop-save-mode)
2) Start emacs in graphical mode (i.e. double-click on Emacs.app icon).
3) Quit emacs, and answer "y" on question "Save desktop? (y or n)". The file .emacs.desktop is now created.
4) Run 'emacs -nw' in terminal.
5) Despite the '-nw' option, Emacs is now opened in graphical mode in a new non-terminal window.