GNU bug report logs - #41007
26.3; desktop-save and reloading

Previous Next

Package: emacs;

Reported by: jan <rtm443x <at> googlemail.com>

Date: Fri, 1 May 2020 19:10:01 UTC

Severity: normal

Found in version 26.3

Done: Eli Zaretskii <eliz <at> gnu.org>

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 41007 in the body.
You can then email your comments to 41007 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#41007; Package emacs. (Fri, 01 May 2020 19:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to jan <rtm443x <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 01 May 2020 19:10:01 GMT) Full text and rfc822 format available.

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

From: jan <rtm443x <at> googlemail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; desktop-save and reloading
Date: Fri, 1 May 2020 20:09:36 +0100
Hi,
this is trivial, feel free to ignore especially if it's just down to
my misunderstanding.

I saved my desktop using desktop-save. I could then find no way of
restoring it. I looked on the web and found a few others had the same
problem. Spent an hour browsing.
I then dug a bit more much later and found desktop-read seemed to do this.

Problem: I was looking for the obvious complement of desktop-save
which would be desktop-load or desktop-restore. Desktop-read is not
obviously named.

Other problem, and this is likely just unfamiliarity, but if you do
desktop-save it asks you where to save it. If you do desktop-read, it
doesn't ask. Docs say (desktop-read &optional DIRNAME) but that's not
exposed interactively that I can see.

Example of some confusion
<https://stackoverflow.com/questions/20438938/how-to-load-emacs-saved-desktop-configuration>

It seemed your're supposed to enable desktop-save-mode which I've
done. That's good, it works now, but having obviously named
desktop-load or desktop-restore, with an interactive prompt to ask for
the location would be good. It would also allow me to save and load
*different desktops*, *when I want* rather than at startup and just
give me the one it thinks I want.

Well, it may well allow that already, I just don't know.

Thanks

jan


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29 built on CIRROCUMULUS
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Recent messages:
Warning: desktop file appears to be in use by PID 4996.
Using it may cause conflicts.  Use it anyway? (y or n) n
Desktop file in use; not loaded.
completing-read-default: Command attempted to use minibuffer while in minibuffer
s is undefined
d is undefined
Quit
Making completion list...
Auto-saving...done
Type "q" to restore previous buffer.

Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252

Major mode: Apropos

Minor modes in effect:
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils browse-url url-util cl-extra eieio-opt
speedbar sb-image ezimage dframe find-func help-fns radix-tree help-mode
apropos elec-pair edmacro kmacro desktop frameset cus-start cus-load
finder-inf info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads w32notify w32 lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 139724 9752)
 (symbols 48 24352 4)
 (miscs 40 83 262)
 (strings 32 43608 1497)
 (string-bytes 1 1185734)
 (vectors 16 19101)
 (vector-slots 8 550693 7850)
 (floats 8 71 236)
 (intervals 56 300 21)
 (buffers 992 17))




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 01 May 2020 20:06:01 GMT) Full text and rfc822 format available.

Notification sent to jan <rtm443x <at> googlemail.com>:
bug acknowledged by developer. (Fri, 01 May 2020 20:06:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: jan <rtm443x <at> googlemail.com>
Cc: 41007-done <at> debbugs.gnu.org
Subject: Re: bug#41007: 26.3; desktop-save and reloading
Date: Fri, 01 May 2020 23:05:30 +0300
> Date: Fri, 1 May 2020 20:09:36 +0100
> From: jan via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> I saved my desktop using desktop-save. I could then find no way of
> restoring it. I looked on the web and found a few others had the same
> problem. Spent an hour browsing.
> I then dug a bit more much later and found desktop-read seemed to do this.
> 
> Problem: I was looking for the obvious complement of desktop-save
> which would be desktop-load or desktop-restore. Desktop-read is not
> obviously named.

Thanks, I added the reference to 'desktop-read' to the doc string of
'descktop-save'.

> Other problem, and this is likely just unfamiliarity, but if you do
> desktop-save it asks you where to save it. If you do desktop-read, it
> doesn't ask. Docs say (desktop-read &optional DIRNAME) but that's not
> exposed interactively that I can see.

The doc string of 'desktop-read' says:

  Interactively, with prefix arg C-u, ask for DIRNAME.

So it _is_ exposed in interactive calls.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41007; Package emacs. (Fri, 01 May 2020 20:38:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: jan <rtm443x <at> googlemail.com>, 41007 <at> debbugs.gnu.org
Subject: RE: bug#41007: 26.3; desktop-save and reloading
Date: Fri, 1 May 2020 13:37:26 -0700 (PDT)
> Other problem, and this is likely just unfamiliarity, but if you do
> desktop-save it asks you where to save it. If you do desktop-read, it
> doesn't ask. Docs say (desktop-read &optional DIRNAME) but that's not
> exposed interactively that I can see.

FWIW, and just in case it helps -

`desktop-read' is poorly designed, IMHO.  Or at
least some other read-a-desktop function should
be available.

desktop.el uses a desktop file to save state,
and it reads a desktop file to restore state.
But the desktop UI does not provide any function
(let alone a command) for reading a desktop file
by providing its file name.  (That's unusual for
Emacs, BTW.)

I remedied this long ago for library Bookmark+,
by adding command `bmkp-desktop-read`, which
does take a desktop file name as argument.

This is important for Bookmark+, as it lets
you easily create bookmarks to restore any
number of desktops, with their files located
anywhere (including multiple files in the same
directory).

But it should be important more generally for
Emacs, IMO.  The current (and original) design
of desktop.el assumes, in effect, that you have
at most one desktop file per directory.  And it
therefore bases its UI on the current directory,
not on an arbitrarily located desktop file.

IOW, the UI design does not really fit the
functional design, in the sense that a desktop
_file_ is what is needed.  In reality, a
desktop file can be anywhere, but nothing in
the UI suggests or supports that.

If you care about this (and I know it's not
directly related to the problem you reported)
then you can always copy the code for
`bmkp-desktop-read` and use that.  There's
really nothing in its definition that is
particularly bookmark-oriented, so it can
trivially be adapted for general use.

https://www.emacswiki.org/emacs/BookmarkPlus




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

This bug report was last modified 5 years and 23 days ago.

Previous Next


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