emacs-devel
[Top][All Lists]
Advanced

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

[PATCH] Desktop mode saves mark-ring too verbosely


From: Kelly Dean
Subject: [PATCH] Desktop mode saves mark-ring too verbosely
Date: Tue, 21 May 2013 20:44:15 -0700 (PDT)

You can (add-to-list 'desktop-locals-to-save 'mark-ring) and it works, so long 
as you have the fix for bug 13951 applied. But it's very verbose; for each 
element of mark-ring for each buffer, it writes an entry like

(let ((mk (make-marker))) (add-hook 'desktop-delay-hook (list 'lambda '() (list 
'set-marker mk 123 '(get-buffer "init.el")))) mk)

The result is about 2kB of text to record a standard 16-element mark-ring. The 
file name is redundant, since it's already written as the first argument for 
desktop-create-buffer, and the rest of the line could be eliminated by 
special-casing saving of mark-ring, leaving just a list of marker positions to 
write into the desktop file, which will typically be less than 100 bytes of 
text. If you have dozens of file-visiting buffers, this can make the difference 
between a desktop file that's over 100kB and one that's just a few kB.

The attached patch does this. Surely this qualifies as a tiny change, since it 
only changes about 5 significant lines.

The "&rest _unsupported" is unnecessary; it just enables forward compatibility 
with files of version greater than 207. If it were already there, then version 
206 code would be able to read version 207 files, and just ignore the mark ring.

Returning result from desktop-create-buffer is unnecessary for desktop mode, 
but it does no harm, and I need it in some of my other code, so please allow it.

Attachment: desktop-mark-ring.patch
Description: Text Data


reply via email to

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