Mercurial > emacs
comparison lisp/calendar/calendar.el @ 92551:a9c1d203dd4a
(calendar-version): Use emacs-version and make it obsolete. Move to end.
(calendar-offset, view-diary-entries-initially)
(mark-diary-entries-in-calendar)
(calendar-remove-frame-by-deleting)
(view-calendar-holidays-initially, all-hebrew-calendar-holidays)
(all-christian-calendar-holidays, all-islamic-calendar-holidays)
(all-bahai-calendar-holidays, calendar-load-hook)
(initial-calendar-window-hook, today-visible-calendar-hook)
(today-invisible-calendar-hook, calendar-move-hook)
(diary-nonmarking-symbol, hebrew-diary-entry-symbol)
(islamic-diary-entry-symbol, bahai-diary-entry-symbol)
(diary-include-string, sexp-diary-entry-symbol)
(abbreviated-calendar-year, american-date-diary-pattern)
(european-date-diary-pattern, european-calendar-display-form)
(american-calendar-display-form, print-diary-entries-hook)
(list-diary-entries-hook, diary-hook, diary-display-hook)
(nongregorian-diary-listing-hook, mark-diary-entries-hook)
(nongregorian-diary-marking-hook, diary-list-include-blanks)
(holidays-in-diary-buffer, general-holidays, oriental-holidays)
(local-holidays, other-holidays, hebrew-holidays-1)
(hebrew-holidays-2, hebrew-holidays-3, hebrew-holidays-4)
(hebrew-holidays, christian-holidays, islamic-holidays)
(bahai-holidays, solar-holidays, calendar-setup)
(calendar-week-start-day): Remove autoload cookies.
(diary-glob-file-regexp-prefix): Doc fix.
(calendar-goto-info-node): Use `info' rather than `Info-find-node'.
(Info-find-emacs-command-nodes, Info-find-node): Remove declarations.
(calendar-week-start-day, calendar-debug-sexp): Move to start.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 07 Mar 2008 05:06:34 +0000 |
parents | 04183df0b71f |
children | 674c88622bd9 |
comparison
equal
deleted
inserted
replaced
92550:4170d4a36502 | 92551:a9c1d203dd4a |
---|---|
96 (defvar displayed-month) | 96 (defvar displayed-month) |
97 (defvar displayed-year) | 97 (defvar displayed-year) |
98 (defvar calendar-month-name-array) | 98 (defvar calendar-month-name-array) |
99 (defvar calendar-starred-day) | 99 (defvar calendar-starred-day) |
100 | 100 |
101 (defun calendar-version () | |
102 (interactive) | |
103 (message "Version 6, October 12, 1995")) | |
104 | |
105 (defgroup calendar nil | 101 (defgroup calendar nil |
106 "Calendar and time management support." | 102 "Calendar and time management support." |
107 :group 'applications) | 103 :group 'applications) |
108 | 104 |
109 (defgroup diary nil | 105 (defgroup diary nil |
136 | 132 |
137 | 133 |
138 (defconst calendar-buffer "*Calendar*" | 134 (defconst calendar-buffer "*Calendar*" |
139 "Name of the buffer used for the calendar.") | 135 "Name of the buffer used for the calendar.") |
140 | 136 |
141 ;;;###autoload | |
142 (defcustom calendar-offset 0 | 137 (defcustom calendar-offset 0 |
143 "The offset of the principal month from the center of the calendar window. | 138 "The offset of the principal month from the center of the calendar window. |
144 0 means the principal month is in the center (default), -1 means on the left, | 139 0 means the principal month is in the center (default), -1 means on the left, |
145 +1 means on the right. Larger (or smaller) values push the principal month off | 140 +1 means on the right. Larger (or smaller) values push the principal month off |
146 the screen." | 141 the screen." |
147 :type 'integer | 142 :type 'integer |
148 :group 'calendar) | 143 :group 'calendar) |
149 | 144 |
150 ;;;###autoload | |
151 (defcustom view-diary-entries-initially nil | 145 (defcustom view-diary-entries-initially nil |
152 "Non-nil means display current date's diary entries on entry to calendar. | 146 "Non-nil means display current date's diary entries on entry to calendar. |
153 The diary is displayed in another window when the calendar is first displayed, | 147 The diary is displayed in another window when the calendar is first displayed, |
154 if the current date is visible. The number of days of diary entries displayed | 148 if the current date is visible. The number of days of diary entries displayed |
155 is governed by the variable `number-of-diary-entries'. This variable can | 149 is governed by the variable `number-of-diary-entries'. This variable can |
156 be overridden by the value of `calendar-setup'." | 150 be overridden by the value of `calendar-setup'." |
157 :type 'boolean | 151 :type 'boolean |
158 :group 'diary) | 152 :group 'diary) |
159 | 153 |
160 ;;;###autoload | |
161 (defcustom mark-diary-entries-in-calendar nil | 154 (defcustom mark-diary-entries-in-calendar nil |
162 "Non-nil means mark dates with diary entries, in the calendar window. | 155 "Non-nil means mark dates with diary entries, in the calendar window. |
163 The marking symbol is specified by the variable `diary-entry-marker'." | 156 The marking symbol is specified by the variable `diary-entry-marker'." |
164 :type 'boolean | 157 :type 'boolean |
165 :group 'diary) | 158 :group 'diary) |
166 | 159 |
167 ;;;###autoload | |
168 (defcustom calendar-remove-frame-by-deleting nil | 160 (defcustom calendar-remove-frame-by-deleting nil |
169 "Determine how the calendar mode removes a frame no longer needed. | 161 "Determine how the calendar mode removes a frame no longer needed. |
170 If nil, make an icon of the frame. If non-nil, delete the frame." | 162 If nil, make an icon of the frame. If non-nil, delete the frame." |
171 :type 'boolean | 163 :type 'boolean |
172 :group 'view) | 164 :group 'view) |
235 "How to mark notable dates in the calendar. | 227 "How to mark notable dates in the calendar. |
236 The value can be either a single-character string or a face." | 228 The value can be either a single-character string or a face." |
237 :type '(choice string face) | 229 :type '(choice string face) |
238 :group 'calendar) | 230 :group 'calendar) |
239 | 231 |
240 ;;;###autoload | |
241 (defcustom view-calendar-holidays-initially nil | 232 (defcustom view-calendar-holidays-initially nil |
242 "Non-nil means display holidays for current three month period on entry. | 233 "Non-nil means display holidays for current three month period on entry. |
243 The holidays are displayed in another window when the calendar is first | 234 The holidays are displayed in another window when the calendar is first |
244 displayed." | 235 displayed." |
245 :type 'boolean | 236 :type 'boolean |
246 :group 'holidays) | 237 :group 'holidays) |
247 | 238 |
248 ;;;###autoload | |
249 (defcustom mark-holidays-in-calendar nil | 239 (defcustom mark-holidays-in-calendar nil |
250 "Non-nil means mark dates of holidays in the calendar window. | 240 "Non-nil means mark dates of holidays in the calendar window. |
251 The marking symbol is specified by the variable `calendar-holiday-marker'." | 241 The marking symbol is specified by the variable `calendar-holiday-marker'." |
252 :type 'boolean | 242 :type 'boolean |
253 :group 'holidays) | 243 :group 'holidays) |
254 | 244 |
255 ;;;###autoload | |
256 (defcustom all-hebrew-calendar-holidays nil | 245 (defcustom all-hebrew-calendar-holidays nil |
257 "If nil, show only major holidays from the Hebrew calendar. | 246 "If nil, show only major holidays from the Hebrew calendar. |
258 This means only those Jewish holidays that appear on secular calendars. | 247 This means only those Jewish holidays that appear on secular calendars. |
259 | 248 |
260 If t, show all the holidays that would appear in a complete Hebrew calendar." | 249 If t, show all the holidays that would appear in a complete Hebrew calendar." |
261 :type 'boolean | 250 :type 'boolean |
262 :group 'holidays) | 251 :group 'holidays) |
263 | 252 |
264 ;;;###autoload | |
265 (defcustom all-christian-calendar-holidays nil | 253 (defcustom all-christian-calendar-holidays nil |
266 "If nil, show only major holidays from the Christian calendar. | 254 "If nil, show only major holidays from the Christian calendar. |
267 This means only those Christian holidays that appear on secular calendars. | 255 This means only those Christian holidays that appear on secular calendars. |
268 | 256 |
269 If t, show all the holidays that would appear in a complete Christian | 257 If t, show all the holidays that would appear in a complete Christian |
270 calendar." | 258 calendar." |
271 :type 'boolean | 259 :type 'boolean |
272 :group 'holidays) | 260 :group 'holidays) |
273 | 261 |
274 ;;;###autoload | |
275 (defcustom all-islamic-calendar-holidays nil | 262 (defcustom all-islamic-calendar-holidays nil |
276 "If nil, show only major holidays from the Islamic calendar. | 263 "If nil, show only major holidays from the Islamic calendar. |
277 This means only those Islamic holidays that appear on secular calendars. | 264 This means only those Islamic holidays that appear on secular calendars. |
278 | 265 |
279 If t, show all the holidays that would appear in a complete Islamic | 266 If t, show all the holidays that would appear in a complete Islamic |
284 (defcustom diary-file-name-prefix-function (function (lambda (str) str)) | 271 (defcustom diary-file-name-prefix-function (function (lambda (str) str)) |
285 "The function that will take a diary file name and return the desired prefix." | 272 "The function that will take a diary file name and return the desired prefix." |
286 :type 'function | 273 :type 'function |
287 :group 'diary) | 274 :group 'diary) |
288 | 275 |
289 ;;;###autoload | |
290 (defcustom all-bahai-calendar-holidays nil | 276 (defcustom all-bahai-calendar-holidays nil |
291 "If nil, show only major holidays from the Baha'i calendar. | 277 "If nil, show only major holidays from the Baha'i calendar. |
292 These are the days on which work and school must be suspended. | 278 These are the days on which work and school must be suspended. |
293 | 279 |
294 If t, show all the holidays that would appear in a complete Baha'i | 280 If t, show all the holidays that would appear in a complete Baha'i |
299 (defcustom calendar-mode-hook nil | 285 (defcustom calendar-mode-hook nil |
300 "Hook run when entering `calendar-mode'." | 286 "Hook run when entering `calendar-mode'." |
301 :type 'hook | 287 :type 'hook |
302 :group 'calendar-hooks) | 288 :group 'calendar-hooks) |
303 | 289 |
304 ;;;###autoload | |
305 (defcustom calendar-load-hook nil | 290 (defcustom calendar-load-hook nil |
306 "List of functions to be called after the calendar is first loaded. | 291 "List of functions to be called after the calendar is first loaded. |
307 This is the place to add key bindings to `calendar-mode-map'." | 292 This is the place to add key bindings to `calendar-mode-map'." |
308 :type 'hook | 293 :type 'hook |
309 :group 'calendar-hooks) | 294 :group 'calendar-hooks) |
310 | 295 |
311 ;;;###autoload | |
312 (defcustom initial-calendar-window-hook nil | 296 (defcustom initial-calendar-window-hook nil |
313 "List of functions to be called when the calendar window is first opened. | 297 "List of functions to be called when the calendar window is first opened. |
314 The functions invoked are called after the calendar window is opened, but | 298 The functions invoked are called after the calendar window is opened, but |
315 once opened is never called again. Leaving the calendar with the `q' command | 299 once opened is never called again. Leaving the calendar with the `q' command |
316 and reentering it will cause these functions to be called again." | 300 and reentering it will cause these functions to be called again." |
317 :type 'hook | 301 :type 'hook |
318 :group 'calendar-hooks) | 302 :group 'calendar-hooks) |
319 | 303 |
320 ;;;###autoload | |
321 (defcustom today-visible-calendar-hook nil | 304 (defcustom today-visible-calendar-hook nil |
322 "List of functions called whenever the current date is visible. | 305 "List of functions called whenever the current date is visible. |
323 This can be used, for example, to replace today's date with asterisks; a | 306 This can be used, for example, to replace today's date with asterisks; a |
324 function `calendar-star-date' is included for this purpose: | 307 function `calendar-star-date' is included for this purpose: |
325 (setq today-visible-calendar-hook 'calendar-star-date) | 308 (setq today-visible-calendar-hook 'calendar-star-date) |
335 characters in the calendar buffer by the hooks may cause the failure of the | 318 characters in the calendar buffer by the hooks may cause the failure of the |
336 functions that move by days and weeks." | 319 functions that move by days and weeks." |
337 :type 'hook | 320 :type 'hook |
338 :group 'calendar-hooks) | 321 :group 'calendar-hooks) |
339 | 322 |
340 ;;;###autoload | |
341 (defcustom today-invisible-calendar-hook nil | 323 (defcustom today-invisible-calendar-hook nil |
342 "List of functions called whenever the current date is not visible. | 324 "List of functions called whenever the current date is not visible. |
343 | 325 |
344 The corresponding variable `today-visible-calendar-hook' is the list of | 326 The corresponding variable `today-visible-calendar-hook' is the list of |
345 functions called when the calendar function was called when the current | 327 functions called when the calendar function was called when the current |
349 characters in the calendar buffer by the hooks may cause the failure of the | 331 characters in the calendar buffer by the hooks may cause the failure of the |
350 functions that move by days and weeks." | 332 functions that move by days and weeks." |
351 :type 'hook | 333 :type 'hook |
352 :group 'calendar-hooks) | 334 :group 'calendar-hooks) |
353 | 335 |
354 ;;;###autoload | |
355 (defcustom calendar-move-hook nil | 336 (defcustom calendar-move-hook nil |
356 "List of functions called whenever the cursor moves in the calendar. | 337 "List of functions called whenever the cursor moves in the calendar. |
357 | 338 |
358 For example, | 339 For example, |
359 | 340 |
469 Diary files can contain directives to include the contents of other files; for | 450 Diary files can contain directives to include the contents of other files; for |
470 details, see the documentation for the variable `list-diary-entries-hook'." | 451 details, see the documentation for the variable `list-diary-entries-hook'." |
471 :type 'file | 452 :type 'file |
472 :group 'diary) | 453 :group 'diary) |
473 | 454 |
474 ;;;###autoload | |
475 (defcustom diary-nonmarking-symbol "&" | 455 (defcustom diary-nonmarking-symbol "&" |
476 "Symbol indicating that a diary entry is not to be marked in the calendar." | 456 "Symbol indicating that a diary entry is not to be marked in the calendar." |
477 :type 'string | 457 :type 'string |
478 :group 'diary) | 458 :group 'diary) |
479 | 459 |
480 ;;;###autoload | |
481 (defcustom hebrew-diary-entry-symbol "H" | 460 (defcustom hebrew-diary-entry-symbol "H" |
482 "Symbol indicating a diary entry according to the Hebrew calendar." | 461 "Symbol indicating a diary entry according to the Hebrew calendar." |
483 :type 'string | 462 :type 'string |
484 :group 'diary) | 463 :group 'diary) |
485 | 464 |
486 ;;;###autoload | |
487 (defcustom islamic-diary-entry-symbol "I" | 465 (defcustom islamic-diary-entry-symbol "I" |
488 "Symbol indicating a diary entry according to the Islamic calendar." | 466 "Symbol indicating a diary entry according to the Islamic calendar." |
489 :type 'string | 467 :type 'string |
490 :group 'diary) | 468 :group 'diary) |
491 | 469 |
492 ;;;###autoload | |
493 (defcustom bahai-diary-entry-symbol "B" | 470 (defcustom bahai-diary-entry-symbol "B" |
494 "Symbol indicating a diary entry according to the Baha'i calendar." | 471 "Symbol indicating a diary entry according to the Baha'i calendar." |
495 :type 'string | 472 :type 'string |
496 :group 'diary) | 473 :group 'diary) |
497 | 474 |
498 ;;;###autoload | |
499 (defcustom diary-include-string "#include" | 475 (defcustom diary-include-string "#include" |
500 "The string indicating inclusion of another file of diary entries. | 476 "The string indicating inclusion of another file of diary entries. |
501 See the documentation for the function `include-other-diary-files'." | 477 See the documentation for the function `include-other-diary-files'." |
502 :type 'string | 478 :type 'string |
503 :group 'diary) | 479 :group 'diary) |
504 | 480 |
505 (defcustom diary-glob-file-regexp-prefix "^\\#" | 481 (defcustom diary-glob-file-regexp-prefix "^\\#" |
506 "The regular expression that gets pre-pended to each of the attribute-regexp's for file-wide specifiers." | 482 "Regular expression prepended to attribute-regexps for file-wide specifiers." |
507 :type 'regexp | 483 :type 'regexp |
508 :group 'diary) | 484 :group 'diary) |
509 | 485 |
510 (defcustom diary-face-attrs | 486 (defcustom diary-face-attrs |
511 '((" *\\[foreground:\\([-a-z]+\\)\\]$" 1 :foreground string) | 487 '((" *\\[foreground:\\([-a-z]+\\)\\]$" 1 :foreground string) |
535 (defcustom diary-file-name-prefix nil | 511 (defcustom diary-file-name-prefix nil |
536 "If non-nil each diary entry is prefixed with the name of the file where it is defined." | 512 "If non-nil each diary entry is prefixed with the name of the file where it is defined." |
537 :type 'boolean | 513 :type 'boolean |
538 :group 'diary) | 514 :group 'diary) |
539 | 515 |
540 ;;;###autoload | |
541 (defcustom sexp-diary-entry-symbol "%%" | 516 (defcustom sexp-diary-entry-symbol "%%" |
542 "The string used to indicate a sexp diary entry in `diary-file'. | 517 "The string used to indicate a sexp diary entry in `diary-file'. |
543 See the documentation for the function `list-sexp-diary-entries'." | 518 See the documentation for the function `list-sexp-diary-entries'." |
544 :type 'string | 519 :type 'string |
545 :group 'diary) | 520 :group 'diary) |
546 | 521 |
547 ;;;###autoload | |
548 (defcustom abbreviated-calendar-year t | 522 (defcustom abbreviated-calendar-year t |
549 "Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. | 523 "Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. |
550 For the Gregorian calendar; similarly for the Hebrew, Islamic and | 524 For the Gregorian calendar; similarly for the Hebrew, Islamic and |
551 Baha'i calendars. If this variable is nil, years must be written in | 525 Baha'i calendars. If this variable is nil, years must be written in |
552 full." | 526 full." |
582 (if value | 556 (if value |
583 (european-calendar) | 557 (european-calendar) |
584 (american-calendar))) | 558 (american-calendar))) |
585 :group 'diary) | 559 :group 'diary) |
586 | 560 |
587 ;;;###autoload | |
588 (defcustom american-date-diary-pattern | 561 (defcustom american-date-diary-pattern |
589 '((month "/" day "[^/0-9]") | 562 '((month "/" day "[^/0-9]") |
590 (month "/" day "/" year "[^0-9]") | 563 (month "/" day "/" year "[^0-9]") |
591 (monthname " *" day "[^,0-9]") | 564 (monthname " *" day "[^,0-9]") |
592 (monthname " *" day ", *" year "[^0-9]") | 565 (monthname " *" day ", *" year "[^0-9]") |
602 (repeat (list :inline t :format "%v" | 575 (repeat (list :inline t :format "%v" |
603 (symbol :tag "Keyword") | 576 (symbol :tag "Keyword") |
604 (choice symbol regexp))))) | 577 (choice symbol regexp))))) |
605 :group 'diary) | 578 :group 'diary) |
606 | 579 |
607 ;;;###autoload | |
608 (defcustom european-date-diary-pattern | 580 (defcustom european-date-diary-pattern |
609 '((day "/" month "[^/0-9]") | 581 '((day "/" month "[^/0-9]") |
610 (day "/" month "/" year "[^0-9]") | 582 (day "/" month "/" year "[^0-9]") |
611 (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)") | 583 (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)") |
612 (day " *" monthname " *" year "[^0-9]") | 584 (day " *" monthname " *" year "[^0-9]") |
674 ;; to pick up any newly recognized entries. | 646 ;; to pick up any newly recognized entries. |
675 (and (diary-live-p) | 647 (and (diary-live-p) |
676 (diary)))) | 648 (diary)))) |
677 :group 'diary) | 649 :group 'diary) |
678 | 650 |
679 ;;;###autoload | |
680 (defcustom european-calendar-display-form | 651 (defcustom european-calendar-display-form |
681 '((if dayname (concat dayname ", ")) day " " monthname " " year) | 652 '((if dayname (concat dayname ", ")) day " " monthname " " year) |
682 "Pseudo-pattern governing the way a date appears in the European style. | 653 "Pseudo-pattern governing the way a date appears in the European style. |
683 See the documentation of `calendar-date-display-form' for an explanation." | 654 See the documentation of `calendar-date-display-form' for an explanation." |
684 :type 'sexp | 655 :type 'sexp |
685 :group 'calendar) | 656 :group 'calendar) |
686 | 657 |
687 ;;;###autoload | |
688 (defcustom american-calendar-display-form | 658 (defcustom american-calendar-display-form |
689 '((if dayname (concat dayname ", ")) monthname " " day ", " year) | 659 '((if dayname (concat dayname ", ")) monthname " " day ", " year) |
690 "Pseudo-pattern governing the way a date appears in the American style. | 660 "Pseudo-pattern governing the way a date appears in the American style. |
691 See the documentation of `calendar-date-display-form' for an explanation." | 661 See the documentation of `calendar-date-display-form' for an explanation." |
692 :type 'sexp | 662 :type 'sexp |
733 (setq european-calendar-style nil) | 703 (setq european-calendar-style nil) |
734 (setq calendar-date-display-form american-calendar-display-form) | 704 (setq calendar-date-display-form american-calendar-display-form) |
735 (setq diary-date-forms american-date-diary-pattern) | 705 (setq diary-date-forms american-date-diary-pattern) |
736 (update-calendar-mode-line)) | 706 (update-calendar-mode-line)) |
737 | 707 |
738 ;;;###autoload | |
739 (defcustom print-diary-entries-hook 'lpr-buffer | 708 (defcustom print-diary-entries-hook 'lpr-buffer |
740 "List of functions called after a temporary diary buffer is prepared. | 709 "List of functions called after a temporary diary buffer is prepared. |
741 The buffer shows only the diary entries currently visible in the diary | 710 The buffer shows only the diary entries currently visible in the diary |
742 buffer. The default just does the printing. Other uses might include, for | 711 buffer. The default just does the printing. Other uses might include, for |
743 example, rearranging the lines into order by day and time, saving the buffer | 712 example, rearranging the lines into order by day and time, saving the buffer |
744 instead of deleting it, or changing the function used to do the printing." | 713 instead of deleting it, or changing the function used to do the printing." |
745 :type 'hook | 714 :type 'hook |
746 :group 'diary) | 715 :group 'diary) |
747 | 716 |
748 ;;;###autoload | |
749 (defcustom list-diary-entries-hook nil | 717 (defcustom list-diary-entries-hook nil |
750 "List of functions called after diary file is culled for relevant entries. | 718 "List of functions called after diary file is culled for relevant entries. |
751 It is to be used for diary entries that are not found in the diary file. | 719 It is to be used for diary entries that are not found in the diary file. |
752 | 720 |
753 A function `include-other-diary-files' is provided for use as the value of | 721 A function `include-other-diary-files' is provided for use as the value of |
774 lexicographic order." | 742 lexicographic order." |
775 :type 'hook | 743 :type 'hook |
776 :options '(include-other-diary-files sort-diary-entries) | 744 :options '(include-other-diary-files sort-diary-entries) |
777 :group 'diary) | 745 :group 'diary) |
778 | 746 |
779 ;;;###autoload | |
780 (defcustom diary-hook nil | 747 (defcustom diary-hook nil |
781 "List of functions called after the display of the diary. | 748 "List of functions called after the display of the diary. |
782 Can be used for appointment notification." | 749 Can be used for appointment notification." |
783 :type 'hook | 750 :type 'hook |
784 :group 'diary) | 751 :group 'diary) |
785 | 752 |
786 (autoload 'diary-set-maybe-redraw "diary-lib") | 753 (autoload 'diary-set-maybe-redraw "diary-lib") |
787 | 754 |
788 ;;;###autoload | |
789 (defcustom diary-display-hook nil | 755 (defcustom diary-display-hook nil |
790 "List of functions that handle the display of the diary. | 756 "List of functions that handle the display of the diary. |
791 If nil (the default), `simple-diary-display' is used. Use `ignore' for no | 757 If nil (the default), `simple-diary-display' is used. Use `ignore' for no |
792 diary display. | 758 diary display. |
793 | 759 |
811 :options '(fancy-diary-display) | 777 :options '(fancy-diary-display) |
812 :initialize 'custom-initialize-default | 778 :initialize 'custom-initialize-default |
813 :set 'diary-set-maybe-redraw | 779 :set 'diary-set-maybe-redraw |
814 :group 'diary) | 780 :group 'diary) |
815 | 781 |
816 ;;;###autoload | |
817 (defcustom nongregorian-diary-listing-hook nil | 782 (defcustom nongregorian-diary-listing-hook nil |
818 "List of functions called for listing diary file and included files. | 783 "List of functions called for listing diary file and included files. |
819 As the files are processed for diary entries, these functions are used | 784 As the files are processed for diary entries, these functions are used |
820 to cull relevant entries. You can use either or both of | 785 to cull relevant entries. You can use either or both of |
821 `list-hebrew-diary-entries', `list-islamic-diary-entries' and | 786 `list-hebrew-diary-entries', `list-islamic-diary-entries' and |
825 :options '(list-hebrew-diary-entries | 790 :options '(list-hebrew-diary-entries |
826 list-islamic-diary-entries | 791 list-islamic-diary-entries |
827 diary-bahai-list-entries) | 792 diary-bahai-list-entries) |
828 :group 'diary) | 793 :group 'diary) |
829 | 794 |
830 ;;;###autoload | |
831 (defcustom mark-diary-entries-hook nil | 795 (defcustom mark-diary-entries-hook nil |
832 "List of functions called after marking diary entries in the calendar. | 796 "List of functions called after marking diary entries in the calendar. |
833 | 797 |
834 A function `mark-included-diary-files' is also provided for use as the | 798 A function `mark-included-diary-files' is also provided for use as the |
835 `mark-diary-entries-hook'; it enables you to use shared diary files together | 799 `mark-diary-entries-hook'; it enables you to use shared diary files together |
843 function `include-other-diary-files' as part of `list-diary-entries-hook'." | 807 function `include-other-diary-files' as part of `list-diary-entries-hook'." |
844 :type 'hook | 808 :type 'hook |
845 :options '(mark-included-diary-files) | 809 :options '(mark-included-diary-files) |
846 :group 'diary) | 810 :group 'diary) |
847 | 811 |
848 ;;;###autoload | |
849 (defcustom nongregorian-diary-marking-hook nil | 812 (defcustom nongregorian-diary-marking-hook nil |
850 "List of functions called for marking diary file and included files. | 813 "List of functions called for marking diary file and included files. |
851 As the files are processed for diary entries, these functions are used | 814 As the files are processed for diary entries, these functions are used |
852 to cull relevant entries. You can use either or both of | 815 to cull relevant entries. You can use either or both of |
853 `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and | 816 `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and |
857 :options '(mark-hebrew-diary-entries | 820 :options '(mark-hebrew-diary-entries |
858 mark-islamic-diary-entries | 821 mark-islamic-diary-entries |
859 diary-bahai-mark-entries) | 822 diary-bahai-mark-entries) |
860 :group 'diary) | 823 :group 'diary) |
861 | 824 |
862 ;;;###autoload | |
863 (defcustom diary-list-include-blanks nil | 825 (defcustom diary-list-include-blanks nil |
864 "If nil, do not include days with no diary entry in the list of diary entries. | 826 "If nil, do not include days with no diary entry in the list of diary entries. |
865 Such days will then not be shown in the fancy diary buffer, even if they | 827 Such days will then not be shown in the fancy diary buffer, even if they |
866 are holidays." | 828 are holidays." |
867 :type 'boolean | 829 :type 'boolean |
868 :group 'diary) | 830 :group 'diary) |
869 | 831 |
870 ;;;###autoload | |
871 (defcustom holidays-in-diary-buffer t | 832 (defcustom holidays-in-diary-buffer t |
872 "Non-nil means include holidays in the diary display. | 833 "Non-nil means include holidays in the diary display. |
873 The holidays appear in the mode line of the diary buffer, or in the | 834 The holidays appear in the mode line of the diary buffer, or in the |
874 fancy diary buffer next to the date. This slows down the diary functions | 835 fancy diary buffer next to the date. This slows down the diary functions |
875 somewhat; setting it to nil makes the diary display faster." | 836 somewhat; setting it to nil makes the diary display faster." |
878 | 839 |
879 (defvar calendar-mark-ring nil) | 840 (defvar calendar-mark-ring nil) |
880 | 841 |
881 ;;;###autoload | 842 ;;;###autoload |
882 (put 'general-holidays 'risky-local-variable t) | 843 (put 'general-holidays 'risky-local-variable t) |
883 ;;;###autoload | |
884 (defcustom general-holidays | 844 (defcustom general-holidays |
885 '((holiday-fixed 1 1 "New Year's Day") | 845 '((holiday-fixed 1 1 "New Year's Day") |
886 (holiday-float 1 1 3 "Martin Luther King Day") | 846 (holiday-float 1 1 3 "Martin Luther King Day") |
887 (holiday-fixed 2 2 "Groundhog Day") | 847 (holiday-fixed 2 2 "Groundhog Day") |
888 (holiday-fixed 2 14 "Valentine's Day") | 848 (holiday-fixed 2 14 "Valentine's Day") |
904 :type 'sexp | 864 :type 'sexp |
905 :group 'holidays) | 865 :group 'holidays) |
906 | 866 |
907 ;;;###autoload | 867 ;;;###autoload |
908 (put 'oriental-holidays 'risky-local-variable t) | 868 (put 'oriental-holidays 'risky-local-variable t) |
909 ;;;###autoload | |
910 (defcustom oriental-holidays | 869 (defcustom oriental-holidays |
911 '((if (fboundp 'atan) | 870 '((if (fboundp 'atan) |
912 (holiday-chinese-new-year))) | 871 (holiday-chinese-new-year))) |
913 "Oriental holidays. | 872 "Oriental holidays. |
914 See the documentation for `calendar-holidays' for details." | 873 See the documentation for `calendar-holidays' for details." |
915 :type 'sexp | 874 :type 'sexp |
916 :group 'holidays) | 875 :group 'holidays) |
917 | 876 |
918 ;;;###autoload | 877 ;;;###autoload |
919 (put 'local-holidays 'risky-local-variable t) | 878 (put 'local-holidays 'risky-local-variable t) |
920 ;;;###autoload | |
921 (defcustom local-holidays nil | 879 (defcustom local-holidays nil |
922 "Local holidays. | 880 "Local holidays. |
923 See the documentation for `calendar-holidays' for details." | 881 See the documentation for `calendar-holidays' for details." |
924 :type 'sexp | 882 :type 'sexp |
925 :group 'holidays) | 883 :group 'holidays) |
926 | 884 |
927 ;;;###autoload | 885 ;;;###autoload |
928 (put 'other-holidays 'risky-local-variable t) | 886 (put 'other-holidays 'risky-local-variable t) |
929 ;;;###autoload | |
930 (defcustom other-holidays nil | 887 (defcustom other-holidays nil |
931 "User defined holidays. | 888 "User defined holidays. |
932 See the documentation for `calendar-holidays' for details." | 889 See the documentation for `calendar-holidays' for details." |
933 :type 'sexp | 890 :type 'sexp |
934 :group 'holidays) | 891 :group 'holidays) |
935 | 892 |
936 ;;;###autoload | 893 ;;;###autoload |
937 (put 'hebrew-holidays-1 'risky-local-variable t) | 894 (put 'hebrew-holidays-1 'risky-local-variable t) |
938 ;;;###autoload | |
939 (defvar hebrew-holidays-1 | 895 (defvar hebrew-holidays-1 |
940 '((holiday-rosh-hashanah-etc) | 896 '((holiday-rosh-hashanah-etc) |
941 (if all-hebrew-calendar-holidays | 897 (if all-hebrew-calendar-holidays |
942 (holiday-julian | 898 (holiday-julian |
943 11 | 899 11 |
953 22 | 909 22 |
954 21))) "\"Tal Umatar\" (evening)")))) | 910 21))) "\"Tal Umatar\" (evening)")))) |
955 | 911 |
956 ;;;###autoload | 912 ;;;###autoload |
957 (put 'hebrew-holidays-2 'risky-local-variable t) | 913 (put 'hebrew-holidays-2 'risky-local-variable t) |
958 ;;;###autoload | |
959 (defvar hebrew-holidays-2 | 914 (defvar hebrew-holidays-2 |
960 '((if all-hebrew-calendar-holidays | 915 '((if all-hebrew-calendar-holidays |
961 (holiday-hanukkah) | 916 (holiday-hanukkah) |
962 (holiday-hebrew 9 25 "Hanukkah")) | 917 (holiday-hebrew 9 25 "Hanukkah")) |
963 (if all-hebrew-calendar-holidays | 918 (if all-hebrew-calendar-holidays |
975 (if all-hebrew-calendar-holidays | 930 (if all-hebrew-calendar-holidays |
976 (holiday-hebrew 11 15 "Tu B'Shevat")))) | 931 (holiday-hebrew 11 15 "Tu B'Shevat")))) |
977 | 932 |
978 ;;;###autoload | 933 ;;;###autoload |
979 (put 'hebrew-holidays-3 'risky-local-variable t) | 934 (put 'hebrew-holidays-3 'risky-local-variable t) |
980 ;;;###autoload | |
981 (defvar hebrew-holidays-3 | 935 (defvar hebrew-holidays-3 |
982 '((if all-hebrew-calendar-holidays | 936 '((if all-hebrew-calendar-holidays |
983 (holiday-hebrew | 937 (holiday-hebrew |
984 11 | 938 11 |
985 (let ((m displayed-month) | 939 (let ((m displayed-month) |
1008 day)) | 962 day)) |
1009 "Shabbat Shirah")))) | 963 "Shabbat Shirah")))) |
1010 | 964 |
1011 ;;;###autoload | 965 ;;;###autoload |
1012 (put 'hebrew-holidays-4 'risky-local-variable t) | 966 (put 'hebrew-holidays-4 'risky-local-variable t) |
1013 ;;;###autoload | |
1014 (defvar hebrew-holidays-4 | 967 (defvar hebrew-holidays-4 |
1015 '((holiday-passover-etc) | 968 '((holiday-passover-etc) |
1016 (if (and all-hebrew-calendar-holidays | 969 (if (and all-hebrew-calendar-holidays |
1017 (let* ((m displayed-month) | 970 (let* ((m displayed-month) |
1018 (y displayed-year) | 971 (y displayed-year) |
1027 (if all-hebrew-calendar-holidays | 980 (if all-hebrew-calendar-holidays |
1028 (holiday-tisha-b-av-etc)))) | 981 (holiday-tisha-b-av-etc)))) |
1029 | 982 |
1030 ;;;###autoload | 983 ;;;###autoload |
1031 (put 'hebrew-holidays 'risky-local-variable t) | 984 (put 'hebrew-holidays 'risky-local-variable t) |
1032 ;;;###autoload | |
1033 (defcustom hebrew-holidays (append hebrew-holidays-1 hebrew-holidays-2 | 985 (defcustom hebrew-holidays (append hebrew-holidays-1 hebrew-holidays-2 |
1034 hebrew-holidays-3 hebrew-holidays-4) | 986 hebrew-holidays-3 hebrew-holidays-4) |
1035 "Jewish holidays. | 987 "Jewish holidays. |
1036 See the documentation for `calendar-holidays' for details." | 988 See the documentation for `calendar-holidays' for details." |
1037 :type 'sexp | 989 :type 'sexp |
1038 :group 'holidays) | 990 :group 'holidays) |
1039 | 991 |
1040 ;;;###autoload | 992 ;;;###autoload |
1041 (put 'christian-holidays 'risky-local-variable t) | 993 (put 'christian-holidays 'risky-local-variable t) |
1042 ;;;###autoload | |
1043 (defcustom christian-holidays | 994 (defcustom christian-holidays |
1044 '((if all-christian-calendar-holidays | 995 '((if all-christian-calendar-holidays |
1045 (holiday-fixed 1 6 "Epiphany")) | 996 (holiday-fixed 1 6 "Epiphany")) |
1046 (holiday-easter-etc 0 "Easter Sunday") | 997 (holiday-easter-etc 0 "Easter Sunday") |
1047 (holiday-easter-etc -2 "Good Friday") | 998 (holiday-easter-etc -2 "Good Friday") |
1088 :type 'sexp | 1039 :type 'sexp |
1089 :group 'holidays) | 1040 :group 'holidays) |
1090 | 1041 |
1091 ;;;###autoload | 1042 ;;;###autoload |
1092 (put 'islamic-holidays 'risky-local-variable t) | 1043 (put 'islamic-holidays 'risky-local-variable t) |
1093 ;;;###autoload | |
1094 (defcustom islamic-holidays | 1044 (defcustom islamic-holidays |
1095 '((holiday-islamic | 1045 '((holiday-islamic |
1096 1 1 | 1046 1 1 |
1097 (format "Islamic New Year %d" | 1047 (format "Islamic New Year %d" |
1098 (let ((m displayed-month) | 1048 (let ((m displayed-month) |
1123 :type 'sexp | 1073 :type 'sexp |
1124 :group 'holidays) | 1074 :group 'holidays) |
1125 | 1075 |
1126 ;;;###autoload | 1076 ;;;###autoload |
1127 (put 'bahai-holidays 'risky-local-variable t) | 1077 (put 'bahai-holidays 'risky-local-variable t) |
1128 ;;;###autoload | |
1129 (defcustom bahai-holidays | 1078 (defcustom bahai-holidays |
1130 '((holiday-fixed | 1079 '((holiday-fixed |
1131 3 21 | 1080 3 21 |
1132 (format "Baha'i New Year (Naw-Ruz) %d" (- displayed-year (1- 1844)))) | 1081 (format "Baha'i New Year (Naw-Ruz) %d" (- displayed-year (1- 1844)))) |
1133 (holiday-fixed 4 21 "First Day of Ridvan") | 1082 (holiday-fixed 4 21 "First Day of Ridvan") |
1165 :type 'sexp | 1114 :type 'sexp |
1166 :group 'holidays) | 1115 :group 'holidays) |
1167 | 1116 |
1168 ;;;###autoload | 1117 ;;;###autoload |
1169 (put 'solar-holidays 'risky-local-variable t) | 1118 (put 'solar-holidays 'risky-local-variable t) |
1170 ;;;###autoload | |
1171 (defcustom solar-holidays | 1119 (defcustom solar-holidays |
1172 '((if (fboundp 'atan) | 1120 '((if (fboundp 'atan) |
1173 (solar-equinoxes-solstices)) | 1121 (solar-equinoxes-solstices)) |
1174 (if (progn | 1122 (if (progn |
1175 (require 'cal-dst) | 1123 (require 'cal-dst) |
1573 "Start calendar and display it in a dedicated frame together with the diary.") | 1521 "Start calendar and display it in a dedicated frame together with the diary.") |
1574 | 1522 |
1575 (autoload 'calendar-two-frame-setup "cal-x" | 1523 (autoload 'calendar-two-frame-setup "cal-x" |
1576 "Start calendar and diary in separate, dedicated frames.") | 1524 "Start calendar and diary in separate, dedicated frames.") |
1577 | 1525 |
1578 ;;;###autoload | |
1579 (defcustom calendar-setup nil | 1526 (defcustom calendar-setup nil |
1580 "The frame setup of the calendar. | 1527 "The frame setup of the calendar. |
1581 The choices are: `one-frame' (calendar and diary together in one separate, | 1528 The choices are: `one-frame' (calendar and diary together in one separate, |
1582 dedicated frame); `two-frames' (calendar and diary in separate, dedicated | 1529 dedicated frame); `two-frames' (calendar and diary in separate, dedicated |
1583 frames); `calendar-only' (calendar in a separate, dedicated frame); with | 1530 frames); `calendar-only' (calendar in a separate, dedicated frame); with |
1593 (defcustom calendar-minimum-window-height 8 | 1540 (defcustom calendar-minimum-window-height 8 |
1594 "Minimum height `generate-calendar-window' should use for calendar window." | 1541 "Minimum height `generate-calendar-window' should use for calendar window." |
1595 :type 'integer | 1542 :type 'integer |
1596 :version "22.1" | 1543 :version "22.1" |
1597 :group 'calendar) | 1544 :group 'calendar) |
1545 | |
1546 (defcustom calendar-week-start-day 0 | |
1547 "The day of the week on which a week in the calendar begins. | |
1548 0 means Sunday (default), 1 means Monday, and so on. | |
1549 | |
1550 If you change this variable directly (without using customize) | |
1551 after starting `calendar', you should call `redraw-calendar' to | |
1552 update the calendar display to reflect the change, otherwise | |
1553 movement commands will not work correctly." | |
1554 :type 'integer | |
1555 ;; Change the initialize so that if you reload calendar.el, it will not | |
1556 ;; cause a redraw (which may fail, e.g. with "invalid byte-code in | |
1557 ;; calendar.elc" because of the "byte-compile-dynamic"). | |
1558 :initialize 'custom-initialize-default | |
1559 :set (lambda (sym val) | |
1560 (set sym val) | |
1561 (redraw-calendar)) | |
1562 :group 'calendar) | |
1563 | |
1564 (defcustom calendar-debug-sexp nil | |
1565 "Turn debugging on when evaluating a sexp in the diary or holiday list." | |
1566 :type 'boolean | |
1567 :group 'calendar) | |
1568 | |
1598 | 1569 |
1599 ;;;###autoload | 1570 ;;;###autoload |
1600 (defun calendar (&optional arg) | 1571 (defun calendar (&optional arg) |
1601 "Choose between the one frame, two frame, or basic calendar displays. | 1572 "Choose between the one frame, two frame, or basic calendar displays. |
1602 If called with an optional prefix argument, prompts for month and year. | 1573 If called with an optional prefix argument, prompts for month and year. |
2186 (if (get-buffer calendar-buffer) | 2157 (if (get-buffer calendar-buffer) |
2187 (with-current-buffer calendar-buffer | 2158 (with-current-buffer calendar-buffer |
2188 (let ((cursor-date (calendar-cursor-to-nearest-date))) | 2159 (let ((cursor-date (calendar-cursor-to-nearest-date))) |
2189 (generate-calendar-window displayed-month displayed-year) | 2160 (generate-calendar-window displayed-month displayed-year) |
2190 (calendar-cursor-to-visible-date cursor-date))))) | 2161 (calendar-cursor-to-visible-date cursor-date))))) |
2191 | |
2192 ;;;###autoload | |
2193 (defcustom calendar-week-start-day 0 | |
2194 "The day of the week on which a week in the calendar begins. | |
2195 0 means Sunday (default), 1 means Monday, and so on. | |
2196 | |
2197 If you change this variable directly (without using customize) | |
2198 after starting `calendar', you should call `redraw-calendar' to | |
2199 update the calendar display to reflect the change, otherwise | |
2200 movement commands will not work correctly." | |
2201 :type 'integer | |
2202 ;; Change the initialize so that if you reload calendar.el, it will not | |
2203 ;; cause a redraw (which may fail, e.g. with "invalid byte-code in | |
2204 ;; calendar.elc" because of the "byte-compile-dynamic"). | |
2205 :initialize 'custom-initialize-default | |
2206 :set (lambda (sym val) | |
2207 (set sym val) | |
2208 (redraw-calendar)) | |
2209 :group 'calendar) | |
2210 | |
2211 (defcustom calendar-debug-sexp nil | |
2212 "Turn debugging on when evaluating a sexp in the diary or holiday list." | |
2213 :type 'boolean | |
2214 :group 'calendar) | |
2215 | 2162 |
2216 (require 'cal-menu) | 2163 (require 'cal-menu) |
2217 | 2164 |
2218 (defvar calendar-mode-map | 2165 (defvar calendar-mode-map |
2219 (let ((map (make-keymap))) | 2166 (let ((map (make-keymap))) |
2443 (interactive "e") | 2390 (interactive "e") |
2444 (save-selected-window | 2391 (save-selected-window |
2445 (select-window (posn-window (event-start event))) | 2392 (select-window (posn-window (event-start event))) |
2446 (call-interactively 'calendar-other-month))) | 2393 (call-interactively 'calendar-other-month))) |
2447 | 2394 |
2448 ;; (require 'info) will define these. | |
2449 (declare-function Info-find-emacs-command-nodes "info" (command)) | |
2450 (declare-function Info-find-node "info" | |
2451 (filename nodename &optional no-going-back)) | |
2452 | |
2453 (defun calendar-goto-info-node () | 2395 (defun calendar-goto-info-node () |
2454 "Go to the info node for the calendar." | 2396 "Go to the info node for the calendar." |
2455 (interactive) | 2397 (interactive) |
2456 (require 'info) | 2398 (info "(emacs)Calendar/Diary")) |
2457 (let ((where (save-window-excursion | |
2458 (Info-find-emacs-command-nodes 'calendar)))) | |
2459 (if (not where) | |
2460 (error "Couldn't find documentation for the calendar") | |
2461 (let (same-window-buffer-names) | |
2462 (info)) | |
2463 (Info-find-node (car (car where)) (car (cdr (car where))))))) | |
2464 | |
2465 | |
2466 | 2399 |
2467 (defun calendar-mode () | 2400 (defun calendar-mode () |
2468 "A major mode for the calendar window. | 2401 "A major mode for the calendar window. |
2469 | 2402 |
2470 For a complete description, type \ | 2403 For a complete description, type \ |
3173 | 3106 |
3174 (defun calendar-mod (m n) | 3107 (defun calendar-mod (m n) |
3175 "Non-negative remainder of M/N with N instead of 0." | 3108 "Non-negative remainder of M/N with N instead of 0." |
3176 (1+ (mod (1- m) n))) | 3109 (1+ (mod (1- m) n))) |
3177 | 3110 |
3111 | |
3112 (defun calendar-version () | |
3113 (interactive) | |
3114 (message "GNU Emacs %s" emacs-version)) | |
3115 | |
3116 (make-obsolete 'calendar-version 'emacs-version "23.1") | |
3117 | |
3118 | |
3178 (run-hooks 'calendar-load-hook) | 3119 (run-hooks 'calendar-load-hook) |
3179 | 3120 |
3180 (provide 'calendar) | 3121 (provide 'calendar) |
3181 | 3122 |
3182 ;; Local variables: | 3123 ;; Local variables: |