Mercurial > emacs
comparison lisp/calendar/cal-iso.el @ 92833:272f566348a7
(generated-autoload-file): Don't set, instead use different values of
generate-autoload-cookie plus Makefile rules to allow for a mixture of
internal calendar autoloads and normal autoloads.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 13 Mar 2008 05:44:04 +0000 |
parents | 3ed51c637a80 |
children | d77fc175bcfc |
comparison
equal
deleted
inserted
replaced
92832:0f2bf92fe13d | 92833:272f566348a7 |
---|---|
72 (list | 72 (list |
73 (1+ (/ (- date (calendar-absolute-from-iso (list 1 1 year))) 7)) | 73 (1+ (/ (- date (calendar-absolute-from-iso (list 1 1 year))) 7)) |
74 (% date 7) | 74 (% date 7) |
75 year))) | 75 year))) |
76 | 76 |
77 ;;;###autoload | 77 ;;;###cal-autoload |
78 (defun calendar-iso-date-string (&optional date) | 78 (defun calendar-iso-date-string (&optional date) |
79 "String of ISO date of Gregorian DATE, default today." | 79 "String of ISO date of Gregorian DATE, default today." |
80 (let* ((d (calendar-absolute-from-gregorian | 80 (let* ((d (calendar-absolute-from-gregorian |
81 (or date (calendar-current-date)))) | 81 (or date (calendar-current-date)))) |
82 (day (% d 7)) | 82 (day (% d 7)) |
84 (format "Day %s of week %d of %d" | 84 (format "Day %s of week %d of %d" |
85 (if (zerop day) 7 day) | 85 (if (zerop day) 7 day) |
86 (extract-calendar-month iso-date) | 86 (extract-calendar-month iso-date) |
87 (extract-calendar-year iso-date)))) | 87 (extract-calendar-year iso-date)))) |
88 | 88 |
89 ;;;###autoload | 89 ;;;###cal-autoload |
90 (defun calendar-print-iso-date () | 90 (defun calendar-print-iso-date () |
91 "Show equivalent ISO date for the date under the cursor." | 91 "Show equivalent ISO date for the date under the cursor." |
92 (interactive) | 92 (interactive) |
93 (message "ISO date: %s" | 93 (message "ISO date: %s" |
94 (calendar-iso-date-string (calendar-cursor-to-date t)))) | 94 (calendar-iso-date-string (calendar-cursor-to-date t)))) |
115 "ISO day (1-7): " | 115 "ISO day (1-7): " |
116 (lambda (x) (and (<= 1 x) (<= x 7)))) | 116 (lambda (x) (and (<= 1 x) (<= x 7)))) |
117 1))) | 117 1))) |
118 (list (list week day year)))) | 118 (list (list week day year)))) |
119 | 119 |
120 ;;;###autoload | 120 ;;;###cal-autoload |
121 (defun calendar-goto-iso-date (date &optional noecho) | 121 (defun calendar-goto-iso-date (date &optional noecho) |
122 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil." | 122 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil." |
123 (interactive (calendar-iso-read-args t)) | 123 (interactive (calendar-iso-read-args t)) |
124 (calendar-goto-date (calendar-gregorian-from-absolute | 124 (calendar-goto-date (calendar-gregorian-from-absolute |
125 (calendar-absolute-from-iso date))) | 125 (calendar-absolute-from-iso date))) |
126 (or noecho (calendar-print-iso-date))) | 126 (or noecho (calendar-print-iso-date))) |
127 | 127 |
128 ;;;###autoload | 128 ;;;###cal-autoload |
129 (defun calendar-goto-iso-week (date &optional noecho) | 129 (defun calendar-goto-iso-week (date &optional noecho) |
130 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil. | 130 "Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil. |
131 Interactively, goes to the first day of the specified week." | 131 Interactively, goes to the first day of the specified week." |
132 (interactive (calendar-iso-read-args)) | 132 (interactive (calendar-iso-read-args)) |
133 (calendar-goto-date (calendar-gregorian-from-absolute | 133 (calendar-goto-date (calendar-gregorian-from-absolute |
135 (or noecho (calendar-print-iso-date))) | 135 (or noecho (calendar-print-iso-date))) |
136 | 136 |
137 (defvar date) | 137 (defvar date) |
138 | 138 |
139 ;; To be called from list-sexp-diary-entries, where DATE is bound. | 139 ;; To be called from list-sexp-diary-entries, where DATE is bound. |
140 ;;;###diary-autoload | |
140 (defun diary-iso-date () | 141 (defun diary-iso-date () |
141 "ISO calendar equivalent of date diary entry." | 142 "ISO calendar equivalent of date diary entry." |
142 (format "ISO date: %s" (calendar-iso-date-string date))) | 143 (format "ISO date: %s" (calendar-iso-date-string date))) |
143 | 144 |
144 (provide 'cal-iso) | 145 (provide 'cal-iso) |
145 | 146 |
146 ;; Local Variables: | |
147 ;; generated-autoload-file: "cal-loaddefs.el" | |
148 ;; End: | |
149 | |
150 ;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6 | 147 ;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6 |
151 ;;; cal-iso.el ends here | 148 ;;; cal-iso.el ends here |