From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: Suggested patch for desktop.el, and 'slothful' lazy file loading Date: Tue, 12 Apr 2011 17:37:31 -0600 Organization: XCP-1 Message-ID: <4DA4E23B.9090506@lanl.gov> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1302658879 17707 80.91.229.12 (13 Apr 2011 01:41:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2011 01:41:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Sexton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 13 03:41:15 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9p51-0000FD-Dy for ged-emacs-devel@m.gmane.org; Wed, 13 Apr 2011 03:41:15 +0200 Original-Received: from localhost ([::1]:38592 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9p50-0005Y8-SY for ged-emacs-devel@m.gmane.org; Tue, 12 Apr 2011 21:41:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9p3L-0002no-WF for emacs-devel@gnu.org; Tue, 12 Apr 2011 21:39:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9n9L-0001KV-Qd for emacs-devel@gnu.org; Tue, 12 Apr 2011 19:37:36 -0400 Original-Received: from proofpoint2.lanl.gov ([204.121.3.26]:33772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9n9L-0001KD-DD for emacs-devel@gnu.org; Tue, 12 Apr 2011 19:37:35 -0400 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint2.lanl.gov (8.14.3/8.14.3) with ESMTP id p3CNbWLo019757; Tue, 12 Apr 2011 17:37:32 -0600 Original-Received: from x-mail.lanl.gov (x-mail.lanl.gov [128.165.4.125]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 3F9D615CB4FA; Tue, 12 Apr 2011 17:37:32 -0600 (MDT) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by x-mail.lanl.gov (Postfix) with ESMTP id 3D7ED1DC8097; Tue, 12 Apr 2011 17:37:32 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at x-mail.lanl.gov Original-Received: from [128.165.123.181] (xray-r02.lanl.gov [128.165.123.181]) by x-mail.lanl.gov (Postfix) with ESMTP id 25A6B1DC8095; Tue, 12 Apr 2011 17:37:32 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101220 Lanikai/3.1.7 In-Reply-To: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2011-04-12_09:2011-04-12, 2011-04-12, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 204.121.3.26 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:138446 Archived-At: > I have been using desktop.el in "lazy" mode i.e. with the settings > > (setq desktop-restore-eager 10) > (setq desktop-lazy-verbose nil) > > This is supposed to make it load the first 10 files normally, then load the > rest "in the background" when Emacs is idle. > > I have found that although the extra buffers are loaded in the > background, after each buffer is loaded the display still switches to > that buffer. This is very disconcerting - you are trying to work in > buffer A but you are constantly switched against your will to > viewing buffer B, C, D, etc, as they are loaded. I can't reproduce this (but I only have an old Emacs 22 to hand to test). > The following trivial patch seems to fix this, and I have not encountered any > problems so far with it. I suppose that we use switch-to-buffer because it affects the buffer list order, but I'm not sure; the reordering code is complicated and its true goal is unclear. If we can use `set-buffer', we can just use `with-current-buffer'. > Also, I have written an emacs extension called 'slothful' which allows > true lazy loading of files - instead of actually loading the file, an > empty buffer is created pointing the file, and it automatically loads > only when the buffer is first displayed. I think this might be an > interesting addition to desktop. I have tested it myself, just loading > individual files. A minor point: you can't restore point and mark in such a buffer, so they would be lost at the next desktop-save. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.