unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
@ 2022-02-24 10:04 Mark Jamsek
  2022-02-24 14:30 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Jamsek @ 2022-02-24 10:04 UTC (permalink / raw)
  To: 54140

According to the docs[0][1], both tab bar and window config should be
saved and restored with =(desktop-save-mode 1)=, but only buffers are
restored. This behaviour is consistent irrespective of whether using
=(desktop-save-mode 1)= in =init.el=, or manually calling =desktop-save=
and =desktop-read= to save and restore a saved session.

Tested on Emacs 27.2:
  OpenBSD 7.0-current amd64
  OpenBSD 7.1-beta amd64
  macOS 10.15.7 Darwin Kernel 19.6.0 x86_64
  macOS 12.2.1 Darwin Kernel 21.3.0 x86_64

Steps:
Set =(desktop-save-mode 1)= in =init.el= as described in the docs[0].
Start Emacs, and setup tabs and windows.
Close and restart Emacs.

Expected:
Emacs tab bar and window config is saved and restored at startup.

Actual:
Emacs creates a =.emacs.desktop= file; however, upon restart, only the
buffers are restored--not the frame and window configuration. Likewise,
any tab bar configuration is also lost.

[0]:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html
[1]:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Tab-Bars.html


----8<------------------------------------------------------------------

In GNU Emacs 27.2 (build 1, x86_64-unknown-openbsd)
 of 2022-02-22 built on amd64.ports.openbsd.org
System Description: OpenBSD fnc.bsdbox.org 7.0 GENERIC.MP#267 amd64

Recent messages:
Defining kbd macro...
Keyboard macro defined
Defining kbd macro...
Keyboard macro defined
Quit
Configured using:
 'configure --build=amd64-unknown-openbsd --without-sound --without-x
 --without-dbus --without-gsettings --without-harfbuzz --without-jpeg
 --without-lcms2 --without-libotf --without-m17n-flt --prefix=/usr/local
 --sysconfdir=/etc --mandir=/usr/local/man --infodir=/usr/local/info
 --localstatedir=/var --disable-silent-rules --disable-gtk-doc
 'CFLAGS=-O2 -pipe -g' CPPFLAGS=-I/usr/local/include
 'LDFLAGS=-L/usr/local/lib -g''

Configured features:
NOTIFY KQUEUE GNUTLS LIBXML2 ZLIB MODULES THREADS JSON PDUMPER GMP

Important settings:
  locale-coding-system: nil

Major mode: Org

Minor modes in effect:
  evil-org-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  evil-leader-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  desktop-save-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  tab-bar-history-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
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail rx term/screen term/xterm xterm
ol-eww eww mm-url url-queue ol-rmail ol-mhe ol-irc ol-info ol-gnus nnir
gnus-sum url url-proxy url-privacy url-expand url-methods url-history
mailcap shr url-cookie url-domsuf url-util svg xml dom gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc
nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message rmc puny
rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win
gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
text-property-search mail-utils mm-util mail-prsvr wid-edit ol-docview
doc-view jka-compr image-mode exif image dired dired-loaddefs ol-bibtex
bibtex ol-bbdb ol-w3m sh-script smie executable powerline-evil
powerline-evil-themes powerline powerline-separators color
powerline-themes evil-org org-element avl-tree generator
evil-indent-textobject evil-surround evil-leader evil evil-keybindings
evil-integration evil-maps evil-commands reveal flyspell ispell
evil-jumps evil-command-window evil-search evil-ex shell evil-types
evil-macros evil-repeat evil-states evil-core evil-common windmove calc
calc-loaddefs calc-macs thingatpt rect evil-digraphs evil-vars edmacro
kmacro desktop frameset use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
use-package-core cl-extra help-mode org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete
pcomplete comint ansi-color ring org-list org-faces org-entities
time-date noutline outline easy-mmode org-version ob-emacs-lisp ob-core
ob-eval org-table ol regexp-opt org-keys org-compat advice org-macs
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs
finder-inf disp-table info tool-bar package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame minibuffer
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 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 kqueue
multi-tty make-network-process emacs)

Memory information:
((conses 16 230209 20234)
 (symbols 48 24411 1)
 (strings 32 79904 3145)
 (string-bytes 1 2588990)
 (vectors 16 35447)
 (vector-slots 8 381564 11626)
 (floats 8 398 343)
 (intervals 56 428 122)
 (buffers 1000 17))


--
Mark Jamsek <mark@bsdbox.org>






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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
  2022-02-24 10:04 bug#54140: 27.2; desktop-save-mode fails to restore frame and window config Mark Jamsek
@ 2022-02-24 14:30 ` Lars Ingebrigtsen
       [not found]   ` <14B9A1B4-2208-4C05-8167-DAF3DC49C3D6@bsdbox.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-24 14:30 UTC (permalink / raw)
  To: Mark Jamsek; +Cc: 54140

Mark Jamsek <mark@bsdbox.org> writes:

> Emacs creates a =.emacs.desktop= file; however, upon restart, only the
> buffers are restored--not the frame and window configuration. Likewise,
> any tab bar configuration is also lost.

I'm unable to reproduce this in Emacs 27.2 (on Debian/bookworm) --
frames and windows are restored as normal.

Do you have any customisations that could affect the behaviour?  That
is, if you have only

(desktop-save-mode 1)

in your init file, do you still see the problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
       [not found]   ` <14B9A1B4-2208-4C05-8167-DAF3DC49C3D6@bsdbox.org>
@ 2022-02-25  2:38     ` Lars Ingebrigtsen
  2022-02-25  2:58       ` Mark Jamsek
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-25  2:38 UTC (permalink / raw)
  To: Mark Jamsek; +Cc: 54140

(Please keep the debbugs address in the CCs -- otherwise it won't reach
the bug tracker.)

Mark Jamsek <mark@bsdbox.org> writes:

> Just to confirm, this report applies to Emacs in the terminal, not GUI.
> Did you test in the former?

No, I didn't test with -nw.  With -nw I see the behaviour you're
describing.





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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
  2022-02-25  2:38     ` Lars Ingebrigtsen
@ 2022-02-25  2:58       ` Mark Jamsek
  2022-02-25  8:02         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Jamsek @ 2022-02-25  2:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54140

> On 25 Feb 2022, at 1:38 pm, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> (Please keep the debbugs address in the CCs -- otherwise it won't reach
> the bug tracker.)

Will do. Thanks for the reminder!

> Mark Jamsek <mark@bsdbox.org> writes:
> 
>> Just to confirm, this report applies to Emacs in the terminal, not GUI.
>> Did you test in the former?
> 
> No, I didn't test with -nw.  With -nw I see the behaviour you're
> describing.

And thanks for confirming this bug.

Do you know where in the codebase to dig to start debugging this?
Unfortunately, my Lisp is non-existent, but if it's in C, I might be
able to help.


--
Mark Jamsek <mark@bsdbox.org>






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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
  2022-02-25  2:58       ` Mark Jamsek
@ 2022-02-25  8:02         ` Eli Zaretskii
  2022-02-25  9:39           ` Mark Jamsek
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-02-25  8:02 UTC (permalink / raw)
  To: Mark Jamsek; +Cc: larsi, 54140

> From: Mark Jamsek <mark@bsdbox.org>
> Date: Fri, 25 Feb 2022 13:58:36 +1100
> Cc: 54140@debbugs.gnu.org
> 
> Do you know where in the codebase to dig to start debugging this?

There's no need to debug this: this is the expected behavior on TTY
frames, see desktop-restoring-frameset-p.  We deliberately don't
restore the frameset on text-mode displays.  For the reasons, see
bug#17693.





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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
  2022-02-25  8:02         ` Eli Zaretskii
@ 2022-02-25  9:39           ` Mark Jamsek
  2022-02-25 12:02             ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Jamsek @ 2022-02-25  9:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 54140

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]


> On 25 Feb 2022, at 7:02 pm, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> 
>> 
>> From: Mark Jamsek <mark@bsdbox.org>
>> Date: Fri, 25 Feb 2022 13:58:36 +1100
>> Cc: 54140@debbugs.gnu.org
>> 
>> Do you know where in the codebase to dig to start debugging this?
> 
> There's no need to debug this: this is the expected behavior on TTY
> frames

Is this documented; if not, would a patch to this effect be accepted?

> see desktop-restoring-frameset-p.  We deliberately don't
> restore the frameset on text-mode displays.  For the reasons, see
> bug#17693.

I had a cursory look but don’t quite understand why that precludes desktop-save-mode from working with Emacs in the terminal. If you save an -nw session, you’d have no graphical frames to restore when starting an -nw session. I’ll read the thread in its entirety when back in front of the kb.

Sent from my iPhone




[-- Attachment #2: Type: text/html, Size: 1850 bytes --]

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

* bug#54140: 27.2; desktop-save-mode fails to restore frame and window config
  2022-02-25  9:39           ` Mark Jamsek
@ 2022-02-25 12:02             ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-02-25 12:02 UTC (permalink / raw)
  To: Mark Jamsek; +Cc: larsi, 54140

> From: Mark Jamsek <mark@bsdbox.org>
> Date: Fri, 25 Feb 2022 20:39:21 +1100
> Cc: larsi@gnus.org, 54140@debbugs.gnu.org
> 
>  There's no need to debug this: this is the expected behavior on TTY
>  frames
> 
> Is this documented; if not, would a patch to this effect be accepted?

It depends on what the patch will do.  Unconditionally letting desktop
restore the frameset on TTY displays is out of the question, as it
will bring back the problems we solved when we prevented that.

>  see desktop-restoring-frameset-p.  We deliberately don't
>  restore the frameset on text-mode displays.  For the reasons, see
>  bug#17693.
> 
> I had a cursory look but don’t quite understand why that precludes desktop-save-mode from working with
> Emacs in the terminal. If you save an -nw session, you’d have no graphical frames to restore when starting
> an -nw session.

How do we know that the desktop was saved from a -nw session?

> I’ll read the thread in its entirety when back in front of the kb.

Thanks.  A related issue is bug#24298.





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

end of thread, other threads:[~2022-02-25 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 10:04 bug#54140: 27.2; desktop-save-mode fails to restore frame and window config Mark Jamsek
2022-02-24 14:30 ` Lars Ingebrigtsen
     [not found]   ` <14B9A1B4-2208-4C05-8167-DAF3DC49C3D6@bsdbox.org>
2022-02-25  2:38     ` Lars Ingebrigtsen
2022-02-25  2:58       ` Mark Jamsek
2022-02-25  8:02         ` Eli Zaretskii
2022-02-25  9:39           ` Mark Jamsek
2022-02-25 12:02             ` Eli Zaretskii

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