aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2008-03-08 03:44:08 +0000
committerGlenn Morris2008-03-08 03:44:08 +0000
commitd383fd971c95b0bd45a75062cb5891c3a76bb947 (patch)
tree4f7fec0379876c5459fa81ea6b468444603733e7 /lisp
parentad20a664492675fe93f76f5b14e18c07d6fa7965 (diff)
downloademacs-d383fd971c95b0bd45a75062cb5891c3a76bb947.tar.gz
emacs-d383fd971c95b0bd45a75062cb5891c3a76bb947.zip
Unquote lambda functions. Add autoload cookies to functions formerly
autoloaded in calendar.el. Set `generated-autoload-file' to "cal-loaddefs.el".
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/cal-islam.el16
-rw-r--r--lisp/calendar/cal-iso.el22
-rw-r--r--lisp/calendar/cal-julian.el21
3 files changed, 45 insertions, 14 deletions
diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el
index 9e74b7d87af..b05f44868a8 100644
--- a/lisp/calendar/cal-islam.el
+++ b/lisp/calendar/cal-islam.el
@@ -119,6 +119,7 @@ Gregorian date Sunday, December 31, 1 BC."
119 (1- (calendar-absolute-from-islamic (list month 1 year)))))) 119 (1- (calendar-absolute-from-islamic (list month 1 year))))))
120 (list month day year)))) 120 (list month day year))))
121 121
122;;;###autoload
122(defun calendar-islamic-date-string (&optional date) 123(defun calendar-islamic-date-string (&optional date)
123 "String of Islamic date before sunset of Gregorian DATE. 124 "String of Islamic date before sunset of Gregorian DATE.
124Returns the empty string if DATE is pre-Islamic. 125Returns the empty string if DATE is pre-Islamic.
@@ -132,6 +133,7 @@ Driven by the variable `calendar-date-display-form'."
132 "" 133 ""
133 (calendar-date-string islamic-date nil t)))) 134 (calendar-date-string islamic-date nil t))))
134 135
136;;;###autoload
135(defun calendar-print-islamic-date () 137(defun calendar-print-islamic-date ()
136 "Show the Islamic calendar equivalent of the date under the cursor." 138 "Show the Islamic calendar equivalent of the date under the cursor."
137 (interactive) 139 (interactive)
@@ -140,13 +142,14 @@ Driven by the variable `calendar-date-display-form'."
140 (message "Date is pre-Islamic") 142 (message "Date is pre-Islamic")
141 (message "Islamic date (until sunset): %s" i)))) 143 (message "Islamic date (until sunset): %s" i))))
142 144
145;;;###autoload
143(defun calendar-goto-islamic-date (date &optional noecho) 146(defun calendar-goto-islamic-date (date &optional noecho)
144 "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t." 147 "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t."
145 (interactive 148 (interactive
146 (let* ((today (calendar-current-date)) 149 (let* ((today (calendar-current-date))
147 (year (calendar-read 150 (year (calendar-read
148 "Islamic calendar year (>0): " 151 "Islamic calendar year (>0): "
149 '(lambda (x) (> x 0)) 152 (lambda (x) (> x 0))
150 (int-to-string 153 (int-to-string
151 (extract-calendar-year 154 (extract-calendar-year
152 (calendar-islamic-from-absolute 155 (calendar-islamic-from-absolute
@@ -162,7 +165,7 @@ Driven by the variable `calendar-date-display-form'."
162 (last (islamic-calendar-last-day-of-month month year)) 165 (last (islamic-calendar-last-day-of-month month year))
163 (day (calendar-read 166 (day (calendar-read
164 (format "Islamic calendar day (1-%d): " last) 167 (format "Islamic calendar day (1-%d): " last)
165 '(lambda (x) (and (< 0 x) (<= x last)))))) 168 (lambda (x) (and (< 0 x) (<= x last))))))
166 (list (list month day year)))) 169 (list (list month day year))))
167 (calendar-goto-date (calendar-gregorian-from-absolute 170 (calendar-goto-date (calendar-gregorian-from-absolute
168 (calendar-absolute-from-islamic date))) 171 (calendar-absolute-from-islamic date)))
@@ -452,6 +455,7 @@ A value of 0 in any position is a wildcard."
452 (mark-visible-calendar-date 455 (mark-visible-calendar-date
453 (calendar-gregorian-from-absolute date))))))))) 456 (calendar-gregorian-from-absolute date)))))))))
454 457
458;;;###autoload
455(defun insert-islamic-diary-entry (arg) 459(defun insert-islamic-diary-entry (arg)
456 "Insert a diary entry. 460 "Insert a diary entry.
457For the Islamic date corresponding to the date indicated by point. 461For the Islamic date corresponding to the date indicated by point.
@@ -468,6 +472,7 @@ Prefix arg will make the entry nonmarking."
468 nil t)) 472 nil t))
469 arg))) 473 arg)))
470 474
475;;;###autoload
471(defun insert-monthly-islamic-diary-entry (arg) 476(defun insert-monthly-islamic-diary-entry (arg)
472 "Insert a monthly diary entry. 477 "Insert a monthly diary entry.
473For the day of the Islamic month corresponding to the date indicated by point. 478For the day of the Islamic month corresponding to the date indicated by point.
@@ -485,6 +490,7 @@ Prefix arg will make the entry nonmarking."
485 (calendar-cursor-to-date t))))) 490 (calendar-cursor-to-date t)))))
486 arg))) 491 arg)))
487 492
493;;;###autoload
488(defun insert-yearly-islamic-diary-entry (arg) 494(defun insert-yearly-islamic-diary-entry (arg)
489 "Insert an annual diary entry. 495 "Insert an annual diary entry.
490For the day of the Islamic year corresponding to the date indicated by point. 496For the day of the Islamic year corresponding to the date indicated by point.
@@ -506,5 +512,9 @@ Prefix arg will make the entry nonmarking."
506 512
507(provide 'cal-islam) 513(provide 'cal-islam)
508 514
509;;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 515;; Local Variables:
516;; generated-autoload-file: "cal-loaddefs.el"
517;; End:
518
519;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7
510;;; cal-islam.el ends here 520;;; cal-islam.el ends here
diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el
index 7e2e91904e7..878953e9d85 100644
--- a/lisp/calendar/cal-iso.el
+++ b/lisp/calendar/cal-iso.el
@@ -36,8 +36,6 @@
36 36
37;;; Code: 37;;; Code:
38 38
39(defvar date)
40
41(require 'calendar) 39(require 'calendar)
42 40
43(defun calendar-absolute-from-iso (date) 41(defun calendar-absolute-from-iso (date)
@@ -54,7 +52,7 @@ Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary."
54 (+ (calendar-dayname-on-or-before 52 (+ (calendar-dayname-on-or-before
55 1 (+ 3 (calendar-absolute-from-gregorian (list 1 1 year)))) 53 1 (+ 3 (calendar-absolute-from-gregorian (list 1 1 year))))
56 (* 7 (1- week)) 54 (* 7 (1- week))
57 (if (= day 0) 6 (1- day))))) 55 (if (zerop day) 6 (1- day)))))
58 56
59(defun calendar-iso-from-absolute (date) 57(defun calendar-iso-from-absolute (date)
60 "Compute the `ISO commercial date' corresponding to the absolute DATE. 58 "Compute the `ISO commercial date' corresponding to the absolute DATE.
@@ -76,6 +74,7 @@ date Sunday, December 31, 1 BC."
76 (% date 7) 74 (% date 7)
77 year))) 75 year)))
78 76
77;;;###autoload
79(defun calendar-iso-date-string (&optional date) 78(defun calendar-iso-date-string (&optional date)
80 "String of ISO date of Gregorian DATE. 79 "String of ISO date of Gregorian DATE.
81Defaults to today's date if DATE is not given." 80Defaults to today's date if DATE is not given."
@@ -88,6 +87,7 @@ Defaults to today's date if DATE is not given."
88 (extract-calendar-month iso-date) 87 (extract-calendar-month iso-date)
89 (extract-calendar-year iso-date)))) 88 (extract-calendar-year iso-date))))
90 89
90;;;###autoload
91(defun calendar-print-iso-date () 91(defun calendar-print-iso-date ()
92 "Show equivalent ISO date for the date under the cursor." 92 "Show equivalent ISO date for the date under the cursor."
93 (interactive) 93 (interactive)
@@ -99,7 +99,7 @@ Defaults to today's date if DATE is not given."
99 (let* ((today (calendar-current-date)) 99 (let* ((today (calendar-current-date))
100 (year (calendar-read 100 (year (calendar-read
101 "ISO calendar year (>0): " 101 "ISO calendar year (>0): "
102 '(lambda (x) (> x 0)) 102 (lambda (x) (> x 0))
103 (int-to-string (extract-calendar-year today)))) 103 (int-to-string (extract-calendar-year today))))
104 (no-weeks (extract-calendar-month 104 (no-weeks (extract-calendar-month
105 (calendar-iso-from-absolute 105 (calendar-iso-from-absolute
@@ -109,13 +109,14 @@ Defaults to today's date if DATE is not given."
109 (list 1 4 (1+ year)))))))) 109 (list 1 4 (1+ year))))))))
110 (week (calendar-read 110 (week (calendar-read
111 (format "ISO calendar week (1-%d): " no-weeks) 111 (format "ISO calendar week (1-%d): " no-weeks)
112 '(lambda (x) (and (> x 0) (<= x no-weeks))))) 112 (lambda (x) (and (> x 0) (<= x no-weeks)))))
113 (day (if dayflag (calendar-read 113 (day (if dayflag (calendar-read
114 "ISO day (1-7): " 114 "ISO day (1-7): "
115 '(lambda (x) (and (<= 1 x) (<= x 7)))) 115 (lambda (x) (and (<= 1 x) (<= x 7))))
116 1))) 116 1)))
117 (list (list week day year)))) 117 (list (list week day year))))
118 118
119;;;###autoload
119(defun calendar-goto-iso-date (date &optional noecho) 120(defun calendar-goto-iso-date (date &optional noecho)
120 "Move cursor to ISO DATE; echo ISO date unless NOECHO is t." 121 "Move cursor to ISO DATE; echo ISO date unless NOECHO is t."
121 (interactive (calendar-iso-read-args t)) 122 (interactive (calendar-iso-read-args t))
@@ -123,6 +124,7 @@ Defaults to today's date if DATE is not given."
123 (calendar-absolute-from-iso date))) 124 (calendar-absolute-from-iso date)))
124 (or noecho (calendar-print-iso-date))) 125 (or noecho (calendar-print-iso-date)))
125 126
127;;;###autoload
126(defun calendar-goto-iso-week (date &optional noecho) 128(defun calendar-goto-iso-week (date &optional noecho)
127 "Move cursor to ISO DATE; echo ISO date unless NOECHO is t. 129 "Move cursor to ISO DATE; echo ISO date unless NOECHO is t.
128Interactively, goes to the first day of the specified week." 130Interactively, goes to the first day of the specified week."
@@ -131,11 +133,17 @@ Interactively, goes to the first day of the specified week."
131 (calendar-absolute-from-iso date))) 133 (calendar-absolute-from-iso date)))
132 (or noecho (calendar-print-iso-date))) 134 (or noecho (calendar-print-iso-date)))
133 135
136(defvar date)
137
134(defun diary-iso-date () 138(defun diary-iso-date ()
135 "ISO calendar equivalent of date diary entry." 139 "ISO calendar equivalent of date diary entry."
136 (format "ISO date: %s" (calendar-iso-date-string date))) 140 (format "ISO date: %s" (calendar-iso-date-string date)))
137 141
138(provide 'cal-iso) 142(provide 'cal-iso)
139 143
140;;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6 144;; Local Variables:
145;; generated-autoload-file: "cal-loaddefs.el"
146;; End:
147
148;; arch-tag: 3c0154cc-d30f-4981-9f60-42bdf7a468f6
141;;; cal-iso.el ends here 149;;; cal-iso.el ends here
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index ef7ad67272b..f033e6864d9 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -42,6 +42,7 @@
42 42
43(require 'calendar) 43(require 'calendar)
44 44
45;;;###autoload
45(defun calendar-julian-from-absolute (date) 46(defun calendar-julian-from-absolute (date)
46 "Compute the Julian (month day year) corresponding to the absolute DATE. 47 "Compute the Julian (month day year) corresponding to the absolute DATE.
47The absolute date is the number of days elapsed since the (imaginary) 48The absolute date is the number of days elapsed since the (imaginary)
@@ -82,6 +83,7 @@ The Gregorian date Sunday, December 31, 1 BC is imaginary."
82 (/ (1- year) 4) 83 (/ (1- year) 4)
83 -2))) 84 -2)))
84 85
86;;;###autoload
85(defun calendar-julian-date-string (&optional date) 87(defun calendar-julian-date-string (&optional date)
86 "String of Julian date of Gregorian DATE. 88 "String of Julian date of Gregorian DATE.
87Defaults to today's date if DATE is not given. 89Defaults to today's date if DATE is not given.
@@ -92,19 +94,21 @@ Driven by the variable `calendar-date-display-form'."
92 (or date (calendar-current-date)))) 94 (or date (calendar-current-date))))
93 nil t)) 95 nil t))
94 96
97;;;###autoload
95(defun calendar-print-julian-date () 98(defun calendar-print-julian-date ()
96 "Show the Julian calendar equivalent of the date under the cursor." 99 "Show the Julian calendar equivalent of the date under the cursor."
97 (interactive) 100 (interactive)
98 (message "Julian date: %s" 101 (message "Julian date: %s"
99 (calendar-julian-date-string (calendar-cursor-to-date t)))) 102 (calendar-julian-date-string (calendar-cursor-to-date t))))
100 103
104;;;###autoload
101(defun calendar-goto-julian-date (date &optional noecho) 105(defun calendar-goto-julian-date (date &optional noecho)
102 "Move cursor to Julian DATE; echo Julian date unless NOECHO is t." 106 "Move cursor to Julian DATE; echo Julian date unless NOECHO is t."
103 (interactive 107 (interactive
104 (let* ((today (calendar-current-date)) 108 (let* ((today (calendar-current-date))
105 (year (calendar-read 109 (year (calendar-read
106 "Julian calendar year (>0): " 110 "Julian calendar year (>0): "
107 '(lambda (x) (> x 0)) 111 (lambda (x) (> x 0))
108 (int-to-string 112 (int-to-string
109 (extract-calendar-year 113 (extract-calendar-year
110 (calendar-julian-from-absolute 114 (calendar-julian-from-absolute
@@ -125,7 +129,7 @@ Driven by the variable `calendar-date-display-form'."
125 (day (calendar-read 129 (day (calendar-read
126 (format "Julian calendar day (%d-%d): " 130 (format "Julian calendar day (%d-%d): "
127 (if (and (= year 1) (= month 1)) 3 1) last) 131 (if (and (= year 1) (= month 1)) 3 1) last)
128 '(lambda (x) 132 (lambda (x)
129 (and (< (if (and (= year 1) (= month 1)) 2 0) x) 133 (and (< (if (and (= year 1) (= month 1)) 2 0) x)
130 (<= x last)))))) 134 (<= x last))))))
131 (list (list month day year)))) 135 (list (list month day year))))
@@ -164,14 +168,17 @@ nil if it is not visible in the current calendar window."
164 "Julian calendar equivalent of date diary entry." 168 "Julian calendar equivalent of date diary entry."
165 (format "Julian date: %s" (calendar-julian-date-string date))) 169 (format "Julian date: %s" (calendar-julian-date-string date)))
166 170
171;;;###autoload
167(defun calendar-absolute-from-astro (d) 172(defun calendar-absolute-from-astro (d)
168 "Absolute date of astronomical (Julian) day number D." 173 "Absolute date of astronomical (Julian) day number D."
169 (- d 1721424.5)) 174 (- d 1721424.5))
170 175
176;;;###autoload
171(defun calendar-astro-from-absolute (d) 177(defun calendar-astro-from-absolute (d)
172 "Astronomical (Julian) day number of absolute date D." 178 "Astronomical (Julian) day number of absolute date D."
173 (+ d 1721424.5)) 179 (+ d 1721424.5))
174 180
181;;;###autoload
175(defun calendar-astro-date-string (&optional date) 182(defun calendar-astro-date-string (&optional date)
176 "String of astronomical (Julian) day number after noon UTC of Gregorian DATE. 183 "String of astronomical (Julian) day number after noon UTC of Gregorian DATE.
177Defaults to today's date if DATE is not given." 184Defaults to today's date if DATE is not given."
@@ -181,6 +188,7 @@ Defaults to today's date if DATE is not given."
181 (calendar-absolute-from-gregorian 188 (calendar-absolute-from-gregorian
182 (or date (calendar-current-date))))))) 189 (or date (calendar-current-date)))))))
183 190
191;;;###autoload
184(defun calendar-print-astro-day-number () 192(defun calendar-print-astro-day-number ()
185 "Show astronomical (Julian) day number after noon UTC on date shown by cursor." 193 "Show astronomical (Julian) day number after noon UTC on date shown by cursor."
186 (interactive) 194 (interactive)
@@ -188,12 +196,13 @@ Defaults to today's date if DATE is not given."
188 "Astronomical (Julian) day number (at noon UTC): %s.0" 196 "Astronomical (Julian) day number (at noon UTC): %s.0"
189 (calendar-astro-date-string (calendar-cursor-to-date t)))) 197 (calendar-astro-date-string (calendar-cursor-to-date t))))
190 198
199;;;###autoload
191(defun calendar-goto-astro-day-number (daynumber &optional noecho) 200(defun calendar-goto-astro-day-number (daynumber &optional noecho)
192 "Move cursor to astronomical (Julian) DAYNUMBER. 201 "Move cursor to astronomical (Julian) DAYNUMBER.
193Echo astronomical (Julian) day number unless NOECHO is t." 202Echo astronomical (Julian) day number unless NOECHO is t."
194 (interactive (list (calendar-read 203 (interactive (list (calendar-read
195 "Astronomical (Julian) day number (>1721425): " 204 "Astronomical (Julian) day number (>1721425): "
196 '(lambda (x) (> x 1721425))))) 205 (lambda (x) (> x 1721425)))))
197 (calendar-goto-date 206 (calendar-goto-date
198 (calendar-gregorian-from-absolute 207 (calendar-gregorian-from-absolute
199 (floor 208 (floor
@@ -207,5 +216,9 @@ Echo astronomical (Julian) day number unless NOECHO is t."
207 216
208(provide 'cal-julian) 217(provide 'cal-julian)
209 218
210;;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae 219;; Local Variables:
220;; generated-autoload-file: "cal-loaddefs.el"
221;; End:
222
223;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae
211;;; cal-julian.el ends here 224;;; cal-julian.el ends here