all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41007: 26.3; desktop-save and reloading
@ 2020-05-01 19:09 jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-05-01 20:05 ` Eli Zaretskii
  2020-05-01 20:37 ` Drew Adams
  0 siblings, 2 replies; 3+ messages in thread
From: jan via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-05-01 19:09 UTC (permalink / raw)
  To: 41007

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))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41007: 26.3; desktop-save and reloading
  2020-05-01 19:09 bug#41007: 26.3; desktop-save and reloading jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-05-01 20:05 ` Eli Zaretskii
  2020-05-01 20:37 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2020-05-01 20:05 UTC (permalink / raw)
  To: jan; +Cc: 41007-done

> 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@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41007: 26.3; desktop-save and reloading
  2020-05-01 19:09 bug#41007: 26.3; desktop-save and reloading jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-05-01 20:05 ` Eli Zaretskii
@ 2020-05-01 20:37 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2020-05-01 20:37 UTC (permalink / raw)
  To: jan, 41007

> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-01 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01 19:09 bug#41007: 26.3; desktop-save and reloading jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-01 20:05 ` Eli Zaretskii
2020-05-01 20:37 ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.