GNU bug report logs -
#8920
24.0.50; Calendar raises error with #included diary file
Previous Next
Reported by: Stephen Berman <stephen.berman <at> gmx.net>
Date: Wed, 22 Jun 2011 23:04:02 UTC
Severity: normal
Found in version 24.0.50
Done: Stephen Berman <stephen.berman <at> gmx.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Sat, 25 Jun 2011 18:25:18 -0400 Glenn Morris <rgm <at> gnu.org> wrote:
> Stephen Berman wrote:
>> (unwind-protect
>> ! (if calendar-mark-diary-entries-flag
>> ! (save-selected-window
>> ! (save-excursion
>> ! (diary-mark-entries))))
>> (if today-visible
>> (run-hooks 'calendar-today-visible-hook)
>> (run-hooks 'calendar-today-invisible-hook)))))
>
>
>
> I don't like this, because IIUC, this is only needed because of the:
>
> (find-file-noselect (diary-check-diary-file) t)
>
> in diary-mark-entries.
>
> It should be implicit that find-file-noselect does not mess with the
> window layout, and we should not need to wrap every call to it in save-*
> constructs to guard against inappropriate find-file-hooks.
>
> I've made some changes to diary-lib.el that mean there is no longer an
> error in the initial example; however the calendar buffer ends up being
> replaced with the diary buffer.
Yes, though I've ascertained that this only happens when the included
file is not already being visited in a buffer when calendar is invoked
-- that's what triggers the inappropriate function in find-file-hook.
> I didn't read in detail all that you want to do, but I think the only
> way you can do it at present is by advising find-file rather than using
> find-file-hook.
Hm, I'd rather not take that advice ;-). But I've now put the function
on post-command-hook and so far it seems to DTRT and also avoids the
problem with find-file-hook.
Thanks for the helpful feedback.
Steve Berman
This bug report was last modified 14 years and 31 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.