* bug#18371: desktop-read: do not (desktop-clear) when no .emacs.desktop file is found
@ 2014-08-31 20:05 Ivan Shmakov
2015-01-23 15:29 ` Ivan Shmakov
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Shmakov @ 2014-08-31 20:05 UTC (permalink / raw)
To: 18371
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
Package: emacs
Tags: patch
As currently implemented, desktop-read calls desktop-clear when
no .emacs.desktop file is found:
1114 (if (file-exists-p (desktop-full-file-name))
⋯
1192 ;; No desktop file found.
1193 (desktop-clear)
1194 (let ((default-directory desktop-dirname))
1195 (run-hooks 'desktop-no-desktop-file-hook))
1196 (message "No desktop file.")
While this is likely to be a no-op when desktop-read is called
from user’s ~/.emacs, – this may actually affect user’s session
if desktop-read gets called from within an established session.
And even more so a session containing any “process interaction”
buffers, – like those one gets with M-x run-scheme or M-x erc.
(Unless desktop-clear-preserve-buffers is suitably customized
beforehand, that is. However, as it seems, that may easily spin
off the limits of convenience, which may be a bug by itself.)
Given that desktop-read does /not/ call desktop-clear in the
“.emacs.desktop is found” branch, and that in that case,
desktop-read /appends/ to the current session (rather than
/replacing/ it), I see no good reason to call desktop-clear from
desktop-read in the other case, either.
Please thus consider the (trivial) patch MIMEd.
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 303 bytes --]
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1190,7 +1190,6 @@
(desktop-auto-save-enable)
t))
;; No desktop file found.
- (desktop-clear)
(let ((default-directory desktop-dirname))
(run-hooks 'desktop-no-desktop-file-hook))
(message "No desktop file.")
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#18371: desktop-read: do not (desktop-clear) when no .emacs.desktop file is found
2014-08-31 20:05 bug#18371: desktop-read: do not (desktop-clear) when no .emacs.desktop file is found Ivan Shmakov
@ 2015-01-23 15:29 ` Ivan Shmakov
0 siblings, 0 replies; 2+ messages in thread
From: Ivan Shmakov @ 2015-01-23 15:29 UTC (permalink / raw)
To: 18371-done
Version: 25.1
>>>>> Ivan Shmakov <ivan@siamics.net> writes:
[…]
> Given that desktop-read does /not/ call desktop-clear in the
> “.emacs.desktop is found” branch, and that in that case, desktop-read
> /appends/ to the current session (rather than /replacing/ it), I see
> no good reason to call desktop-clear from desktop-read in the other
> case, either.
> Please thus consider the (trivial) patch MIMEd.
Pushed; closing.
commit e391d88705efd3897996ed81e1f37b936dc3aa21
CommitDate: 2015-01-17 19:35:22 +0000
Do not clear the session when trying to read a non-existent desktop file.
* lisp/desktop.el (desktop-read): Do not call desktop-clear when no
desktop file is found.
Fixes: debbugs:18371
--
FSF associate member #7257 np. Liar — Motorhead … 3013 B6A0 230E 334A
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-23 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-31 20:05 bug#18371: desktop-read: do not (desktop-clear) when no .emacs.desktop file is found Ivan Shmakov
2015-01-23 15:29 ` Ivan Shmakov
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).