GNU bug report logs - #17693
24.3.91.1; desktop-save-mode disables option -nw

Previous Next

Package: emacs;

Reported by: Stefan Guath <stefan <at> automata.se>

Date: Wed, 4 Jun 2014 18:35:04 UTC

Severity: normal

Found in version 24.3.91.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17693 in the body.
You can then email your comments to 17693 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Wed, 04 Jun 2014 18:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Guath <stefan <at> automata.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 04 Jun 2014 18:35:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Guath <stefan <at> automata.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91.1; desktop-save-mode disables option -nw
Date: Wed, 4 Jun 2014 20:34:11 +0200
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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Wed, 04 Jun 2014 21:19:02 GMT) Full text and rfc822 format available.

Message #8 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Guath <stefan <at> automata.se>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Wed, 4 Jun 2014 23:18:08 +0200
On Wed, Jun 4, 2014 at 8:34 PM, Stefan Guath <stefan <at> automata.se> wrote:

> TO REPRODUCE BUG:

Likely related to framesets, but just to be sure

> 1) Create a .emacs file with only one expression:
>     (desktop-save-mode)

Add (setq desktop-restore-frames nil) to your .emacs.

    J




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Thu, 05 Jun 2014 07:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Guath <stefan <at> automata.se>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Thu, 5 Jun 2014 09:00:39 +0200
Yes, adding (setq desktop-restore-frames nil) is a work-around for this bug (#17693) and also bug #17692. But the user shouldn't have to use these kind of work-arounds. A single (desktop-save-mode) should be sufficient and just work out of the box.

/Stefan Guath

On 4 jun 2014, at 23:18, Juanma Barranquero <lekktu <at> gmail.com> wrote:

> On Wed, Jun 4, 2014 at 8:34 PM, Stefan Guath <stefan <at> automata.se> wrote:
> 
>> TO REPRODUCE BUG:
> 
> Likely related to framesets, but just to be sure
> 
>> 1) Create a .emacs file with only one expression:
>>    (desktop-save-mode)
> 
> Add (setq desktop-restore-frames nil) to your .emacs.
> 
>    J





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Thu, 05 Jun 2014 07:04:01 GMT) Full text and rfc822 format available.

Message #14 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Guath <stefan <at> automata.se>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Thu, 5 Jun 2014 09:02:37 +0200
> Yes, adding (setq desktop-restore-frames nil) is a work-around for this bug (#17693) and also bug #17692. But the user shouldn't have to use these kind of work-arounds.

I wasn't suggesting it as a workaround, only as a way to determine if
it was a frameset-related bug.

    J




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Thu, 05 Jun 2014 07:06:02 GMT) Full text and rfc822 format available.

Message #17 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Guath <stefan <at> automata.se>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Thu, 5 Jun 2014 09:05:29 +0200
You're of course right. Sorry, didn't mean to sound rude. On the contrary, you're doing an amazing work - many thanks!

On 5 jun 2014, at 09:02, Juanma Barranquero <lekktu <at> gmail.com> wrote:

>> Yes, adding (setq desktop-restore-frames nil) is a work-around for this bug (#17693) and also bug #17692. But the user shouldn't have to use these kind of work-arounds.
> 
> I wasn't suggesting it as a workaround, only as a way to determine if
> it was a frameset-related bug.
> 
>    J





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Thu, 05 Jun 2014 07:14:02 GMT) Full text and rfc822 format available.

Message #20 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Guath <stefan <at> automata.se>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Thu, 5 Jun 2014 09:12:51 +0200
> Sorry, didn't mean to sound rude.

Don't worry, it's just that I'm a bit busy right now. I have four
frameset-related bugs pending, and hope to have time to tackle them
this weekend.

    J




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Sun, 22 Jun 2014 07:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 17693 <at> debbugs.gnu.org, Stefan Guath <stefan <at> automata.se>
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Sun, 22 Jun 2014 03:11:07 -0400
I was going to suggest checking the value of initial-window-system
before restoring graphical frames. But it is also nil for emacs --daemon.
Humph. Maybe check (or initial-window-system (daemonp)) ?
Perhaps there should be some option that defaults to that value,
so that people can override it?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Mon, 07 Jul 2014 00:12:02 GMT) Full text and rfc822 format available.

Message #26 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 17693 <at> debbugs.gnu.org, Stefan Guath <stefan <at> automata.se>
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Sun, 06 Jul 2014 20:11:47 -0400
An even more problematic version of this is that now

emacs --daemon

can create a bunch of graphical frames at startup, if you have
desktop-save-mode enabled in .emacs and a saved desktop.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Wed, 16 Jul 2014 04:31:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Guath <stefan <at> automata.se>:
bug acknowledged by developer. (Wed, 16 Jul 2014 04:31:03 GMT) Full text and rfc822 format available.

Message #31 received at 17693-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 17693-done <at> debbugs.gnu.org
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Wed, 16 Jul 2014 00:30:43 -0400
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)))))
 




Forcibly Merged 17692 17693. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 12 Aug 2014 03:56:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Sep 2014 11:24:06 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Jordon Biondo <jordonbiondo <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 08 Apr 2015 14:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Wed, 08 Apr 2015 14:56:02 GMT) Full text and rfc822 format available.

Message #40 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Jordon Biondo <jordonbiondo <at> gmail.com>
To: 17693 <at> debbugs.gnu.org
Subject: This bug is not resolved.
Date: Wed, 8 Apr 2015 10:55:36 -0400
This problem is not resolved.

The implemented solution only solves the issue on startup, if after start up, you use `desktop-change-dir` to change to a non ‘-nw’ desktop file from a ‘-nw’ instance of emacs, a graphical frame will be opened. Not only that, but the frame cannot be interacted with, it does not receive any key inputs, and thus requires me to kill the emacs process.

Reproduce with:

1. Start a graphical emacs session with -q
2. Open a single file
3. Use desktop-save to save to a directory of your choice.
4. Close emacs
5. start a -nw emacs session with -q
6. run `desktop-change-dir` to load your saved desktop file
7. A graphical frame will be opened that you cannot interact with.

Note: I am on OS X with the latest dev branch.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Wed, 08 Apr 2015 15:11:02 GMT) Full text and rfc822 format available.

Message #43 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Jordon Biondo <jordonbiondo <at> gmail.com>
To: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: This bug is not resolved.
Date: Wed, 8 Apr 2015 11:10:51 -0400
This can be resolved by setting `desktop-restore-in-current-display` to `t` prior to loading the desktop, but I don’t believe this should be required. Is there ever a reason someone would want a graphical frame to open from a instance of emacs started with -nw? I would imagine not.





Disconnected #17693 from all other report(s). Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Apr 2015 18:06:01 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 24.3.93. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Apr 2015 18:06:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Apr 2015 18:06:02 GMT) Full text and rfc822 format available.

Severity set to 'normal' from 'important' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Apr 2015 18:06:02 GMT) Full text and rfc822 format available.

Added indication that bug 17693 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Apr 2015 18:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Sat, 02 Apr 2016 13:42:01 GMT) Full text and rfc822 format available.

Message #56 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jordon Biondo <jordonbiondo <at> gmail.com>
Cc: 17693 <at> debbugs.gnu.org
Subject: Re: bug#17693: This bug is not resolved.
Date: Sat, 02 Apr 2016 16:41:09 +0300
> From: Jordon Biondo <jordonbiondo <at> gmail.com>
> Date: Wed, 8 Apr 2015 11:10:51 -0400
> 
> This can be resolved by setting `desktop-restore-in-current-display` to `t` prior to loading the desktop, but I don’t believe this should be required. Is there ever a reason someone would want a graphical frame to open from a instance of emacs started with -nw? I would imagine not.

As of today's emacs-25 branch, I cannot reproduce this bug: when I
start "emacs -nw" from a directory with a .emacs.desktop file that was
recorded by a GUI session, I get a single frame with all the buffers
saved in the desktop file.

Can anyone still reproduce the problem?  If so, please provide the
details, including the build and the OS where you see that.  Also,
please try forcing desktop-restore-frames to nil, and tell if doing
so eliminates the problem.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17693; Package emacs. (Thu, 19 May 2016 16:24:02 GMT) Full text and rfc822 format available.

Message #59 received at 17693 <at> debbugs.gnu.org (full text, mbox):

From: Jun Hao <jun_hao <at> aol.com>
To: 17693 <at> debbugs.gnu.org
Subject: PATCH
Date: Fri, 20 May 2016 00:23:32 +0800
[Message part 1 (text/plain, inline)]
Hi,

Please see the simple patch in the attachment. I can still repro this
issue with latest dev branch. I think the original workaround is not
working since the repro step is using -q which doesn't set
after-init-hook. Let me know if this fix the issue

-- 
Thanks - Jun
[0001-lisp-desktop.el-Disable-restore-frameset-if-in-non-g.patch (text/x-patch, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 21 May 2016 19:42:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Guath <stefan <at> automata.se>:
bug acknowledged by developer. (Sat, 21 May 2016 19:42:02 GMT) Full text and rfc822 format available.

Message #64 received at 17693-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jun Hao <jun_hao <at> aol.com>
Cc: Glenn Morris <rgm <at> gnu.org>, Jordon Biondo <jordonbiondo <at> gmail.com>,
 Juanma Barranquero <lekktu <at> gmail.com>, 17693-done <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, Stefan Guath <stefan <at> automata.se>
Subject: Re: bug#17693: 24.3.91.1; desktop-save-mode disables option -nw
Date: Sat, 21 May 2016 12:40:59 -0700
I installed Jun Hao's patch into emacs-25 and am marking Bug#17693 as done. Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Jun 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 307 days ago.

Previous Next


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