Mercurial > emacs
comparison lisp/calendar/appt.el @ 93237:0f4b8a3dc49e
(appt-buffer-name): Don't use a leading space for buffers shown to the user.
(appt-disp-window): Disable undo explicitly now that the leading space is gone.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 26 Mar 2008 03:42:57 +0000 |
parents | e2f0046a8cb4 |
children | 4fa95a348719 |
comparison
equal
deleted
inserted
replaced
93236:e550714b0fde | 93237:0f4b8a3dc49e |
---|---|
28 | 28 |
29 ;; | 29 ;; |
30 ;; appt.el - visible and/or audible notification of | 30 ;; appt.el - visible and/or audible notification of |
31 ;; appointments from diary file. | 31 ;; appointments from diary file. |
32 ;; | 32 ;; |
33 ;;; | 33 ;; |
34 ;;; Thanks to Edward M. Reingold for much help and many suggestions, | 34 ;; Thanks to Edward M. Reingold for much help and many suggestions, |
35 ;;; And to many others for bug fixes and suggestions. | 35 ;; And to many others for bug fixes and suggestions. |
36 ;;; | 36 ;; |
37 ;;; | 37 ;; |
38 ;;; This functions in this file will alert the user of a | 38 ;; This functions in this file will alert the user of a |
39 ;;; pending appointment based on his/her diary file. This package | 39 ;; pending appointment based on his/her diary file. This package |
40 ;;; is documented in the Emacs manual. | 40 ;; is documented in the Emacs manual. |
41 ;;; | 41 ;; |
42 ;;; To activate this package, simply use (appt-activate 1). | 42 ;; To activate this package, simply use (appt-activate 1). |
43 ;;; A `diary-file' with appointments of the format described in the | 43 ;; A `diary-file' with appointments of the format described in the |
44 ;;; documentation of the function `appt-check' is required. | 44 ;; documentation of the function `appt-check' is required. |
45 ;;; Relevant customizable variables are also listed in the | 45 ;; Relevant customizable variables are also listed in the |
46 ;;; documentation of that function. | 46 ;; documentation of that function. |
47 ;;; | 47 ;; |
48 ;;; Today's appointment list is initialized from the diary when this | 48 ;; Today's appointment list is initialized from the diary when this |
49 ;;; package is activated. Additionally, the appointments list is | 49 ;; package is activated. Additionally, the appointments list is |
50 ;;; recreated automatically at 12:01am for those who do not logout | 50 ;; recreated automatically at 12:01am for those who do not logout |
51 ;;; every day or are programming late. It is also updated when the | 51 ;; every day or are programming late. It is also updated when the |
52 ;;; `diary-file' is saved. Calling `appt-check' with an argument forces | 52 ;; `diary-file' is saved. Calling `appt-check' with an argument forces |
53 ;;; a re-initialization at any time. | 53 ;; a re-initialization at any time. |
54 ;;; | 54 ;; |
55 ;;; In order to add or delete items from today's list, without | 55 ;; In order to add or delete items from today's list, without |
56 ;;; changing the diary file, use `appt-add' and `appt-delete'. | 56 ;; changing the diary file, use `appt-add' and `appt-delete'. |
57 ;;; | 57 ;; |
58 | 58 |
59 ;;; Brief internal description - Skip this if you are not interested! | 59 ;; Brief internal description - Skip this if you are not interested! |
60 ;;; | 60 ;; |
61 ;;; The function `appt-make-list' creates the appointments list which | 61 ;; The function `appt-make-list' creates the appointments list which |
62 ;;; `appt-check' reads. | 62 ;; `appt-check' reads. |
63 ;;; | 63 ;; |
64 ;;; You can change the way the appointment window is created/deleted by | 64 ;; You can change the way the appointment window is created/deleted by |
65 ;;; setting the variables | 65 ;; setting the variables |
66 ;;; | 66 ;; |
67 ;;; appt-disp-window-function | 67 ;; appt-disp-window-function |
68 ;;; and | 68 ;; and |
69 ;;; appt-delete-window-function | 69 ;; appt-delete-window-function |
70 ;;; | 70 ;; |
71 ;;; For instance, these variables could be set to functions that display | 71 ;; For instance, these variables could be set to functions that display |
72 ;;; appointments in pop-up frames, which are lowered or iconified after | 72 ;; appointments in pop-up frames, which are lowered or iconified after |
73 ;;; `appt-display-interval' minutes. | 73 ;; `appt-display-interval' minutes. |
74 ;;; | 74 ;; |
75 | 75 |
76 ;;; Code: | 76 ;;; Code: |
77 | 77 |
78 ;; Make sure calendar is loaded when we compile this. | 78 ;; Make sure calendar is loaded when we compile this. |
79 (require 'calendar) | 79 (require 'calendar) |
178 :group 'appt) | 178 :group 'appt) |
179 | 179 |
180 | 180 |
181 ;;; Internal variables below this point. | 181 ;;; Internal variables below this point. |
182 | 182 |
183 (defconst appt-buffer-name " *appt-buf*" | 183 (defconst appt-buffer-name "*appt-buf*" |
184 "Name of the appointments buffer.") | 184 "Name of the appointments buffer.") |
185 | 185 |
186 (defvar appt-time-msg-list nil | 186 (defvar appt-time-msg-list nil |
187 "The list of appointments for today. | 187 "The list of appointments for today. |
188 Use `appt-add' and `appt-delete' to add and delete appointments. | 188 Use `appt-add' and `appt-delete' to add and delete appointments. |
434 (when (>= (window-height) (* 2 window-min-height)) | 434 (when (>= (window-height) (* 2 window-min-height)) |
435 (select-window (split-window)))) | 435 (select-window (split-window)))) |
436 (switch-to-buffer appt-disp-buf)) | 436 (switch-to-buffer appt-disp-buf)) |
437 (calendar-set-mode-line | 437 (calendar-set-mode-line |
438 (format " Appointment in %s minutes. %s " min-to-app new-time)) | 438 (format " Appointment in %s minutes. %s " min-to-app new-time)) |
439 (buffer-disable-undo) | |
439 (erase-buffer) | 440 (erase-buffer) |
440 (insert appt-msg) | 441 (insert appt-msg) |
441 (shrink-window-if-larger-than-buffer (get-buffer-window appt-disp-buf t)) | 442 (shrink-window-if-larger-than-buffer (get-buffer-window appt-disp-buf t)) |
442 (set-buffer-modified-p nil) | 443 (set-buffer-modified-p nil) |
443 (raise-frame (selected-frame)) | 444 (raise-frame (selected-frame)) |