bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: desktop.el: `p' void in desktop-internal-v2s when saving frame conf


From: Ehud Karni
Subject: Re: desktop.el: `p' void in desktop-internal-v2s when saving frame conf
Date: Mon, 26 Mar 2001 18:48:53 +0200

On Sun, 11 Mar 2001 15:16:41 +0200, era eriksson <address@hidden> wrote:
> 
> I'm playing around with frame configurations ....
> For the time being, I've simply stored my frame configuration in a
> register so the Desktop package will save it even in its default
> configuration (it includes register-alist in the variables it stores)
> but I get an error message when attempting to run `desktop-save'.
> 
> Here's what I get in the backtrace:
> 
> Signaling: (void-variable p)
>   desktop-internal-v2s((icon-top . unbound))
>   desktop-internal-v2s(((parent-id . 8389027) (display . ":0.0") ....

The problem is really with the builtin `frame-configuration-to-register'
which create Non lisp conses (the cdr part is not a lisp object) this
should be fixed in the C code. Even if the `desktop-save' did save the
relevant register you will not be able to use it when `desktop-read'
reloads it because the frame and windows configurations are saved as
"Unprintable entity" by desktop.el.
That's said, I have a workaround solution and a (very minor)
improvement for desktop.el (from Emacs 20.7).

Here is the diff:

diff -c ~/20.7_lisps/desktop.el ~/desktop.el
*** ~/20.7_lisps/desktop.el     Wed Nov 11 21:25:51 1998
--- ~/desktop.el                Mon Mar 26 15:48:47 2001
***************
*** 331,337 ****
        (let ((q.txt (desktop-internal-v2s (car p))))
          (or anynil (setq anynil (null (car q.txt))))
          (setq newlist (cons q.txt newlist)))
!       (setq p (cdr p)))
        (if p
          (let ((last (desktop-internal-v2s p))
                (el (car newlist)))
--- 331,339 ----
        (let ((q.txt (desktop-internal-v2s (car p))))
          (or anynil (setq anynil (null (car q.txt))))
          (setq newlist (cons q.txt newlist)))
!       (setq p
!               (if (string-equal (prin1-to-string (cdr p)) "unbound")
!                   'unbound (cdr p))))
        (if p
          (let ((last (desktop-internal-v2s p))
                (el (car newlist)))
***************
*** 365,371 ****
                        " (list 'lambda '() (list 'set-marker mk "
                        pos " (get-buffer " buf ")))) mk)"))))
     (t                                 ; save as text
!     (cons 'may "\"Unprintable entity\""))))

  (defun desktop-value-to-string (val)
    "Convert VALUE to a string that when read evaluates to the same value.
--- 367,373 ----
                        " (list 'lambda '() (list 'set-marker mk "
                        pos " (get-buffer " buf ")))) mk)"))))
     (t                                 ; save as text
!     (cons 'may (concat "\"" (prin1-to-string val) "\"")))))

  (defun desktop-value-to-string (val)
    "Convert VALUE to a string that when read evaluates to the same value.
Exit 1

Diff finished at Mon Mar 26 15:52:47

Ehud.


-- 
 @@@@@@ @@@ @@@@@@ @    @   Ehud Karni  Simon & Wiesel  Insurance agency
     @    @      @  @@  @   Tel: +972-3-6212-757    Fax: +972-3-6292-544
     @    @ @    @ @  @@    (USA)  Fax  and  voice  mail:  1-815-5509341
     @    @ @    @ @    @        Better     Safe     Than     Sorry
 http://www.simonwiesel.co.il    mailto:address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]