unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17090: desktop.el saves unusable register data in register-alist
@ 2014-03-24 20:31 Juanma Barranquero
  2019-09-29 14:42 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2014-03-24 20:31 UTC (permalink / raw)
  To: 17090

Package: Emacs
Severity: minor

emacs -Q -f desktop-save-mode
C-x r w a
C-x C-x
y <RET>
emacs -Q -f desktop-read
C-x r j

=> a: rectangle starting with Unprintable entity

and similarly, when using
C-x r f a

restoring and then C-x r j  brings

Error running timer: (invalid function "Unprintable entity")

register-alist is in desktop-globals-to-save by default, so it should
work out of the box. but any fix is going to be ugly.

Possibilities:

- Cleaning register-alist from desktop-save-hook. Not a good idea
because the session does not necessarily end on desktop-saving (and
even less now, with timer-based saving).

- Modify desktop-outvar to skip anything whose serialization matches
"Unprintable entity".

- Modify desktop-outvar with register-alist specific knowledge, so it
filters out only some entries when serializing.

- Design a more generic mechanism to allow variables to have cleaning
specific functions.

The first three options are horribly hackish, and the last one is a
bit overkill if we only want to avoid the register-alist issue (the
mechanism would be generally useful, but no one has ever asked for
it...)

Ideas?





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

* bug#17090: desktop.el saves unusable register data in register-alist
  2014-03-24 20:31 bug#17090: desktop.el saves unusable register data in register-alist Juanma Barranquero
@ 2019-09-29 14:42 ` Lars Ingebrigtsen
  2019-09-29 14:59   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-29 14:42 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17090

Juanma Barranquero <lekktu@gmail.com> writes:

> emacs -Q -f desktop-save-mode
> C-x r w a
> C-x C-x
> y <RET>
> emacs -Q -f desktop-read
> C-x r j
>
> => a: rectangle starting with Unprintable entity
>
> and similarly, when using
> C-x r f a
>
> restoring and then C-x r j  brings
>
> Error running timer: (invalid function "Unprintable entity")

I'm unable to reproduce this bug in Emacs 27 (and I also vaguely
remember something being fixed in this area a few months ago).

Instead of the error, I get:

Desktop: 1 frame, 0 buffers restored.

and then 

Register doesn’t contain a buffer position or configuration

when trying to C-x r j a-ing.

Are you still seeing this problem in Emacs 27?

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





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

* bug#17090: desktop.el saves unusable register data in register-alist
  2019-09-29 14:42 ` Lars Ingebrigtsen
@ 2019-09-29 14:59   ` Lars Ingebrigtsen
  2019-09-29 16:17     ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-29 14:59 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17090

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm unable to reproduce this bug in Emacs 27 (and I also vaguely
> remember something being fixed in this area a few months ago).

Hm, I think I was wrong here -- I'm not getting exactly the same errors
as in earlier versions of Emacs, but the data that's saved still isn't
usable.

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





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

* bug#17090: desktop.el saves unusable register data in register-alist
  2019-09-29 14:59   ` Lars Ingebrigtsen
@ 2019-09-29 16:17     ` Juanma Barranquero
  2019-09-30  4:40       ` Lars Ingebrigtsen
  2019-10-07 18:28       ` Juri Linkov
  0 siblings, 2 replies; 7+ messages in thread
From: Juanma Barranquero @ 2019-09-29 16:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 17090

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

Curious that my original recipe (fixing the C-x C-x to C-x C-c, as I
suppose I intended) doesn't work now because

  emacs -Q -f desktop-read

does not read the desktop file from the current directory ('.' is no longer
in desktop-path).

But anyway, back to the issue:

> Hm, I think I was wrong here -- I'm not getting exactly the same errors
> as in earlier versions of Emacs, but the data that's saved still isn't
> usable.

Correct.

But, I suppose it is perhaps not worth fixing now, because after that we
implemented framesets, and you can do

C-x r f a

and the frameset in register a is saved and correctly reloaded afterwards.
It's a bit of an overkill, of course.

If we want to fix it, perhaps we could trick our way, by using framesets to
save a one-frame frameset with some special info to mark that it is really
intended to be just a window-configuration, and then, when reloading the
desktop, restoring somehow the window configuration into the register, from
the frameset data. No idea if it is worth the effort, but I think it would
be doable.

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

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

* bug#17090: desktop.el saves unusable register data in register-alist
  2019-09-29 16:17     ` Juanma Barranquero
@ 2019-09-30  4:40       ` Lars Ingebrigtsen
  2019-09-30  8:10         ` Juanma Barranquero
  2019-10-07 18:28       ` Juri Linkov
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-30  4:40 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17090

Juanma Barranquero <lekktu@gmail.com> writes:

> But, I suppose it is perhaps not worth fixing now, because after that
> we implemented framesets, and you can do
>
> C-x r f a
>
> and the frameset in register a is saved and correctly reloaded
> afterwards. It's a bit of an overkill, of course.
>
> If we want to fix it, perhaps we could trick our way, by using
> framesets to save a one-frame frameset with some special info to mark
> that it is really intended to be just a window-configuration, and
> then, when reloading the desktop, restoring somehow the window
> configuration into the register, from the frameset data. No idea if it
> is worth the effort, but I think it would be doable.

It sounds like we should perhaps refer users to the C-x r f a command
instead...  But in any case, desktop.el probably shouldn't be saving
these useless window configuration registers.

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





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

* bug#17090: desktop.el saves unusable register data in register-alist
  2019-09-30  4:40       ` Lars Ingebrigtsen
@ 2019-09-30  8:10         ` Juanma Barranquero
  0 siblings, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2019-09-30  8:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 17090

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

On Mon, Sep 30, 2019 at 6:40 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> It sounds like we should perhaps refer users to the C-x r f a command
> instead...

Currently, the function assigned to the C-x r map to save a frameset saves
all the frames, so in some uses, saving and restoring the window
configuration (which affects just one frame) is faster and cleaner. Also,
restoring a frameset not only restores the window configuration, but also
position on the screen.

Of course, it would be possible to add another command, or a prefix
parameter, to frameset-to-register, to save just the selected frame, and to
restore the frameset without moving the frame.

> But in any case, desktop.el probably shouldn't be saving
> these useless window configuration registers.

Definitely. It's wasted space and time, and does not serve any useful
purpose.

FWIW, I agree. Documenting the issue and filtering out the
window-configurations on desktop save seems like the easier answer right
now. Don't think it's really a very urgent or frequent issue.

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

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

* bug#17090: desktop.el saves unusable register data in register-alist
  2019-09-29 16:17     ` Juanma Barranquero
  2019-09-30  4:40       ` Lars Ingebrigtsen
@ 2019-10-07 18:28       ` Juri Linkov
  1 sibling, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2019-10-07 18:28 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 17090, Lars Ingebrigtsen

> If we want to fix it, perhaps we could trick our way, by using framesets to
> save a one-frame frameset with some special info to mark that it is really
> intended to be just a window-configuration, and then, when reloading the
> desktop, restoring somehow the window configuration into the register, from
> the frameset data. No idea if it is worth the effort, but I think it would
> be doable.

I invite you to look at the solution that Martin helped to develop
that restores tabs with window-configurations from the desktop file
using framesets, see the comment in tab-bar.el (just search
for “window-configuration”).





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

end of thread, other threads:[~2019-10-07 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-24 20:31 bug#17090: desktop.el saves unusable register data in register-alist Juanma Barranquero
2019-09-29 14:42 ` Lars Ingebrigtsen
2019-09-29 14:59   ` Lars Ingebrigtsen
2019-09-29 16:17     ` Juanma Barranquero
2019-09-30  4:40       ` Lars Ingebrigtsen
2019-09-30  8:10         ` Juanma Barranquero
2019-10-07 18:28       ` Juri Linkov

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