From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.devel Subject: [PATCH] Desktop mode saves mark-ring too verbosely Date: Tue, 21 May 2013 20:44:15 -0700 (PDT) Message-ID: <1369194255.41567.YahooMailClassic@web141101.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="844607989-876708245-1369194255=:41567" X-Trace: ger.gmane.org 1369194276 28001 80.91.229.3 (22 May 2013 03:44:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 May 2013 03:44:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 22 05:44:33 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uezyb-0003qq-Jw for ged-emacs-devel@m.gmane.org; Wed, 22 May 2013 05:44:33 +0200 Original-Received: from localhost ([::1]:44235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uezyb-0002d1-6P for ged-emacs-devel@m.gmane.org; Tue, 21 May 2013 23:44:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UezyR-0002cs-JO for emacs-devel@gnu.org; Tue, 21 May 2013 23:44:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UezyL-0007zr-6K for emacs-devel@gnu.org; Tue, 21 May 2013 23:44:23 -0400 Original-Received: from nm7.bullet.mail.bf1.yahoo.com ([98.139.212.166]:28967) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1UezyL-0007zl-14 for emacs-devel@gnu.org; Tue, 21 May 2013 23:44:17 -0400 Original-Received: from [98.139.212.144] by nm7.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2013 03:44:16 -0000 Original-Received: from [98.139.212.241] by tm1.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2013 03:44:16 -0000 Original-Received: from [127.0.0.1] by omp1050.mail.bf1.yahoo.com with NNFMP; 22 May 2013 03:44:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 447332.9581.bm@omp1050.mail.bf1.yahoo.com Original-Received: (qmail 53330 invoked by uid 60001); 22 May 2013 03:44:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1369194256; bh=awV9dTBRhSqwVqMN+MpUtkdRLQx8leAz3tI0uqE8yQs=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=WJXZehBc4WALlxSNRd5RWKneW/b1z5pDcGqwfxEkIZUErwg7EuDnafCZigcCfoEAgiucGftZf1eVMUBOrFAB7HPe8nc3vgZfosB9247kAHGGzmGS9ZlI7kKJw9LtLhcHoDjfdiSWghcu+riK+MooyXPpFH37dr5nnECpLHZF2/s= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=Tpn2zqLzIvP+dtSl6L5bXRUJu56elDmdzOD8EkN573ApMErdEkgk+b8DjuaxZcCMGcIAbrUDJdJOHZaBb0Wko04wRMX+G2D6vK7wZuA4jdnjsyQainE0gCSNKxCIM7vfdTInGONq1IiseovSb2/1t2oUTgH5K0HK31X8kN58jLQ=; X-YMail-OSG: _X0WYn0VM1n6X8MPTmTNEg_U5UldWgm7MnIhh7FIW4vY0oT .UqcbnPWSzWKel4.ADc6u Original-Received: from [37.221.161.234] by web141101.mail.bf1.yahoo.com via HTTP; Tue, 21 May 2013 20:44:15 PDT X-Rocket-MIMEInfo: 002.001, WW91IGNhbiAoYWRkLXRvLWxpc3QgJ2Rlc2t0b3AtbG9jYWxzLXRvLXNhdmUgJ21hcmstcmluZykgYW5kIGl0IHdvcmtzLCBzbyBsb25nIGFzIHlvdSBoYXZlIHRoZSBmaXggZm9yIGJ1ZyAxMzk1MSBhcHBsaWVkLiBCdXQgaXQncyB2ZXJ5IHZlcmJvc2U7IGZvciBlYWNoIGVsZW1lbnQgb2YgbWFyay1yaW5nIGZvciBlYWNoIGJ1ZmZlciwgaXQgd3JpdGVzIGFuIGVudHJ5IGxpa2UKCihsZXQgKChtayAobWFrZS1tYXJrZXIpKSkgKGFkZC1ob29rICdkZXNrdG9wLWRlbGF5LWhvb2sgKGxpc3QgJ2xhbWJkYSAnKCkBMAEBAQE- X-Mailer: YahooMailClassic/15.1.8 YahooMailWebService/0.8.142.542 X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 98.139.212.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159725 Archived-At: --844607989-876708245-1369194255=:41567 Content-Type: text/plain; charset=us-ascii 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. --844607989-876708245-1369194255=:41567 Content-Type: text/x-diff; name="desktop-mark-ring.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="desktop-mark-ring.patch" LS0tIGVtYWNzLTI0LjMvbGlzcC9kZXNrdG9wLmVsCisrKyBlbWFjcy0yNC4z L2xpc3AvZGVza3RvcC5lbApAQCAtMTMzLDcgKzEzMyw3IEBACiAKIDs7OyBD b2RlOgogCi0oZGVmdmFyIGRlc2t0b3AtZmlsZS12ZXJzaW9uICIyMDYiCiso ZGVmdmFyIGRlc2t0b3AtZmlsZS12ZXJzaW9uICIyMDciCiAgICJWZXJzaW9u IG51bWJlciBvZiBkZXNrdG9wIGZpbGUgZm9ybWF0LgogV3JpdHRlbiBpbnRv IHRoZSBkZXNrdG9wIGZpbGUgYW5kIHVzZWQgYXQgZGVza3RvcCByZWFkIHRv IHByb3ZpZGUKIGJhY2t3YXJkIGNvbXBhdGliaWxpdHkuIikKQEAgLTY5NCw3 ICs2OTQsOCBAQAogCSAgICh3aGVuIChtZW1iZXIgKGNhciBsb2NhbHMpIGxv Y2xpc3QpCiAJICAgICAoc2V0cSBsbCAoY29ucyAoY2FyIGxvY2FscykgbGwp KSkpKQogICAgICAgIChzZXRxIGxvY2FscyAoY2RyIGxvY2FscykpKQotICAg ICBsbCkpKQorICAgICBsbCkKKyAgIChtYXBjYXIgJ21hcmtlci1wb3NpdGlv biBtYXJrLXJpbmcpKSkKIAogOzsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQog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0tLQogOzsgQmFja3dhcmQgY29tcGF0aWJp bGl0eSAtLSB1cGRhdGUgcGFyYW1ldGVycyB0byAyMDUgc3RhbmRhcmRzLgo= --844607989-876708245-1369194255=:41567--