From: Stephen Berman <stephen.berman@gmx.net>
To: Glenn Morris <rgm@gnu.org>
Cc: 8920@debbugs.gnu.org
Subject: bug#8920: 24.0.50; Calendar raises error with #included diary file
Date: Sun, 26 Jun 2011 02:19:14 +0200 [thread overview]
Message-ID: <87ei2hsav1.fsf@escher.fritz.box> (raw)
In-Reply-To: <ouiprty2ep.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 25 Jun 2011 18:25:18 -0400")
On Sat, 25 Jun 2011 18:25:18 -0400 Glenn Morris <rgm@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
next prev parent reply other threads:[~2011-06-26 0:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 23:03 bug#8920: 24.0.50; Calendar raises error with #included diary file Stephen Berman
2011-06-24 18:49 ` Glenn Morris
2011-06-24 21:32 ` Stephen Berman
2011-06-25 20:18 ` Stephen Berman
2011-06-25 22:25 ` Glenn Morris
2011-06-26 0:19 ` Stephen Berman [this message]
2011-06-26 1:25 ` Glenn Morris
2011-06-26 11:09 ` Stephen Berman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ei2hsav1.fsf@escher.fritz.box \
--to=stephen.berman@gmx.net \
--cc=8920@debbugs.gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).