[Top][All Lists]

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

Re: Suggested patch for desktop.el, and 'slothful' lazy file loading

From: Davis Herring
Subject: Re: Suggested patch for desktop.el, and 'slothful' lazy file loading
Date: Tue, 12 Apr 2011 17:37:31 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101220 Lanikai/3.1.7

> 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

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


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

reply via email to

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