diff options
| author | Glenn Morris | 2008-03-08 03:47:03 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-08 03:47:03 +0000 |
| commit | f62611de75ae2ff1e76c9c29ea0df8f2973cc980 (patch) | |
| tree | a201d49d3461fdceb4d3c3bb534982dcd9628ba6 | |
| parent | 0f1e40b67761c169cfd26ef2793e411f18741650 (diff) | |
| download | emacs-f62611de75ae2ff1e76c9c29ea0df8f2973cc980.tar.gz emacs-f62611de75ae2ff1e76c9c29ea0df8f2973cc980.zip | |
Move many autoloads to separate file, cal-loaddefs.el.
Move defcustoms to start and re-order.
(calendar-month-name-array, calendar-starred-day): No need to declare
for compiler.
(cal-loaddefs): Require it.
(appt, chinese-calendar, calendar-tex): Move custom groups to the
appropriate file.
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker):
Reverse logic.
(diary-face, diary-file-name-prefix-function, diary-include-string)
(diary-glob-file-regexp-prefix, diary-face-attrs)
(diary-file-name-prefix, sexp-diary-entry-symbol)
(print-diary-entries-hook, list-diary-entries-hook)
(nongregorian-diary-listing-hook, mark-diary-entries-hook)
(nongregorian-diary-marking-hook, diary-list-include-blanks):
Move to diary-lib.
(all-christian-calendar-holidays, all-islamic-calendar-holidays)
(all-bahai-calendar-holidays): Doc fix.
(calendar-mark-ring): Add doc-string.
(calendar-starred-day): Defvar it.
(calendar-mode): Make calendar-starred-day local.
(calendar-star-date): No need to make calendar-starred-day local.
| -rw-r--r-- | lisp/calendar/calendar.el | 897 |
1 files changed, 180 insertions, 717 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 453eefcaaf0..9096d0988e1 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -95,19 +95,22 @@ | |||
| 95 | 95 | ||
| 96 | (defvar displayed-month) | 96 | (defvar displayed-month) |
| 97 | (defvar displayed-year) | 97 | (defvar displayed-year) |
| 98 | (defvar calendar-month-name-array) | 98 | |
| 99 | (defvar calendar-starred-day) | 99 | (require 'cal-loaddefs) |
| 100 | (require 'cal-menu) | ||
| 101 | |||
| 100 | 102 | ||
| 101 | (defgroup calendar nil | 103 | (defgroup calendar nil |
| 102 | "Calendar and time management support." | 104 | "Calendar and time management support." |
| 103 | :group 'applications) | 105 | :group 'applications) |
| 104 | 106 | ||
| 105 | (defgroup diary nil | 107 | (defgroup calendar-hooks nil |
| 106 | "Emacs diary." | 108 | "Calendar hooks." |
| 109 | :prefix "calendar-" | ||
| 107 | :group 'calendar) | 110 | :group 'calendar) |
| 108 | 111 | ||
| 109 | (defgroup appt nil | 112 | (defgroup diary nil |
| 110 | "Appointment notification." | 113 | "Emacs diary." |
| 111 | :group 'calendar) | 114 | :group 'calendar) |
| 112 | 115 | ||
| 113 | (defgroup holidays nil | 116 | (defgroup holidays nil |
| @@ -116,30 +119,51 @@ | |||
| 116 | :prefix "calendar-" | 119 | :prefix "calendar-" |
| 117 | :group 'local) | 120 | :group 'local) |
| 118 | 121 | ||
| 119 | (defgroup chinese-calendar nil | ||
| 120 | "Chinese calendar support." | ||
| 121 | :group 'calendar) | ||
| 122 | 122 | ||
| 123 | (defgroup calendar-tex nil | 123 | (defcustom calendar-offset 0 |
| 124 | "Options for printing calendar with LaTeX." | 124 | "The offset of the principal month from the center of the calendar window. |
| 125 | :prefix "cal-tex-" | 125 | 0 means the principal month is in the center (default), -1 means on the left, |
| 126 | +1 means on the right. Larger (or smaller) values push the principal month off | ||
| 127 | the screen." | ||
| 128 | :type 'integer | ||
| 126 | :group 'calendar) | 129 | :group 'calendar) |
| 127 | 130 | ||
| 128 | (defgroup calendar-hooks nil | 131 | (defcustom calendar-setup nil |
| 129 | "Calendar hooks." | 132 | "The frame setup of the calendar. |
| 130 | :prefix "calendar-" | 133 | The choices are: `one-frame' (calendar and diary together in one separate, |
| 134 | dedicated frame); `two-frames' (calendar and diary in separate, dedicated | ||
| 135 | frames); `calendar-only' (calendar in a separate, dedicated frame); with | ||
| 136 | any other value the current frame is used. Using any of the first | ||
| 137 | three options overrides the value of `view-diary-entries-initially'." | ||
| 138 | :type '(choice | ||
| 139 | (const :tag "calendar and diary in separate frame" one-frame) | ||
| 140 | (const :tag "calendar and diary each in own frame" two-frames) | ||
| 141 | (const :tag "calendar in separate frame" calendar-only) | ||
| 142 | (const :tag "use current frame" nil)) | ||
| 131 | :group 'calendar) | 143 | :group 'calendar) |
| 132 | 144 | ||
| 145 | (defcustom calendar-minimum-window-height 8 | ||
| 146 | "Minimum height `generate-calendar-window' should use for calendar window." | ||
| 147 | :type 'integer | ||
| 148 | :version "22.1" | ||
| 149 | :group 'calendar) | ||
| 133 | 150 | ||
| 134 | (defconst calendar-buffer "*Calendar*" | 151 | (defcustom calendar-week-start-day 0 |
| 135 | "Name of the buffer used for the calendar.") | 152 | "The day of the week on which a week in the calendar begins. |
| 153 | 0 means Sunday (default), 1 means Monday, and so on. | ||
| 136 | 154 | ||
| 137 | (defcustom calendar-offset 0 | 155 | If you change this variable directly (without using customize) |
| 138 | "The offset of the principal month from the center of the calendar window. | 156 | after starting `calendar', you should call `redraw-calendar' to |
| 139 | 0 means the principal month is in the center (default), -1 means on the left, | 157 | update the calendar display to reflect the change, otherwise |
| 140 | +1 means on the right. Larger (or smaller) values push the principal month off | 158 | movement commands will not work correctly." |
| 141 | the screen." | ||
| 142 | :type 'integer | 159 | :type 'integer |
| 160 | ;; Change the initialize so that if you reload calendar.el, it will not | ||
| 161 | ;; cause a redraw (which may fail, e.g. with "invalid byte-code in | ||
| 162 | ;; calendar.elc" because of the "byte-compile-dynamic"). | ||
| 163 | :initialize 'custom-initialize-default | ||
| 164 | :set (lambda (sym val) | ||
| 165 | (set sym val) | ||
| 166 | (redraw-calendar)) | ||
| 143 | :group 'calendar) | 167 | :group 'calendar) |
| 144 | 168 | ||
| 145 | (defcustom view-diary-entries-initially nil | 169 | (defcustom view-diary-entries-initially nil |
| @@ -163,8 +187,13 @@ If nil, make an icon of the frame. If non-nil, delete the frame." | |||
| 163 | :type 'boolean | 187 | :type 'boolean |
| 164 | :group 'view) | 188 | :group 'view) |
| 165 | 189 | ||
| 166 | (defvar diary-face 'diary | 190 | (defface calendar-today |
| 167 | "Face name to use for diary entries.") | 191 | '((t (:underline t))) |
| 192 | "Face for indicating today's date." | ||
| 193 | :group 'diary) | ||
| 194 | ;; Backward-compatibility alias. FIXME make obsolete. | ||
| 195 | (put 'calendar-today-face 'face-alias 'calendar-today) | ||
| 196 | |||
| 168 | (defface diary | 197 | (defface diary |
| 169 | '((((min-colors 88) (class color) (background light)) | 198 | '((((min-colors 88) (class color) (background light)) |
| 170 | :foreground "red1") | 199 | :foreground "red1") |
| @@ -178,16 +207,9 @@ If nil, make an icon of the frame. If non-nil, delete the frame." | |||
| 178 | :weight bold)) | 207 | :weight bold)) |
| 179 | "Face for highlighting diary entries." | 208 | "Face for highlighting diary entries." |
| 180 | :group 'diary) | 209 | :group 'diary) |
| 181 | ;; backward-compatibility alias | 210 | ;; Backward-compatibility alias. FIXME make obsolete. |
| 182 | (put 'diary-face 'face-alias 'diary) | 211 | (put 'diary-face 'face-alias 'diary) |
| 183 | 212 | ||
| 184 | (defface calendar-today | ||
| 185 | '((t (:underline t))) | ||
| 186 | "Face for indicating today's date." | ||
| 187 | :group 'diary) | ||
| 188 | ;; backward-compatibility alias | ||
| 189 | (put 'calendar-today-face 'face-alias 'calendar-today) | ||
| 190 | |||
| 191 | (defface holiday | 213 | (defface holiday |
| 192 | '((((class color) (background light)) | 214 | '((((class color) (background light)) |
| 193 | :background "pink") | 215 | :background "pink") |
| @@ -197,22 +219,16 @@ If nil, make an icon of the frame. If non-nil, delete the frame." | |||
| 197 | :inverse-video t)) | 219 | :inverse-video t)) |
| 198 | "Face for indicating dates that have holidays." | 220 | "Face for indicating dates that have holidays." |
| 199 | :group 'diary) | 221 | :group 'diary) |
| 200 | ;; backward-compatibility alias | 222 | ;; Backward-compatibility alias. FIXME make obsolete. |
| 201 | (put 'holiday-face 'face-alias 'holiday) | 223 | (put 'holiday-face 'face-alias 'holiday) |
| 202 | 224 | ||
| 203 | (defcustom diary-entry-marker | 225 | (defcustom diary-entry-marker (if (display-color-p) 'diary "+") |
| 204 | (if (not (display-color-p)) | ||
| 205 | "+" | ||
| 206 | 'diary) | ||
| 207 | "How to mark dates that have diary entries. | 226 | "How to mark dates that have diary entries. |
| 208 | The value can be either a single-character string or a face." | 227 | The value can be either a single-character string or a face." |
| 209 | :type '(choice string face) | 228 | :type '(choice string face) |
| 210 | :group 'diary) | 229 | :group 'diary) |
| 211 | 230 | ||
| 212 | (defcustom calendar-today-marker | 231 | (defcustom calendar-today-marker (if (display-color-p) 'calendar-today "=") |
| 213 | (if (not (display-color-p)) | ||
| 214 | "=" | ||
| 215 | 'calendar-today) | ||
| 216 | "How to mark today's date in the calendar. | 232 | "How to mark today's date in the calendar. |
| 217 | The value can be either a single-character string or a face. | 233 | The value can be either a single-character string or a face. |
| 218 | Marking today's date is done only if you set up `today-visible-calendar-hook' | 234 | Marking today's date is done only if you set up `today-visible-calendar-hook' |
| @@ -220,10 +236,7 @@ to request that." | |||
| 220 | :type '(choice string face) | 236 | :type '(choice string face) |
| 221 | :group 'calendar) | 237 | :group 'calendar) |
| 222 | 238 | ||
| 223 | (defcustom calendar-holiday-marker | 239 | (defcustom calendar-holiday-marker (if (display-color-p) 'holiday "*") |
| 224 | (if (not (display-color-p)) | ||
| 225 | "*" | ||
| 226 | 'holiday) | ||
| 227 | "How to mark notable dates in the calendar. | 240 | "How to mark notable dates in the calendar. |
| 228 | The value can be either a single-character string or a face." | 241 | The value can be either a single-character string or a face." |
| 229 | :type '(choice string face) | 242 | :type '(choice string face) |
| @@ -242,46 +255,6 @@ The marking symbol is specified by the variable `calendar-holiday-marker'." | |||
| 242 | :type 'boolean | 255 | :type 'boolean |
| 243 | :group 'holidays) | 256 | :group 'holidays) |
| 244 | 257 | ||
| 245 | (defcustom all-hebrew-calendar-holidays nil | ||
| 246 | "If nil, show only major holidays from the Hebrew calendar. | ||
| 247 | This means only those Jewish holidays that appear on secular calendars. | ||
| 248 | |||
| 249 | If t, show all the holidays that would appear in a complete Hebrew calendar." | ||
| 250 | :type 'boolean | ||
| 251 | :group 'holidays) | ||
| 252 | |||
| 253 | (defcustom all-christian-calendar-holidays nil | ||
| 254 | "If nil, show only major holidays from the Christian calendar. | ||
| 255 | This means only those Christian holidays that appear on secular calendars. | ||
| 256 | |||
| 257 | If t, show all the holidays that would appear in a complete Christian | ||
| 258 | calendar." | ||
| 259 | :type 'boolean | ||
| 260 | :group 'holidays) | ||
| 261 | |||
| 262 | (defcustom all-islamic-calendar-holidays nil | ||
| 263 | "If nil, show only major holidays from the Islamic calendar. | ||
| 264 | This means only those Islamic holidays that appear on secular calendars. | ||
| 265 | |||
| 266 | If t, show all the holidays that would appear in a complete Islamic | ||
| 267 | calendar." | ||
| 268 | :type 'boolean | ||
| 269 | :group 'holidays) | ||
| 270 | |||
| 271 | (defcustom diary-file-name-prefix-function (function (lambda (str) str)) | ||
| 272 | "The function that will take a diary file name and return the desired prefix." | ||
| 273 | :type 'function | ||
| 274 | :group 'diary) | ||
| 275 | |||
| 276 | (defcustom all-bahai-calendar-holidays nil | ||
| 277 | "If nil, show only major holidays from the Baha'i calendar. | ||
| 278 | These are the days on which work and school must be suspended. | ||
| 279 | |||
| 280 | If t, show all the holidays that would appear in a complete Baha'i | ||
| 281 | calendar." | ||
| 282 | :type 'boolean | ||
| 283 | :group 'holidays) | ||
| 284 | |||
| 285 | (defcustom calendar-mode-hook nil | 258 | (defcustom calendar-mode-hook nil |
| 286 | "Hook run when entering `calendar-mode'." | 259 | "Hook run when entering `calendar-mode'." |
| 287 | :type 'hook | 260 | :type 'hook |
| @@ -472,53 +445,6 @@ details, see the documentation for the variable `list-diary-entries-hook'." | |||
| 472 | :type 'string | 445 | :type 'string |
| 473 | :group 'diary) | 446 | :group 'diary) |
| 474 | 447 | ||
| 475 | (defcustom diary-include-string "#include" | ||
| 476 | "The string indicating inclusion of another file of diary entries. | ||
| 477 | See the documentation for the function `include-other-diary-files'." | ||
| 478 | :type 'string | ||
| 479 | :group 'diary) | ||
| 480 | |||
| 481 | (defcustom diary-glob-file-regexp-prefix "^\\#" | ||
| 482 | "Regular expression prepended to attribute-regexps for file-wide specifiers." | ||
| 483 | :type 'regexp | ||
| 484 | :group 'diary) | ||
| 485 | |||
| 486 | (defcustom diary-face-attrs | ||
| 487 | '((" *\\[foreground:\\([-a-z]+\\)\\]$" 1 :foreground string) | ||
| 488 | (" *\\[background:\\([-a-z]+\\)\\]$" 1 :background string) | ||
| 489 | (" *\\[width:\\([-a-z]+\\)\\]$" 1 :width symbol) | ||
| 490 | (" *\\[height:\\([-0-9a-z]+\\)\\]$" 1 :height int) | ||
| 491 | (" *\\[weight:\\([-a-z]+\\)\\]$" 1 :weight symbol) | ||
| 492 | (" *\\[slant:\\([-a-z]+\\)\\]$" 1 :slant symbol) | ||
| 493 | (" *\\[underline:\\([-a-z]+\\)\\]$" 1 :underline stringtnil) | ||
| 494 | (" *\\[overline:\\([-a-z]+\\)\\]$" 1 :overline stringtnil) | ||
| 495 | (" *\\[strike-through:\\([-a-z]+\\)\\]$" 1 :strike-through stringtnil) | ||
| 496 | (" *\\[inverse-video:\\([-a-z]+\\)\\]$" 1 :inverse-video tnil) | ||
| 497 | (" *\\[face:\\([-0-9a-z]+\\)\\]$" 1 :face string) | ||
| 498 | (" *\\[font:\\([-a-z0-9]+\\)\\]$" 1 :font string) | ||
| 499 | ;; Unsupported. | ||
| 500 | ;;; (" *\\[box:\\([-a-z]+\\)\\]$" 1 :box) | ||
| 501 | ;;; (" *\\[stipple:\\([-a-z]+\\)\\]$" 1 :stipple) | ||
| 502 | ) | ||
| 503 | "A list of (regexp regnum attr attrtype) lists where the | ||
| 504 | regexp says how to find the tag, the regnum says which | ||
| 505 | parenthetical sub-regexp this regexp looks for, and the attr says | ||
| 506 | which attribute of the face (or that this _is_ a face) is being | ||
| 507 | modified." | ||
| 508 | :type 'sexp | ||
| 509 | :group 'diary) | ||
| 510 | |||
| 511 | (defcustom diary-file-name-prefix nil | ||
| 512 | "If non-nil each diary entry is prefixed with the name of the file where it is defined." | ||
| 513 | :type 'boolean | ||
| 514 | :group 'diary) | ||
| 515 | |||
| 516 | (defcustom sexp-diary-entry-symbol "%%" | ||
| 517 | "The string used to indicate a sexp diary entry in `diary-file'. | ||
| 518 | See the documentation for the function `list-sexp-diary-entries'." | ||
| 519 | :type 'string | ||
| 520 | :group 'diary) | ||
| 521 | |||
| 522 | (defcustom abbreviated-calendar-year t | 448 | (defcustom abbreviated-calendar-year t |
| 523 | "Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. | 449 | "Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. |
| 524 | For the Gregorian calendar; similarly for the Hebrew, Islamic and | 450 | For the Gregorian calendar; similarly for the Hebrew, Islamic and |
| @@ -705,45 +631,7 @@ See the documentation of the function `calendar-date-string'." | |||
| 705 | (setq diary-date-forms american-date-diary-pattern) | 631 | (setq diary-date-forms american-date-diary-pattern) |
| 706 | (update-calendar-mode-line)) | 632 | (update-calendar-mode-line)) |
| 707 | 633 | ||
| 708 | (defcustom print-diary-entries-hook 'lpr-buffer | 634 | ;; FIXME move to diary-lib and adjust appt. |
| 709 | "List of functions called after a temporary diary buffer is prepared. | ||
| 710 | The buffer shows only the diary entries currently visible in the diary | ||
| 711 | buffer. The default just does the printing. Other uses might include, for | ||
| 712 | example, rearranging the lines into order by day and time, saving the buffer | ||
| 713 | instead of deleting it, or changing the function used to do the printing." | ||
| 714 | :type 'hook | ||
| 715 | :group 'diary) | ||
| 716 | |||
| 717 | (defcustom list-diary-entries-hook nil | ||
| 718 | "List of functions called after diary file is culled for relevant entries. | ||
| 719 | It is to be used for diary entries that are not found in the diary file. | ||
| 720 | |||
| 721 | A function `include-other-diary-files' is provided for use as the value of | ||
| 722 | this hook. This function enables you to use shared diary files together | ||
| 723 | with your own. The files included are specified in the diary file by lines | ||
| 724 | of the form | ||
| 725 | |||
| 726 | #include \"filename\" | ||
| 727 | |||
| 728 | This is recursive; that is, #include directives in files thus included are | ||
| 729 | obeyed. You can change the \"#include\" to some other string by changing | ||
| 730 | the variable `diary-include-string'. When you use `include-other-diary-files' | ||
| 731 | as part of the list-diary-entries-hook, you will probably also want to use the | ||
| 732 | function `mark-included-diary-files' as part of `mark-diary-entries-hook'. | ||
| 733 | |||
| 734 | For example, you could use | ||
| 735 | |||
| 736 | (setq list-diary-entries-hook | ||
| 737 | '(include-other-diary-files sort-diary-entries)) | ||
| 738 | (setq diary-display-hook 'fancy-diary-display) | ||
| 739 | |||
| 740 | in your `.emacs' file to cause the fancy diary buffer to be displayed with | ||
| 741 | diary entries from various included files, each day's entries sorted into | ||
| 742 | lexicographic order." | ||
| 743 | :type 'hook | ||
| 744 | :options '(include-other-diary-files sort-diary-entries) | ||
| 745 | :group 'diary) | ||
| 746 | |||
| 747 | (defcustom diary-hook nil | 635 | (defcustom diary-hook nil |
| 748 | "List of functions called after the display of the diary. | 636 | "List of functions called after the display of the diary. |
| 749 | Can be used for appointment notification." | 637 | Can be used for appointment notification." |
| @@ -779,56 +667,6 @@ diary buffer, set the variable `diary-list-include-blanks' to t." | |||
| 779 | :set 'diary-set-maybe-redraw | 667 | :set 'diary-set-maybe-redraw |
| 780 | :group 'diary) | 668 | :group 'diary) |
| 781 | 669 | ||
| 782 | (defcustom nongregorian-diary-listing-hook nil | ||
| 783 | "List of functions called for listing diary file and included files. | ||
| 784 | As the files are processed for diary entries, these functions are used | ||
| 785 | to cull relevant entries. You can use either or both of | ||
| 786 | `list-hebrew-diary-entries', `list-islamic-diary-entries' and | ||
| 787 | `diary-bahai-list-entries'. The documentation for these functions | ||
| 788 | describes the style of such diary entries." | ||
| 789 | :type 'hook | ||
| 790 | :options '(list-hebrew-diary-entries | ||
| 791 | list-islamic-diary-entries | ||
| 792 | diary-bahai-list-entries) | ||
| 793 | :group 'diary) | ||
| 794 | |||
| 795 | (defcustom mark-diary-entries-hook nil | ||
| 796 | "List of functions called after marking diary entries in the calendar. | ||
| 797 | |||
| 798 | A function `mark-included-diary-files' is also provided for use as the | ||
| 799 | `mark-diary-entries-hook'; it enables you to use shared diary files together | ||
| 800 | with your own. The files included are specified in the diary file by lines | ||
| 801 | of the form | ||
| 802 | #include \"filename\" | ||
| 803 | This is recursive; that is, #include directives in files thus included are | ||
| 804 | obeyed. You can change the \"#include\" to some other string by changing the | ||
| 805 | variable `diary-include-string'. When you use `mark-included-diary-files' as | ||
| 806 | part of the mark-diary-entries-hook, you will probably also want to use the | ||
| 807 | function `include-other-diary-files' as part of `list-diary-entries-hook'." | ||
| 808 | :type 'hook | ||
| 809 | :options '(mark-included-diary-files) | ||
| 810 | :group 'diary) | ||
| 811 | |||
| 812 | (defcustom nongregorian-diary-marking-hook nil | ||
| 813 | "List of functions called for marking diary file and included files. | ||
| 814 | As the files are processed for diary entries, these functions are used | ||
| 815 | to cull relevant entries. You can use either or both of | ||
| 816 | `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and | ||
| 817 | `mark-bahai-diary-entries'. The documentation for these functions | ||
| 818 | describes the style of such diary entries." | ||
| 819 | :type 'hook | ||
| 820 | :options '(mark-hebrew-diary-entries | ||
| 821 | mark-islamic-diary-entries | ||
| 822 | diary-bahai-mark-entries) | ||
| 823 | :group 'diary) | ||
| 824 | |||
| 825 | (defcustom diary-list-include-blanks nil | ||
| 826 | "If nil, do not include days with no diary entry in the list of diary entries. | ||
| 827 | Such days will then not be shown in the fancy diary buffer, even if they | ||
| 828 | are holidays." | ||
| 829 | :type 'boolean | ||
| 830 | :group 'diary) | ||
| 831 | |||
| 832 | (defcustom holidays-in-diary-buffer t | 670 | (defcustom holidays-in-diary-buffer t |
| 833 | "Non-nil means include holidays in the diary display. | 671 | "Non-nil means include holidays in the diary display. |
| 834 | The holidays appear in the mode line of the diary buffer, or in the | 672 | The holidays appear in the mode line of the diary buffer, or in the |
| @@ -837,10 +675,11 @@ somewhat; setting it to nil makes the diary display faster." | |||
| 837 | :type 'boolean | 675 | :type 'boolean |
| 838 | :group 'holidays) | 676 | :group 'holidays) |
| 839 | 677 | ||
| 840 | (defvar calendar-mark-ring nil) | 678 | (defcustom calendar-debug-sexp nil |
| 679 | "Turn debugging on when evaluating a sexp in the diary or holiday list." | ||
| 680 | :type 'boolean | ||
| 681 | :group 'calendar) | ||
| 841 | 682 | ||
| 842 | ;;;###autoload | ||
| 843 | (put 'general-holidays 'risky-local-variable t) | ||
| 844 | (defcustom general-holidays | 683 | (defcustom general-holidays |
| 845 | '((holiday-fixed 1 1 "New Year's Day") | 684 | '((holiday-fixed 1 1 "New Year's Day") |
| 846 | (holiday-float 1 1 3 "Martin Luther King Day") | 685 | (holiday-float 1 1 3 "Martin Luther King Day") |
| @@ -863,9 +702,9 @@ somewhat; setting it to nil makes the diary display faster." | |||
| 863 | See the documentation for `calendar-holidays' for details." | 702 | See the documentation for `calendar-holidays' for details." |
| 864 | :type 'sexp | 703 | :type 'sexp |
| 865 | :group 'holidays) | 704 | :group 'holidays) |
| 866 | |||
| 867 | ;;;###autoload | 705 | ;;;###autoload |
| 868 | (put 'oriental-holidays 'risky-local-variable t) | 706 | (put 'general-holidays 'risky-local-variable t) |
| 707 | |||
| 869 | (defcustom oriental-holidays | 708 | (defcustom oriental-holidays |
| 870 | '((if (fboundp 'atan) | 709 | '((if (fboundp 'atan) |
| 871 | (holiday-chinese-new-year))) | 710 | (holiday-chinese-new-year))) |
| @@ -873,25 +712,33 @@ See the documentation for `calendar-holidays' for details." | |||
| 873 | See the documentation for `calendar-holidays' for details." | 712 | See the documentation for `calendar-holidays' for details." |
| 874 | :type 'sexp | 713 | :type 'sexp |
| 875 | :group 'holidays) | 714 | :group 'holidays) |
| 876 | |||
| 877 | ;;;###autoload | 715 | ;;;###autoload |
| 878 | (put 'local-holidays 'risky-local-variable t) | 716 | (put 'oriental-holidays 'risky-local-variable t) |
| 717 | |||
| 879 | (defcustom local-holidays nil | 718 | (defcustom local-holidays nil |
| 880 | "Local holidays. | 719 | "Local holidays. |
| 881 | See the documentation for `calendar-holidays' for details." | 720 | See the documentation for `calendar-holidays' for details." |
| 882 | :type 'sexp | 721 | :type 'sexp |
| 883 | :group 'holidays) | 722 | :group 'holidays) |
| 884 | |||
| 885 | ;;;###autoload | 723 | ;;;###autoload |
| 886 | (put 'other-holidays 'risky-local-variable t) | 724 | (put 'local-holidays 'risky-local-variable t) |
| 725 | |||
| 887 | (defcustom other-holidays nil | 726 | (defcustom other-holidays nil |
| 888 | "User defined holidays. | 727 | "User defined holidays. |
| 889 | See the documentation for `calendar-holidays' for details." | 728 | See the documentation for `calendar-holidays' for details." |
| 890 | :type 'sexp | 729 | :type 'sexp |
| 891 | :group 'holidays) | 730 | :group 'holidays) |
| 892 | |||
| 893 | ;;;###autoload | 731 | ;;;###autoload |
| 894 | (put 'hebrew-holidays-1 'risky-local-variable t) | 732 | (put 'other-holidays 'risky-local-variable t) |
| 733 | |||
| 734 | (defcustom all-hebrew-calendar-holidays nil | ||
| 735 | "If nil, show only major holidays from the Hebrew calendar. | ||
| 736 | This means only those Jewish holidays that appear on secular calendars. | ||
| 737 | Otherwise, show all the holidays that would appear in a complete Hebrew | ||
| 738 | calendar." | ||
| 739 | :type 'boolean | ||
| 740 | :group 'holidays) | ||
| 741 | |||
| 895 | (defvar hebrew-holidays-1 | 742 | (defvar hebrew-holidays-1 |
| 896 | '((holiday-rosh-hashanah-etc) | 743 | '((holiday-rosh-hashanah-etc) |
| 897 | (if all-hebrew-calendar-holidays | 744 | (if all-hebrew-calendar-holidays |
| @@ -908,9 +755,9 @@ See the documentation for `calendar-holidays' for details." | |||
| 908 | (if (zerop (% (1+ year) 4)) | 755 | (if (zerop (% (1+ year) 4)) |
| 909 | 22 | 756 | 22 |
| 910 | 21))) "\"Tal Umatar\" (evening)")))) | 757 | 21))) "\"Tal Umatar\" (evening)")))) |
| 911 | |||
| 912 | ;;;###autoload | 758 | ;;;###autoload |
| 913 | (put 'hebrew-holidays-2 'risky-local-variable t) | 759 | (put 'hebrew-holidays-1 'risky-local-variable t) |
| 760 | |||
| 914 | (defvar hebrew-holidays-2 | 761 | (defvar hebrew-holidays-2 |
| 915 | '((if all-hebrew-calendar-holidays | 762 | '((if all-hebrew-calendar-holidays |
| 916 | (holiday-hanukkah) | 763 | (holiday-hanukkah) |
| @@ -929,9 +776,9 @@ See the documentation for `calendar-holidays' for details." | |||
| 929 | "Tzom Teveth")) | 776 | "Tzom Teveth")) |
| 930 | (if all-hebrew-calendar-holidays | 777 | (if all-hebrew-calendar-holidays |
| 931 | (holiday-hebrew 11 15 "Tu B'Shevat")))) | 778 | (holiday-hebrew 11 15 "Tu B'Shevat")))) |
| 932 | |||
| 933 | ;;;###autoload | 779 | ;;;###autoload |
| 934 | (put 'hebrew-holidays-3 'risky-local-variable t) | 780 | (put 'hebrew-holidays-2 'risky-local-variable t) |
| 781 | |||
| 935 | (defvar hebrew-holidays-3 | 782 | (defvar hebrew-holidays-3 |
| 936 | '((if all-hebrew-calendar-holidays | 783 | '((if all-hebrew-calendar-holidays |
| 937 | (holiday-hebrew | 784 | (holiday-hebrew |
| @@ -961,9 +808,9 @@ See the documentation for `calendar-holidays' for details." | |||
| 961 | (day (extract-calendar-day s-s))) | 808 | (day (extract-calendar-day s-s))) |
| 962 | day)) | 809 | day)) |
| 963 | "Shabbat Shirah")))) | 810 | "Shabbat Shirah")))) |
| 964 | |||
| 965 | ;;;###autoload | 811 | ;;;###autoload |
| 966 | (put 'hebrew-holidays-4 'risky-local-variable t) | 812 | (put 'hebrew-holidays-3 'risky-local-variable t) |
| 813 | |||
| 967 | (defvar hebrew-holidays-4 | 814 | (defvar hebrew-holidays-4 |
| 968 | '((holiday-passover-etc) | 815 | '((holiday-passover-etc) |
| 969 | (if (and all-hebrew-calendar-holidays | 816 | (if (and all-hebrew-calendar-holidays |
| @@ -979,18 +826,26 @@ See the documentation for `calendar-holidays' for details." | |||
| 979 | (holiday-julian 3 26 "Kiddush HaHamah")) | 826 | (holiday-julian 3 26 "Kiddush HaHamah")) |
| 980 | (if all-hebrew-calendar-holidays | 827 | (if all-hebrew-calendar-holidays |
| 981 | (holiday-tisha-b-av-etc)))) | 828 | (holiday-tisha-b-av-etc)))) |
| 982 | |||
| 983 | ;;;###autoload | 829 | ;;;###autoload |
| 984 | (put 'hebrew-holidays 'risky-local-variable t) | 830 | (put 'hebrew-holidays-4 'risky-local-variable t) |
| 831 | |||
| 985 | (defcustom hebrew-holidays (append hebrew-holidays-1 hebrew-holidays-2 | 832 | (defcustom hebrew-holidays (append hebrew-holidays-1 hebrew-holidays-2 |
| 986 | hebrew-holidays-3 hebrew-holidays-4) | 833 | hebrew-holidays-3 hebrew-holidays-4) |
| 987 | "Jewish holidays. | 834 | "Jewish holidays. |
| 988 | See the documentation for `calendar-holidays' for details." | 835 | See the documentation for `calendar-holidays' for details." |
| 989 | :type 'sexp | 836 | :type 'sexp |
| 990 | :group 'holidays) | 837 | :group 'holidays) |
| 991 | |||
| 992 | ;;;###autoload | 838 | ;;;###autoload |
| 993 | (put 'christian-holidays 'risky-local-variable t) | 839 | (put 'hebrew-holidays 'risky-local-variable t) |
| 840 | |||
| 841 | (defcustom all-christian-calendar-holidays nil | ||
| 842 | "If nil, show only major holidays from the Christian calendar. | ||
| 843 | This means only those Christian holidays that appear on secular calendars. | ||
| 844 | Otherwise, show all the holidays that would appear in a complete Christian | ||
| 845 | calendar." | ||
| 846 | :type 'boolean | ||
| 847 | :group 'holidays) | ||
| 848 | |||
| 994 | (defcustom christian-holidays | 849 | (defcustom christian-holidays |
| 995 | '((if all-christian-calendar-holidays | 850 | '((if all-christian-calendar-holidays |
| 996 | (holiday-fixed 1 6 "Epiphany")) | 851 | (holiday-fixed 1 6 "Epiphany")) |
| @@ -1038,9 +893,17 @@ See the documentation for `calendar-holidays' for details." | |||
| 1038 | See the documentation for `calendar-holidays' for details." | 893 | See the documentation for `calendar-holidays' for details." |
| 1039 | :type 'sexp | 894 | :type 'sexp |
| 1040 | :group 'holidays) | 895 | :group 'holidays) |
| 1041 | |||
| 1042 | ;;;###autoload | 896 | ;;;###autoload |
| 1043 | (put 'islamic-holidays 'risky-local-variable t) | 897 | (put 'christian-holidays 'risky-local-variable t) |
| 898 | |||
| 899 | (defcustom all-islamic-calendar-holidays nil | ||
| 900 | "If nil, show only major holidays from the Islamic calendar. | ||
| 901 | This means only those Islamic holidays that appear on secular calendars. | ||
| 902 | Otherwise, show all the holidays that would appear in a complete Islamic | ||
| 903 | calendar." | ||
| 904 | :type 'boolean | ||
| 905 | :group 'holidays) | ||
| 906 | |||
| 1044 | (defcustom islamic-holidays | 907 | (defcustom islamic-holidays |
| 1045 | '((holiday-islamic | 908 | '((holiday-islamic |
| 1046 | 1 1 | 909 | 1 1 |
| @@ -1072,9 +935,17 @@ See the documentation for `calendar-holidays' for details." | |||
| 1072 | See the documentation for `calendar-holidays' for details." | 935 | See the documentation for `calendar-holidays' for details." |
| 1073 | :type 'sexp | 936 | :type 'sexp |
| 1074 | :group 'holidays) | 937 | :group 'holidays) |
| 1075 | |||
| 1076 | ;;;###autoload | 938 | ;;;###autoload |
| 1077 | (put 'bahai-holidays 'risky-local-variable t) | 939 | (put 'islamic-holidays 'risky-local-variable t) |
| 940 | |||
| 941 | (defcustom all-bahai-calendar-holidays nil | ||
| 942 | "If nil, show only major holidays from the Baha'i calendar. | ||
| 943 | These are the days on which work and school must be suspended. | ||
| 944 | Otherwise, show all the holidays that would appear in a complete Baha'i | ||
| 945 | calendar." | ||
| 946 | :type 'boolean | ||
| 947 | :group 'holidays) | ||
| 948 | |||
| 1078 | (defcustom bahai-holidays | 949 | (defcustom bahai-holidays |
| 1079 | '((holiday-fixed | 950 | '((holiday-fixed |
| 1080 | 3 21 | 951 | 3 21 |
| @@ -1113,15 +984,13 @@ See the documentation for `calendar-holidays' for details." | |||
| 1113 | See the documentation for `calendar-holidays' for details." | 984 | See the documentation for `calendar-holidays' for details." |
| 1114 | :type 'sexp | 985 | :type 'sexp |
| 1115 | :group 'holidays) | 986 | :group 'holidays) |
| 1116 | |||
| 1117 | ;;;###autoload | 987 | ;;;###autoload |
| 1118 | (put 'solar-holidays 'risky-local-variable t) | 988 | (put 'bahai-holidays 'risky-local-variable t) |
| 989 | |||
| 1119 | (defcustom solar-holidays | 990 | (defcustom solar-holidays |
| 1120 | '((if (fboundp 'atan) | 991 | '((if (fboundp 'atan) |
| 1121 | (solar-equinoxes-solstices)) | 992 | (solar-equinoxes-solstices)) |
| 1122 | (if (progn | 993 | (if (require 'cal-dst) |
| 1123 | (require 'cal-dst) | ||
| 1124 | t) | ||
| 1125 | (funcall | 994 | (funcall |
| 1126 | 'holiday-sexp | 995 | 'holiday-sexp |
| 1127 | calendar-daylight-savings-starts | 996 | calendar-daylight-savings-starts |
| @@ -1144,9 +1013,9 @@ See the documentation for `calendar-holidays' for details." | |||
| 1144 | See the documentation for `calendar-holidays' for details." | 1013 | See the documentation for `calendar-holidays' for details." |
| 1145 | :type 'sexp | 1014 | :type 'sexp |
| 1146 | :group 'holidays) | 1015 | :group 'holidays) |
| 1147 | |||
| 1148 | ;;;###autoload | 1016 | ;;;###autoload |
| 1149 | (put 'calendar-holidays 'risky-local-variable t) | 1017 | (put 'solar-holidays 'risky-local-variable t) |
| 1018 | |||
| 1150 | (defcustom calendar-holidays | 1019 | (defcustom calendar-holidays |
| 1151 | (append general-holidays local-holidays other-holidays | 1020 | (append general-holidays local-holidays other-holidays |
| 1152 | christian-holidays hebrew-holidays islamic-holidays | 1021 | christian-holidays hebrew-holidays islamic-holidays |
| @@ -1257,6 +1126,13 @@ with descriptive strings such as | |||
| 1257 | (((2 6 1989) \"New Moon\") ((2 12 1989) \"First Quarter Moon\") ... )." | 1126 | (((2 6 1989) \"New Moon\") ((2 12 1989) \"First Quarter Moon\") ... )." |
| 1258 | :type 'sexp | 1127 | :type 'sexp |
| 1259 | :group 'holidays) | 1128 | :group 'holidays) |
| 1129 | ;;;###autoload | ||
| 1130 | (put 'calendar-holidays 'risky-local-variable t) | ||
| 1131 | |||
| 1132 | ;;; End of user options. | ||
| 1133 | |||
| 1134 | (defconst calendar-buffer "*Calendar*" | ||
| 1135 | "Name of the buffer used for the calendar.") | ||
| 1260 | 1136 | ||
| 1261 | (defconst holiday-buffer "*Holidays*" | 1137 | (defconst holiday-buffer "*Holidays*" |
| 1262 | "Name of the buffer used for the displaying the holidays.") | 1138 | "Name of the buffer used for the displaying the holidays.") |
| @@ -1422,151 +1298,6 @@ return negative results." | |||
| 1422 | (/ offset-years 400) | 1298 | (/ offset-years 400) |
| 1423 | (calendar-day-number '(12 31 -1))))))) ; days in year 1 BC | 1299 | (calendar-day-number '(12 31 -1))))))) ; days in year 1 BC |
| 1424 | 1300 | ||
| 1425 | (autoload 'calendar-goto-today "cal-move" | ||
| 1426 | "Reposition the calendar window so the current date is visible." | ||
| 1427 | t) | ||
| 1428 | |||
| 1429 | (autoload 'calendar-forward-month "cal-move" | ||
| 1430 | "Move the cursor forward ARG months." | ||
| 1431 | t) | ||
| 1432 | |||
| 1433 | (autoload 'calendar-forward-year "cal-move" | ||
| 1434 | "Move the cursor forward by ARG years." | ||
| 1435 | t) | ||
| 1436 | |||
| 1437 | (autoload 'calendar-backward-month "cal-move" | ||
| 1438 | "Move the cursor backward by ARG months." | ||
| 1439 | t) | ||
| 1440 | |||
| 1441 | (autoload 'calendar-backward-year "cal-move" | ||
| 1442 | "Move the cursor backward ARG years." | ||
| 1443 | t) | ||
| 1444 | |||
| 1445 | (autoload 'calendar-scroll-left "cal-move" | ||
| 1446 | "Scroll the displayed calendar left by ARG months." | ||
| 1447 | t) | ||
| 1448 | |||
| 1449 | (autoload 'calendar-scroll-right "cal-move" | ||
| 1450 | "Scroll the displayed calendar window right by ARG months." | ||
| 1451 | t) | ||
| 1452 | |||
| 1453 | (autoload 'calendar-scroll-left-three-months "cal-move" | ||
| 1454 | "Scroll the displayed calendar window left by 3*ARG months." | ||
| 1455 | t) | ||
| 1456 | |||
| 1457 | (autoload 'calendar-scroll-right-three-months "cal-move" | ||
| 1458 | "Scroll the displayed calendar window right by 3*ARG months." | ||
| 1459 | t) | ||
| 1460 | |||
| 1461 | (autoload 'calendar-cursor-to-nearest-date "cal-move" | ||
| 1462 | "Move the cursor to the closest date." | ||
| 1463 | t) | ||
| 1464 | |||
| 1465 | (autoload 'calendar-forward-day "cal-move" | ||
| 1466 | "Move the cursor forward ARG days." | ||
| 1467 | t) | ||
| 1468 | |||
| 1469 | (autoload 'calendar-backward-day "cal-move" | ||
| 1470 | "Move the cursor back ARG days." | ||
| 1471 | t) | ||
| 1472 | |||
| 1473 | (autoload 'calendar-forward-week "cal-move" | ||
| 1474 | "Move the cursor forward ARG weeks." | ||
| 1475 | t) | ||
| 1476 | |||
| 1477 | (autoload 'calendar-backward-week "cal-move" | ||
| 1478 | "Move the cursor back ARG weeks." | ||
| 1479 | t) | ||
| 1480 | |||
| 1481 | (autoload 'calendar-beginning-of-week "cal-move" | ||
| 1482 | "Move the cursor back ARG calendar-week-start-day's." | ||
| 1483 | t) | ||
| 1484 | |||
| 1485 | (autoload 'calendar-end-of-week "cal-move" | ||
| 1486 | "Move the cursor forward ARG calendar-week-start-day+6's." | ||
| 1487 | t) | ||
| 1488 | |||
| 1489 | (autoload 'calendar-beginning-of-month "cal-move" | ||
| 1490 | "Move the cursor backward ARG month beginnings." | ||
| 1491 | t) | ||
| 1492 | |||
| 1493 | (autoload 'calendar-end-of-month "cal-move" | ||
| 1494 | "Move the cursor forward ARG month ends." | ||
| 1495 | t) | ||
| 1496 | |||
| 1497 | (autoload 'calendar-beginning-of-year "cal-move" | ||
| 1498 | "Move the cursor backward ARG year beginnings." | ||
| 1499 | t) | ||
| 1500 | |||
| 1501 | (autoload 'calendar-end-of-year "cal-move" | ||
| 1502 | "Move the cursor forward ARG year beginnings." | ||
| 1503 | t) | ||
| 1504 | |||
| 1505 | (autoload 'calendar-cursor-to-visible-date "cal-move" | ||
| 1506 | "Move the cursor to DATE that is on the screen." | ||
| 1507 | t) | ||
| 1508 | |||
| 1509 | (autoload 'calendar-goto-date "cal-move" | ||
| 1510 | "Move cursor to DATE." | ||
| 1511 | t) | ||
| 1512 | |||
| 1513 | (autoload 'calendar-goto-day-of-year "cal-move" | ||
| 1514 | "Move cursor to day of year." | ||
| 1515 | t) | ||
| 1516 | |||
| 1517 | (autoload 'calendar-only-one-frame-setup "cal-x" | ||
| 1518 | "Start calendar and display it in a dedicated frame.") | ||
| 1519 | |||
| 1520 | (autoload 'calendar-one-frame-setup "cal-x" | ||
| 1521 | "Start calendar and display it in a dedicated frame together with the diary.") | ||
| 1522 | |||
| 1523 | (autoload 'calendar-two-frame-setup "cal-x" | ||
| 1524 | "Start calendar and diary in separate, dedicated frames.") | ||
| 1525 | |||
| 1526 | (defcustom calendar-setup nil | ||
| 1527 | "The frame setup of the calendar. | ||
| 1528 | The choices are: `one-frame' (calendar and diary together in one separate, | ||
| 1529 | dedicated frame); `two-frames' (calendar and diary in separate, dedicated | ||
| 1530 | frames); `calendar-only' (calendar in a separate, dedicated frame); with | ||
| 1531 | any other value the current frame is used. Using any of the first | ||
| 1532 | three options overrides the value of `view-diary-entries-initially'." | ||
| 1533 | :type '(choice | ||
| 1534 | (const :tag "calendar and diary in separate frame" one-frame) | ||
| 1535 | (const :tag "calendar and diary each in own frame" two-frames) | ||
| 1536 | (const :tag "calendar in separate frame" calendar-only) | ||
| 1537 | (const :tag "use current frame" nil)) | ||
| 1538 | :group 'calendar) | ||
| 1539 | |||
| 1540 | (defcustom calendar-minimum-window-height 8 | ||
| 1541 | "Minimum height `generate-calendar-window' should use for calendar window." | ||
| 1542 | :type 'integer | ||
| 1543 | :version "22.1" | ||
| 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 | |||
| 1569 | |||
| 1570 | ;;;###autoload | 1301 | ;;;###autoload |
| 1571 | (defun calendar (&optional arg) | 1302 | (defun calendar (&optional arg) |
| 1572 | "Choose between the one frame, two frame, or basic calendar displays. | 1303 | "Choose between the one frame, two frame, or basic calendar displays. |
| @@ -1678,137 +1409,6 @@ D-FILE specifies the file to use as the diary file." | |||
| 1678 | "Create a buffer of the phases of the moon for the current calendar window." | 1409 | "Create a buffer of the phases of the moon for the current calendar window." |
| 1679 | t) | 1410 | t) |
| 1680 | 1411 | ||
| 1681 | (autoload 'calendar-print-french-date "cal-french" | ||
| 1682 | "Show the French Revolutionary calendar equivalent of the date under the cursor." | ||
| 1683 | t) | ||
| 1684 | |||
| 1685 | (autoload 'calendar-goto-french-date "cal-french" | ||
| 1686 | "Move cursor to French Revolutionary date." | ||
| 1687 | t) | ||
| 1688 | |||
| 1689 | (autoload 'calendar-french-date-string "cal-french" | ||
| 1690 | "String of French Revolutionary date of Gregorian date.") | ||
| 1691 | |||
| 1692 | (autoload 'calendar-mayan-date-string "cal-mayan" | ||
| 1693 | "String of Mayan date of Gregorian date.") | ||
| 1694 | |||
| 1695 | (autoload 'calendar-print-mayan-date "cal-mayan" | ||
| 1696 | "Show the Mayan long count, Tzolkin, and Haab equivalents of the date under the cursor." | ||
| 1697 | t) | ||
| 1698 | |||
| 1699 | (autoload 'calendar-goto-mayan-long-count-date "cal-mayan" | ||
| 1700 | "Move cursor to Mayan long count date." | ||
| 1701 | t) | ||
| 1702 | |||
| 1703 | (autoload 'calendar-next-haab-date "cal-mayan" | ||
| 1704 | "Move cursor to next instance of Mayan Haab date." | ||
| 1705 | t) | ||
| 1706 | |||
| 1707 | (autoload 'calendar-previous-haab-date "cal-mayan" | ||
| 1708 | "Move cursor to previous instance of Mayan Haab date." | ||
| 1709 | t) | ||
| 1710 | |||
| 1711 | (autoload 'calendar-next-tzolkin-date "cal-mayan" | ||
| 1712 | "Move cursor to next instance of Mayan Tzolkin date." | ||
| 1713 | t) | ||
| 1714 | |||
| 1715 | (autoload 'calendar-previous-tzolkin-date "cal-mayan" | ||
| 1716 | "Move cursor to previous instance of Mayan Tzolkin date." | ||
| 1717 | t) | ||
| 1718 | |||
| 1719 | (autoload 'calendar-next-calendar-round-date "cal-mayan" | ||
| 1720 | "Move cursor to next instance of Mayan Haab/Tzolkin combination." | ||
| 1721 | t) | ||
| 1722 | |||
| 1723 | (autoload 'calendar-previous-calendar-round-date "cal-mayan" | ||
| 1724 | "Move cursor to previous instance of Mayan Haab/Tzolkin combination." | ||
| 1725 | t) | ||
| 1726 | |||
| 1727 | (autoload 'calendar-goto-chinese-date "cal-china" | ||
| 1728 | "Move cursor to Chinese date." | ||
| 1729 | t) | ||
| 1730 | |||
| 1731 | (autoload 'calendar-print-chinese-date "cal-china" | ||
| 1732 | "Show the Chinese date equivalents of date." | ||
| 1733 | t) | ||
| 1734 | |||
| 1735 | (autoload 'calendar-chinese-date-string "cal-china" | ||
| 1736 | "String of Chinese date of Gregorian date.") | ||
| 1737 | |||
| 1738 | (autoload 'calendar-absolute-from-astro "cal-julian" | ||
| 1739 | "Absolute date of astronomical (Julian) day number D." | ||
| 1740 | t ) | ||
| 1741 | |||
| 1742 | (autoload 'calendar-astro-from-absolute "cal-julian" | ||
| 1743 | "Astronomical (Julian) day number of absolute date D.") | ||
| 1744 | |||
| 1745 | (autoload 'calendar-astro-date-string "cal-julian" | ||
| 1746 | "String of astronomical (Julian) day number of Gregorian date.") | ||
| 1747 | |||
| 1748 | (autoload 'calendar-goto-astro-day-number "cal-julian" | ||
| 1749 | "Move cursor to astronomical (Julian) day number." | ||
| 1750 | t) | ||
| 1751 | |||
| 1752 | (autoload 'calendar-print-astro-day-number "cal-julian" | ||
| 1753 | "Show the astro date equivalents of date." | ||
| 1754 | t) | ||
| 1755 | |||
| 1756 | (autoload 'calendar-julian-from-absolute "cal-julian" | ||
| 1757 | "Compute the Julian (month day year) corresponding to the absolute DATE. | ||
| 1758 | The absolute date is the number of days elapsed since the (imaginary) | ||
| 1759 | Gregorian date Sunday, December 31, 1 BC.") | ||
| 1760 | |||
| 1761 | (autoload 'calendar-goto-julian-date "cal-julian" | ||
| 1762 | "Move cursor to Julian DATE; echo Julian date unless NOECHO is t." | ||
| 1763 | t) | ||
| 1764 | |||
| 1765 | (autoload 'calendar-print-julian-date "cal-julian" | ||
| 1766 | "Show the Julian calendar equivalent of the date under the cursor." | ||
| 1767 | t) | ||
| 1768 | |||
| 1769 | (autoload 'calendar-julian-date-string "cal-julian" | ||
| 1770 | "String of Julian date of Gregorian DATE. | ||
| 1771 | Defaults to today's date if DATE is not given. | ||
| 1772 | Driven by the variable `calendar-date-display-form'.") | ||
| 1773 | |||
| 1774 | (autoload 'calendar-goto-iso-date "cal-iso" | ||
| 1775 | "Move cursor to ISO date." | ||
| 1776 | t) | ||
| 1777 | |||
| 1778 | (autoload 'calendar-goto-iso-week "cal-iso" | ||
| 1779 | "Move cursor to start of ISO week." | ||
| 1780 | t) | ||
| 1781 | |||
| 1782 | (autoload 'calendar-print-iso-date "cal-iso" | ||
| 1783 | "Show the ISO date equivalents of date." | ||
| 1784 | t) | ||
| 1785 | |||
| 1786 | (autoload 'calendar-iso-date-string "cal-iso" | ||
| 1787 | "String of ISO date of Gregorian date.") | ||
| 1788 | |||
| 1789 | (autoload 'calendar-goto-islamic-date "cal-islam" | ||
| 1790 | "Move cursor to Islamic date." | ||
| 1791 | t) | ||
| 1792 | |||
| 1793 | (autoload 'calendar-print-islamic-date "cal-islam" | ||
| 1794 | "Show the Islamic date equivalents of date." | ||
| 1795 | t) | ||
| 1796 | |||
| 1797 | (autoload 'calendar-islamic-date-string "cal-islam" | ||
| 1798 | "String of Islamic date of Gregorian date.") | ||
| 1799 | |||
| 1800 | (autoload 'calendar-bahai-goto-date "cal-bahai" | ||
| 1801 | "Move cursor to Baha'i date DATE. | ||
| 1802 | Echo Baha'i date unless NOECHO is t." | ||
| 1803 | t) | ||
| 1804 | |||
| 1805 | (autoload 'calendar-print-bahai-date "cal-bahai" | ||
| 1806 | "Show the Baha'i date equivalents of date." | ||
| 1807 | t) | ||
| 1808 | |||
| 1809 | (autoload 'calendar-bahai-date-string "cal-bahai" | ||
| 1810 | "String of Baha'i date of Gregorian date.") | ||
| 1811 | |||
| 1812 | (autoload 'calendar-goto-hebrew-date "cal-hebrew" | 1412 | (autoload 'calendar-goto-hebrew-date "cal-hebrew" |
| 1813 | "Move cursor to Hebrew date." | 1413 | "Move cursor to Hebrew date." |
| 1814 | t) | 1414 | t) |
| @@ -1820,39 +1420,6 @@ Echo Baha'i date unless NOECHO is t." | |||
| 1820 | (autoload 'calendar-hebrew-date-string "cal-hebrew" | 1420 | (autoload 'calendar-hebrew-date-string "cal-hebrew" |
| 1821 | "String of Hebrew date of Gregorian date.") | 1421 | "String of Hebrew date of Gregorian date.") |
| 1822 | 1422 | ||
| 1823 | (autoload 'calendar-goto-coptic-date "cal-coptic" | ||
| 1824 | "Move cursor to Coptic date." | ||
| 1825 | t) | ||
| 1826 | |||
| 1827 | (autoload 'calendar-print-coptic-date "cal-coptic" | ||
| 1828 | "Show the Coptic date equivalents of date." | ||
| 1829 | t) | ||
| 1830 | |||
| 1831 | (autoload 'calendar-coptic-date-string "cal-coptic" | ||
| 1832 | "String of Coptic date of Gregorian date.") | ||
| 1833 | |||
| 1834 | (autoload 'calendar-goto-ethiopic-date "cal-coptic" | ||
| 1835 | "Move cursor to Ethiopic date." | ||
| 1836 | t) | ||
| 1837 | |||
| 1838 | (autoload 'calendar-print-ethiopic-date "cal-coptic" | ||
| 1839 | "Show the Ethiopic date equivalents of date." | ||
| 1840 | t) | ||
| 1841 | |||
| 1842 | (autoload 'calendar-ethiopic-date-string "cal-coptic" | ||
| 1843 | "String of Ethiopic date of Gregorian date.") | ||
| 1844 | |||
| 1845 | (autoload 'calendar-goto-persian-date "cal-persia" | ||
| 1846 | "Move cursor to Persian date." | ||
| 1847 | t) | ||
| 1848 | |||
| 1849 | (autoload 'calendar-print-persian-date "cal-persia" | ||
| 1850 | "Show the Persian date equivalents of date." | ||
| 1851 | t) | ||
| 1852 | |||
| 1853 | (autoload 'calendar-persian-date-string "cal-persia" | ||
| 1854 | "String of Persian date of Gregorian date.") | ||
| 1855 | |||
| 1856 | (autoload 'diary-show-all-entries "diary-lib" | 1423 | (autoload 'diary-show-all-entries "diary-lib" |
| 1857 | "Show all of the diary entries in the diary file. | 1424 | "Show all of the diary entries in the diary file. |
| 1858 | This function gets rid of the selective display of the diary file so that | 1425 | This function gets rid of the selective display of the diary file so that |
| @@ -1876,7 +1443,6 @@ Each entry in diary file visible in the calendar window is marked." | |||
| 1876 | "Insert a weekly diary entry for the day of the week indicated by point." | 1443 | "Insert a weekly diary entry for the day of the week indicated by point." |
| 1877 | t) | 1444 | t) |
| 1878 | 1445 | ||
| 1879 | |||
| 1880 | (autoload 'insert-monthly-diary-entry "diary-lib" | 1446 | (autoload 'insert-monthly-diary-entry "diary-lib" |
| 1881 | "Insert a monthly diary entry for the day of the month indicated by point." | 1447 | "Insert a monthly diary entry for the day of the month indicated by point." |
| 1882 | t) | 1448 | t) |
| @@ -1912,115 +1478,6 @@ to the date indicated by point." | |||
| 1912 | to the date indicated by point." | 1478 | to the date indicated by point." |
| 1913 | t) | 1479 | t) |
| 1914 | 1480 | ||
| 1915 | (autoload 'insert-islamic-diary-entry "cal-islam" | ||
| 1916 | "Insert a diary entry for the Islamic date corresponding to the date | ||
| 1917 | indicated by point." | ||
| 1918 | t) | ||
| 1919 | |||
| 1920 | (autoload 'insert-monthly-islamic-diary-entry "cal-islam" | ||
| 1921 | "Insert a monthly diary entry for the day of the Islamic month corresponding | ||
| 1922 | to the date indicated by point." | ||
| 1923 | t) | ||
| 1924 | |||
| 1925 | (autoload 'insert-yearly-islamic-diary-entry "cal-islam" | ||
| 1926 | "Insert an annual diary entry for the day of the Islamic year corresponding | ||
| 1927 | to the date indicated by point." | ||
| 1928 | t) | ||
| 1929 | |||
| 1930 | (autoload 'diary-bahai-insert-entry "cal-bahai" | ||
| 1931 | "Insert a diary entry for the Baha'i date corresponding to the date | ||
| 1932 | indicated by point." | ||
| 1933 | t) | ||
| 1934 | |||
| 1935 | (autoload 'diary-bahai-insert-monthly-entry "cal-bahai" | ||
| 1936 | "Insert a monthly diary entry for the day of the Baha'i month corresponding | ||
| 1937 | to the date indicated by point." | ||
| 1938 | t) | ||
| 1939 | |||
| 1940 | (autoload 'diary-bahai-insert-yearly-entry "cal-bahai" | ||
| 1941 | "Insert an annual diary entry for the day of the Baha'i year corresponding | ||
| 1942 | to the date indicated by point." | ||
| 1943 | t) | ||
| 1944 | |||
| 1945 | (autoload 'cal-tex-cursor-month "cal-tex" | ||
| 1946 | "Make a buffer with LaTeX commands for the month cursor is on. | ||
| 1947 | Optional prefix argument specifies number of months to be produced. | ||
| 1948 | Calendar is condensed onto one page." t) | ||
| 1949 | |||
| 1950 | (autoload 'cal-tex-cursor-month-landscape "cal-tex" | ||
| 1951 | "Make a buffer with LaTeX commands for the month cursor is on. | ||
| 1952 | Optional prefix argument specifies number of months to be produced." t) | ||
| 1953 | |||
| 1954 | (autoload 'cal-tex-cursor-day "cal-tex" | ||
| 1955 | "Make a buffer with LaTeX commands for the day cursor is on." t) | ||
| 1956 | |||
| 1957 | (autoload 'cal-tex-cursor-week "cal-tex" | ||
| 1958 | "Make a buffer with LaTeX commands for a two-page one-week calendar. | ||
| 1959 | It applies to the week that point is in. | ||
| 1960 | Optional prefix argument specifies number of weeks. | ||
| 1961 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1962 | |||
| 1963 | (autoload 'cal-tex-cursor-week2 "cal-tex" | ||
| 1964 | "Make a buffer with LaTeX commands for a two-page one-week calendar. | ||
| 1965 | It applies to the week that point is in. | ||
| 1966 | Optional prefix argument specifies number of weeks. | ||
| 1967 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1968 | |||
| 1969 | (autoload 'cal-tex-cursor-week-iso "cal-tex" | ||
| 1970 | "Make a buffer with LaTeX commands for a one page ISO-style weekly calendar. | ||
| 1971 | Optional prefix argument specifies number of weeks. | ||
| 1972 | Diary entries are included if `cal-tex-diary' is t. | ||
| 1973 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1974 | |||
| 1975 | (autoload 'cal-tex-cursor-week-monday "cal-tex" | ||
| 1976 | "Make a buffer with LaTeX commands for a two-page one-week calendar. | ||
| 1977 | It applies to the week that point is in, and starts on Monday. | ||
| 1978 | Optional prefix argument specifies number of weeks. | ||
| 1979 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1980 | |||
| 1981 | (autoload 'cal-tex-cursor-filofax-2week "cal-tex" | ||
| 1982 | "Two-weeks-at-a-glance Filofax style calendar for week indicated by cursor. | ||
| 1983 | Optional prefix argument specifies number of weeks. | ||
| 1984 | Diary entries are included if cal-tex-diary is t. | ||
| 1985 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1986 | |||
| 1987 | (autoload 'cal-tex-cursor-filofax-week "cal-tex" | ||
| 1988 | "One-week-at-a-glance Filofax style calendar for week indicated by cursor. | ||
| 1989 | Optional prefix argument specifies number of weeks. | ||
| 1990 | Weeks start on Monday. | ||
| 1991 | Diary entries are included if cal-tex-diary is t. | ||
| 1992 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1993 | |||
| 1994 | (autoload 'cal-tex-cursor-filofax-daily "cal-tex" | ||
| 1995 | "Day-per-page Filofax style calendar for week indicated by cursor. | ||
| 1996 | Optional prefix argument specifies number of weeks. Weeks start on Monday. | ||
| 1997 | Diary entries are included if `cal-tex-diary' is t. | ||
| 1998 | Holidays are included if `cal-tex-holidays' is t." t) | ||
| 1999 | |||
| 2000 | (autoload 'cal-tex-cursor-year "cal-tex" | ||
| 2001 | "Make a buffer with LaTeX commands for a year's calendar. | ||
| 2002 | Optional prefix argument specifies number of years." t) | ||
| 2003 | |||
| 2004 | (autoload 'cal-tex-cursor-year-landscape "cal-tex" | ||
| 2005 | "Make a buffer with LaTeX commands for a year's calendar (landscape). | ||
| 2006 | Optional prefix argument specifies number of years." t) | ||
| 2007 | |||
| 2008 | (autoload 'cal-tex-cursor-filofax-year "cal-tex" | ||
| 2009 | "Make a buffer with LaTeX commands for a year's calendar (Filofax). | ||
| 2010 | Optional prefix argument specifies number of years." t) | ||
| 2011 | |||
| 2012 | (autoload 'cal-html-cursor-month "cal-html" | ||
| 2013 | "Write an HTML calendar file for numeric MONTH of four-digit YEAR. | ||
| 2014 | The output directory DIR is created if necessary. Interactively, | ||
| 2015 | MONTH and YEAR are taken from the calendar cursor position. Note | ||
| 2016 | that any existing output files are overwritten." t) | ||
| 2017 | |||
| 2018 | (autoload 'cal-html-cursor-year "cal-html" | ||
| 2019 | "Write HTML calendar files (index and monthly pages) for four-digit YEAR. | ||
| 2020 | The output directory DIR is created if necessary. Interactively, | ||
| 2021 | YEAR is taken from the calendar cursor position. Note that any | ||
| 2022 | existing output files are overwritten." t) | ||
| 2023 | |||
| 2024 | (autoload 'mark-calendar-holidays "holidays" | 1481 | (autoload 'mark-calendar-holidays "holidays" |
| 2025 | "Mark notable days in the calendar window." | 1482 | "Mark notable days in the calendar window." |
| 2026 | t) | 1483 | t) |
| @@ -2160,8 +1617,6 @@ the inserted text. Value is always t." | |||
| 2160 | (generate-calendar-window displayed-month displayed-year) | 1617 | (generate-calendar-window displayed-month displayed-year) |
| 2161 | (calendar-cursor-to-visible-date cursor-date))))) | 1618 | (calendar-cursor-to-visible-date cursor-date))))) |
| 2162 | 1619 | ||
| 2163 | (require 'cal-menu) | ||
| 2164 | |||
| 2165 | (defvar calendar-mode-map | 1620 | (defvar calendar-mode-map |
| 2166 | (let ((map (make-keymap))) | 1621 | (let ((map (make-keymap))) |
| 2167 | (suppress-keymap map) | 1622 | (suppress-keymap map) |
| @@ -2397,6 +1852,12 @@ under the cursor: | |||
| 2397 | (interactive) | 1852 | (interactive) |
| 2398 | (info "(emacs)Calendar/Diary")) | 1853 | (info "(emacs)Calendar/Diary")) |
| 2399 | 1854 | ||
| 1855 | (defvar calendar-mark-ring nil | ||
| 1856 | "Used by `calendar-set-mark'.") | ||
| 1857 | |||
| 1858 | (defvar calendar-starred-day nil | ||
| 1859 | "Stores the value of the last date that `calendar-star-date' replaced.") | ||
| 1860 | |||
| 2400 | (defun calendar-mode () | 1861 | (defun calendar-mode () |
| 2401 | "A major mode for the calendar window. | 1862 | "A major mode for the calendar window. |
| 2402 | 1863 | ||
| @@ -2405,13 +1866,14 @@ For a complete description, type \ | |||
| 2405 | 1866 | ||
| 2406 | \\<calendar-mode-map>\\{calendar-mode-map}" | 1867 | \\<calendar-mode-map>\\{calendar-mode-map}" |
| 2407 | (kill-all-local-variables) | 1868 | (kill-all-local-variables) |
| 2408 | (setq major-mode 'calendar-mode) | 1869 | (setq major-mode 'calendar-mode |
| 2409 | (setq mode-name "Calendar") | 1870 | mode-name "Calendar" |
| 1871 | buffer-read-only t | ||
| 1872 | indent-tabs-mode nil) | ||
| 2410 | (use-local-map calendar-mode-map) | 1873 | (use-local-map calendar-mode-map) |
| 2411 | (setq buffer-read-only t) | ||
| 2412 | (setq indent-tabs-mode nil) | ||
| 2413 | (update-calendar-mode-line) | 1874 | (update-calendar-mode-line) |
| 2414 | (make-local-variable 'calendar-mark-ring) | 1875 | (make-local-variable 'calendar-mark-ring) |
| 1876 | (make-local-variable 'calendar-starred-day) | ||
| 2415 | (make-local-variable 'displayed-month) ;; Month in middle of window. | 1877 | (make-local-variable 'displayed-month) ;; Month in middle of window. |
| 2416 | (make-local-variable 'displayed-year) ;; Year in middle of window. | 1878 | (make-local-variable 'displayed-year) ;; Year in middle of window. |
| 2417 | ;; Most functions only work if displayed-month and displayed-year are set, | 1879 | ;; Most functions only work if displayed-month and displayed-year are set, |
| @@ -2679,42 +2141,6 @@ is a string to insert in the minibuffer before reading." | |||
| 2679 | (setq value (read-minibuffer prompt initial-contents))) | 2141 | (setq value (read-minibuffer prompt initial-contents))) |
| 2680 | value)) | 2142 | value)) |
| 2681 | 2143 | ||
| 2682 | (defun calendar-read-date (&optional noday) | ||
| 2683 | "Prompt for Gregorian date. Return a list (month day year). | ||
| 2684 | If optional NODAY is t, does not ask for day, but just returns | ||
| 2685 | \(month nil year); if NODAY is any other non-nil value the value returned is | ||
| 2686 | \(month year)" | ||
| 2687 | (let* ((year (calendar-read | ||
| 2688 | "Year (>0): " | ||
| 2689 | (lambda (x) (> x 0)) | ||
| 2690 | (int-to-string (extract-calendar-year | ||
| 2691 | (calendar-current-date))))) | ||
| 2692 | (month-array calendar-month-name-array) | ||
| 2693 | (completion-ignore-case t) | ||
| 2694 | (month (cdr (assoc-string | ||
| 2695 | (completing-read | ||
| 2696 | "Month name: " | ||
| 2697 | (mapcar 'list (append month-array nil)) | ||
| 2698 | nil t) | ||
| 2699 | (calendar-make-alist month-array 1) t))) | ||
| 2700 | (last (calendar-last-day-of-month month year))) | ||
| 2701 | (if noday | ||
| 2702 | (if (eq noday t) | ||
| 2703 | (list month nil year) | ||
| 2704 | (list month year)) | ||
| 2705 | (list month | ||
| 2706 | (calendar-read (format "Day (1-%d): " last) | ||
| 2707 | (lambda (x) (and (< 0 x) (<= x last)))) | ||
| 2708 | year)))) | ||
| 2709 | |||
| 2710 | (defun calendar-interval (mon1 yr1 mon2 yr2) | ||
| 2711 | "The number of months difference between MON1, YR1 and MON2, YR2. | ||
| 2712 | The result is positive if the second date is later than the first. | ||
| 2713 | Negative years are interpreted as years BC; -1 being 1 BC, and so on." | ||
| 2714 | (if (< yr1 0) (setq yr1 (1+ yr1))) ; -1 BC -> 0 AD, etc | ||
| 2715 | (if (< yr2 0) (setq yr2 (1+ yr2))) | ||
| 2716 | (+ (* 12 (- yr2 yr1)) | ||
| 2717 | (- mon2 mon1))) | ||
| 2718 | 2144 | ||
| 2719 | (defvar calendar-abbrev-length 3 | 2145 | (defvar calendar-abbrev-length 3 |
| 2720 | "*Length of abbreviations to be used for day and month names. | 2146 | "*Length of abbreviations to be used for day and month names. |
| @@ -2756,6 +2182,44 @@ element of this array is nil, then the abbreviation will be | |||
| 2756 | constructed as the first `calendar-abbrev-length' characters of the | 2182 | constructed as the first `calendar-abbrev-length' characters of the |
| 2757 | corresponding full name.") | 2183 | corresponding full name.") |
| 2758 | 2184 | ||
| 2185 | |||
| 2186 | (defun calendar-read-date (&optional noday) | ||
| 2187 | "Prompt for Gregorian date. Return a list (month day year). | ||
| 2188 | If optional NODAY is t, does not ask for day, but just returns | ||
| 2189 | \(month nil year); if NODAY is any other non-nil value the value returned is | ||
| 2190 | \(month year)" | ||
| 2191 | (let* ((year (calendar-read | ||
| 2192 | "Year (>0): " | ||
| 2193 | (lambda (x) (> x 0)) | ||
| 2194 | (int-to-string (extract-calendar-year | ||
| 2195 | (calendar-current-date))))) | ||
| 2196 | (month-array calendar-month-name-array) | ||
| 2197 | (completion-ignore-case t) | ||
| 2198 | (month (cdr (assoc-string | ||
| 2199 | (completing-read | ||
| 2200 | "Month name: " | ||
| 2201 | (mapcar 'list (append month-array nil)) | ||
| 2202 | nil t) | ||
| 2203 | (calendar-make-alist month-array 1) t))) | ||
| 2204 | (last (calendar-last-day-of-month month year))) | ||
| 2205 | (if noday | ||
| 2206 | (if (eq noday t) | ||
| 2207 | (list month nil year) | ||
| 2208 | (list month year)) | ||
| 2209 | (list month | ||
| 2210 | (calendar-read (format "Day (1-%d): " last) | ||
| 2211 | (lambda (x) (and (< 0 x) (<= x last)))) | ||
| 2212 | year)))) | ||
| 2213 | |||
| 2214 | (defun calendar-interval (mon1 yr1 mon2 yr2) | ||
| 2215 | "The number of months difference between MON1, YR1 and MON2, YR2. | ||
| 2216 | The result is positive if the second date is later than the first. | ||
| 2217 | Negative years are interpreted as years BC; -1 being 1 BC, and so on." | ||
| 2218 | (if (< yr1 0) (setq yr1 (1+ yr1))) ; -1 BC -> 0 AD, etc | ||
| 2219 | (if (< yr2 0) (setq yr2 (1+ yr2))) | ||
| 2220 | (+ (* 12 (- yr2 yr1)) | ||
| 2221 | (- mon2 mon1))) | ||
| 2222 | |||
| 2759 | (defun calendar-abbrev-construct (abbrev full &optional period) | 2223 | (defun calendar-abbrev-construct (abbrev full &optional period) |
| 2760 | "Internal calendar function to return a complete abbreviation array. | 2224 | "Internal calendar function to return a complete abbreviation array. |
| 2761 | ABBREV is an array of abbreviations, FULL the corresponding array | 2225 | ABBREV is an array of abbreviations, FULL the corresponding array |
| @@ -2945,9 +2409,8 @@ calendar window has been prepared." | |||
| 2945 | (let ((inhibit-read-only t) | 2409 | (let ((inhibit-read-only t) |
| 2946 | (modified (buffer-modified-p))) | 2410 | (modified (buffer-modified-p))) |
| 2947 | (forward-char 1) | 2411 | (forward-char 1) |
| 2948 | (set (make-local-variable 'calendar-starred-day) | 2412 | (setq calendar-starred-day |
| 2949 | (string-to-number | 2413 | (string-to-number (buffer-substring (point) (- (point) 2)))) |
| 2950 | (buffer-substring (point) (- (point) 2)))) | ||
| 2951 | ;; Insert before deleting, to better preserve markers. | 2414 | ;; Insert before deleting, to better preserve markers. |
| 2952 | (insert "**") | 2415 | (insert "**") |
| 2953 | (forward-char -2) | 2416 | (forward-char -2) |