unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35131: 27.0.50; desktop-save no longer saves register containing frameset
@ 2019-04-03 22:15 Tadeus Prastowo
  2019-04-03 22:31 ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Tadeus Prastowo @ 2019-04-03 22:15 UTC (permalink / raw)
  To: 35131; +Cc: Stefan Monnier, emacs-devel

$ emacs -Q
C-x C-f x.txt
Hello world!
C-x C-s
C-x 3
C-x 2
C-x r f =
C-x 1
M-x desktop-save RET RET yes RET
C-x C-c
$ emacs -Q
M-x desktop-read RET
C-x r j =
The echo area says: Register doesn’t contain a buffer position or configuration

Compare this with Emacs 26.1 that has the correct behavior:
$ emacs-26.1 -Q
C-x C-f x.txt
Another hello world!
C-x C-s
C-x 3
C-x 2
C-x r f =
C-x 1
M-x desktop-save RET RET yes RET
C-x C-c
$ emacs-26.1 -Q
M-x desktop-read RET
C-x r j =
I get the saved frameset back, which contains three windows.

The problem can be traced to the following commit (the committer is CC-ed):
-- 8< -----------------------------
commit cd1d9e79f74f137511d49eb9b0ae7ba750ba6c3c
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Dec 25 22:51:23 2017 -0500

    * lisp/register.el: Use cl-generic

    (registerv): Make it a "normal"struct.
    (registerv-make): Declare obsolete.
    (register-val-jump-to, register-val-describe, register-val-insert):
    New generic functions.
    (jump-to-register, describe-register-1, insert-register): Use them.

    * lisp/emacs-lisp/cl-generic.el: Prefill a combination of struct+typeof.
    (cl--generic-prefill-dispatchers): Allow a list of specializers.
-- 8< -----------------------------

The offending diff is shown below:
-- 8< -----------------------------
diff --git a/lisp/register.el b/lisp/register.el
index 23eefd0..0fdcd51 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -39,9 +39,7 @@
   (registerv (:constructor nil)
          (:constructor registerv--make (&optional data print-func
                               jump-func insert-func))
-         (:copier nil)
-         (:type vector)
-         :named)
+         (:copier nil))
   (data        nil :read-only t)
   (print-func  nil :read-only t)
   (jump-func   nil :read-only t)
-- 8< -----------------------------

Specifically, because type vector is dropped, frameset.el in its using
of registerv-make to save a frameset results in register-alist item
that is no longer a vector (C-h v register-alist shows `(61 .
#s(registerv :data [[frameset 1...' in 27.0.50, not `(61 . [registerv
[[frameset 1...' that is shown in Emacs 26.1).  Since it is no longer
a vector, desktop.el upon desktop-save does not serialize the item in
a format that can be recognized by register.el after desktop-read.

Since the offending commit deprecates the use of registerv-make, this
bug can be easily be killed by making frameset.el define function
`register-val-insert' that saves a frameset as a vector, modifying
function `frameset-to-register' accordingly.

@Stefan: could you do that, please?  Thank you.

-- 
Best regards,
Tadeus





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

* RE: 27.0.50; desktop-save no longer saves register containing frameset
  2019-04-03 22:15 bug#35131: 27.0.50; desktop-save no longer saves register containing frameset Tadeus Prastowo
@ 2019-04-03 22:31 ` Drew Adams
  2019-04-03 22:33   ` Tadeus Prastowo
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2019-04-03 22:31 UTC (permalink / raw)
  To: Tadeus Prastowo, bug-gnu-emacs; +Cc: Stefan Monnier, emacs-devel

Please do not send this to both the bug list and emacs-devel.
Choose one.



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

* Re: 27.0.50; desktop-save no longer saves register containing frameset
  2019-04-03 22:31 ` Drew Adams
@ 2019-04-03 22:33   ` Tadeus Prastowo
  0 siblings, 0 replies; 3+ messages in thread
From: Tadeus Prastowo @ 2019-04-03 22:33 UTC (permalink / raw)
  To: Drew Adams; +Cc: Stefan Monnier, emacs-devel

On Thu, Apr 4, 2019 at 12:32 AM Drew Adams <drew.adams@oracle.com> wrote:
>
> Please do not send this to both the bug list and emacs-devel.
> Choose one.

Roger that.

-- 
Best regards,
Tadeus



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

end of thread, other threads:[~2019-04-03 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 22:15 bug#35131: 27.0.50; desktop-save no longer saves register containing frameset Tadeus Prastowo
2019-04-03 22:31 ` Drew Adams
2019-04-03 22:33   ` Tadeus Prastowo

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