emacs-wiki-discuss
[Top][All Lists]
Advanced

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

Re: [emacs-wiki-discuss] Re: New: planner-tasks-file-behavior


From: Frederik Fouvry
Subject: Re: [emacs-wiki-discuss] Re: New: planner-tasks-file-behavior
Date: Wed, 22 Sep 2004 18:36:04 +0200 (CEST)


[...]

| Hmm. My current implementation behaves reasonably well, although I
| find myself wondering if I should defadvice
| planner-sort-tasks-automatically and
| planner-renumber-tasks-automatically to nil to prevent my tasks from
| moving around whenever I update or reschedule a task. Is this a
| reasonable default? I tend to expect that C-c C-c on a task will leave
| my cursor on the same task, and if planner-update-task saves buffers,
| it makes everything jump around.

Sounds reasonable.  Jumping cursors are something that annoy me
as well.

[...]

| > 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
| 
| I'm a little nervous about using get-buffer for this, as I could run
| into problems with buffers with duplicate names. What's the canonical
| way to check if a file is already open?

I guess find-file-noselect() or get-file-buffer().  As far as I
know, there are never duplicate buffer names in Emacs.  Having
said that, it is not possible to determine the buffer name from
the file name (only), so one needs to check it explicitly.

Given that the files have to be opened anyway,
find-file-noselect() is probably the better solution
(get-file-buffer() returns the buffer associated with a file, if
there is any, nil otherwise; find-file-noselect() opens the file
in that case - and it calls get-file-buffer()).

[...]

Cheers,

Frederik




reply via email to

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