[Top][All Lists]

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

bug#6999: 23.2; [PATCH] appt ignores included diary files

From: Leo
Subject: bug#6999: 23.2; [PATCH] appt ignores included diary files
Date: Wed, 08 Sep 2010 13:45:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4)

On 2010-09-08 13:31 +0100, Leo wrote:
> When the main diary file includes other diary files. File saving in the
> included does no appt-check, which means if one adds appointments
> directly into the included file, they will not be added by
> appt-update-list.
> One simple solution is to make appt-update-list do appt-check if major
> mode is diary-mode. Then users can open included files in diary mode and
> add appointments.

Annoyingly appt-check pops up the main diary buffer. So maybe do this

diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 3573c95..32563ab 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -660,10 +660,11 @@ hour and minute parts."
 (defun appt-update-list ()
   "If the current buffer is visiting the diary, update appointments.
 This function is intended for use with `write-file-functions'."
-  (and (string-equal buffer-file-name (expand-file-name diary-file))
+  (and (or (string-equal buffer-file-name (expand-file-name diary-file))
+           (eq major-mode 'diary-mode))
        (let ((appt-display-diary nil))
-         (appt-check t)))
+         (save-window-excursion (appt-check t))))
 ;; In Emacs-21.3, the manual documented the following procedure to

reply via email to

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