[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] RE: New: planner-tasks-file-behavior
From: |
fouvry+emacs-wiki |
Subject: |
Re: [emacs-wiki-discuss] RE: New: planner-tasks-file-behavior |
Date: |
Tue, 21 Sep 2004 18:40:29 +0200 (CEST) |
[...]
| I finally got around to working on Frederik Fouvry's patch to
| planner-update-task, [snip] He wanted it to close
| files that it had to open itself.
|
| planner--dev--1.0--patch-167 now includes the
| planner-tasks-file-behavior user option. By default, it closes all the
| extra buffers opened by plan, planner-copy-or-move-region,
| planner-copy-or-move-task, planner-replan-task, and
| planner-update-task. (plan) should add just one new buffer: the buffer
| for today.
The patch as I submitted it was actually too slow when many files
had to be opened (mainly due to font-locking). I'm not using it
anymore, but Sacha's suggestion to collect the open files first,
then update them (without saving & closing after every task
update), and then restore them, seems a better and more viable
alternative. My patch was just a fast way to get a "prototype"
working.
Perhaps it an even simpler technique is to keep track of the
files that have to be opened for saving/updating, and then to
save and kill these buffers once done. The advantage: the names
of the buffers to be killed are immediately available, and it's
less likely to interfere with other things (like just a snapshot
of the buffer list is doing [1]). Even better would be if these
files could be opened without font-locking: that would speed
things up a lot, and may make buffer bookkeeping unnecessary
(although there's nothing against it).
[Something else: The duplication of recording the live buffers
(both in planner-copy-or-move-region and
planner-copy-or-move-task, where the former calls the latter),
makes me uneasy.]
Cheers,
Frederik
[1] A (possible) example of this going astray: suppose that a
hook/function is called during the update that changes the
major mode of an open buffer B to planner-mode. The
live-buffer list will not contain B, so the buffer, even
though it may not have anything to do with the day page, will
be killed. IMO that is wrong: it should only kill buffers it
had to open itself, NOT buffers that were opened/affected by
other functions. A realistic scenario: the update may
contain a call the function to generate a task overview. If
so, it will be killed at the end.