aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-03-16 01:22:58 +0000
committerGlenn Morris2008-03-16 01:22:58 +0000
commitdf3b40c18cb641f3221696720cacf700efdbcef0 (patch)
treea907baa8a40771cb86ce8f82cfef892c26f92434
parent615eabde2a904057a5a541a6a860b10b88c66789 (diff)
downloademacs-df3b40c18cb641f3221696720cacf700efdbcef0.tar.gz
emacs-df3b40c18cb641f3221696720cacf700efdbcef0.zip
(calendar-mod): Remove.
(calendar-for-loop): Add indent spec.
-rw-r--r--lisp/calendar/calendar.el55
1 files changed, 26 insertions, 29 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 53394352123..38fdc4f5d11 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -107,7 +107,9 @@
107;; Bound in diary-list-entries: 107;; Bound in diary-list-entries:
108;; diary-entries-list: use in d-l, appt.el, and by add-to-diary-list 108;; diary-entries-list: use in d-l, appt.el, and by add-to-diary-list
109;; diary-saved-point: only used in diary-lib.el, passed to the display func 109;; diary-saved-point: only used in diary-lib.el, passed to the display func
110;; date-string: only used in diary-lib.el FIXME could be removed? 110;; date-string: only used in diary-lib.el
111;; list-only: don't modify the diary-buffer, just return a list of entries
112;; file-glob-attrs: yuck
111 113
112;;; Code: 114;;; Code:
113 115
@@ -226,7 +228,7 @@ If nil, make an icon of the frame. If non-nil, delete the frame."
226 :weight bold)) 228 :weight bold))
227 "Face for highlighting diary entries." 229 "Face for highlighting diary entries."
228 :group 'diary) 230 :group 'diary)
229;; Backward-compatibility alias. FIXME make obsolete. 231;; Backward-compatibility alias. FIXME make obsolete.
230(put 'diary-face 'face-alias 'diary) 232(put 'diary-face 'face-alias 'diary)
231 233
232(defface holiday 234(defface holiday
@@ -635,17 +637,17 @@ See the documentation of the function `calendar-date-string'."
635(defun european-calendar () 637(defun european-calendar ()
636 "Set the interpretation and display of dates to the European style." 638 "Set the interpretation and display of dates to the European style."
637 (interactive) 639 (interactive)
638 (setq european-calendar-style t) 640 (setq european-calendar-style t
639 (setq calendar-date-display-form european-calendar-display-form) 641 calendar-date-display-form european-calendar-display-form
640 (setq diary-date-forms european-date-diary-pattern) 642 diary-date-forms european-date-diary-pattern)
641 (update-calendar-mode-line)) 643 (update-calendar-mode-line))
642 644
643(defun american-calendar () 645(defun american-calendar ()
644 "Set the interpretation and display of dates to the American style." 646 "Set the interpretation and display of dates to the American style."
645 (interactive) 647 (interactive)
646 (setq european-calendar-style nil) 648 (setq european-calendar-style nil
647 (setq calendar-date-display-form american-calendar-display-form) 649 calendar-date-display-form american-calendar-display-form
648 (setq diary-date-forms american-date-diary-pattern) 650 diary-date-forms american-date-diary-pattern)
649 (update-calendar-mode-line)) 651 (update-calendar-mode-line))
650 652
651;; FIXME move to diary-lib and adjust appt. 653;; FIXME move to diary-lib and adjust appt.
@@ -1207,7 +1209,8 @@ MON defaults to `displayed-month'. YR defaults to `displayed-year'."
1207 "Execute a for loop. 1209 "Execute a for loop.
1208Evaluate BODY with VAR bound to successive integers from INIT to FINAL, 1210Evaluate BODY with VAR bound to successive integers from INIT to FINAL,
1209inclusive. The standard macro `dotimes' is preferable in most cases." 1211inclusive. The standard macro `dotimes' is preferable in most cases."
1210 (declare (debug (symbolp "from" form "to" form "do" body))) 1212 (declare (debug (symbolp "from" form "to" form "do" body))
1213 (indent defun))
1211 `(let ((,var (1- ,init))) 1214 `(let ((,var (1- ,init)))
1212 (while (>= ,final (setq ,var (1+ ,var))) 1215 (while (>= ,final (setq ,var (1+ ,var)))
1213 ,@body))) 1216 ,@body)))
@@ -1837,8 +1840,8 @@ the STRINGS are just concatenated and the result truncated."
1837 (dolist (string strings) 1840 (dolist (string strings)
1838 (setq s (concat s 1841 (setq s (concat s
1839 (make-string (max 0 (/ (+ n i) m)) char) 1842 (make-string (max 0 (/ (+ n i) m)) char)
1840 string)) 1843 string)
1841 (setq i (1+ i))) 1844 i (1+ i)))
1842 (substring s 0 length))) 1845 (substring s 0 length)))
1843 1846
1844(defun update-calendar-mode-line () 1847(defun update-calendar-mode-line ()
@@ -1998,9 +2001,8 @@ handle dates in years BC."
1998(defun calendar-other-month (month year) 2001(defun calendar-other-month (month year)
1999 "Display a three-month calendar centered around MONTH and YEAR." 2002 "Display a three-month calendar centered around MONTH and YEAR."
2000 (interactive (calendar-read-date 'noday)) 2003 (interactive (calendar-read-date 'noday))
2001 (if (and (= month displayed-month) 2004 (unless (and (= month displayed-month)
2002 (= year displayed-year)) 2005 (= year displayed-year))
2003 nil
2004 (let ((old-date (calendar-cursor-to-date)) 2006 (let ((old-date (calendar-cursor-to-date))
2005 (today (calendar-current-date))) 2007 (today (calendar-current-date)))
2006 (generate-calendar-window month year) 2008 (generate-calendar-window month year)
@@ -2242,8 +2244,8 @@ interpreted as BC; -1 being 1 BC, and so on."
2242(defun calendar-unmark () 2244(defun calendar-unmark ()
2243 "Delete all diary/holiday marks/highlighting from the calendar." 2245 "Delete all diary/holiday marks/highlighting from the calendar."
2244 (interactive) 2246 (interactive)
2245 (setq mark-holidays-in-calendar nil) 2247 (setq mark-holidays-in-calendar nil
2246 (setq mark-diary-entries-in-calendar nil) 2248 mark-diary-entries-in-calendar nil)
2247 (redraw-calendar)) 2249 (redraw-calendar))
2248 2250
2249(defun calendar-date-is-visible-p (date) 2251(defun calendar-date-is-visible-p (date)
@@ -2452,22 +2454,22 @@ Defaults to today's date if DATE is not given."
2452 (format "Persian date: %s\n" 2454 (format "Persian date: %s\n"
2453 (calendar-persian-date-string date)) 2455 (calendar-persian-date-string date))
2454 (let ((i (calendar-islamic-date-string date))) 2456 (let ((i (calendar-islamic-date-string date)))
2455 (if (not (string-equal i "")) 2457 (unless (string-equal i "")
2456 (format "Islamic date (before sunset): %s\n" i))) 2458 (format "Islamic date (before sunset): %s\n" i)))
2457 (let ((b (calendar-bahai-date-string date))) 2459 (let ((b (calendar-bahai-date-string date)))
2458 (if (not (string-equal b "")) 2460 (unless (string-equal b "")
2459 (format "Baha'i date (before sunset): %s\n" b))) 2461 (format "Baha'i date (before sunset): %s\n" b)))
2460 (format "Chinese date: %s\n" 2462 (format "Chinese date: %s\n"
2461 (calendar-chinese-date-string date)) 2463 (calendar-chinese-date-string date))
2462 (let ((c (calendar-coptic-date-string date))) 2464 (let ((c (calendar-coptic-date-string date)))
2463 (if (not (string-equal c "")) 2465 (unless (string-equal c "")
2464 (format "Coptic date: %s\n" c))) 2466 (format "Coptic date: %s\n" c)))
2465 (let ((e (calendar-ethiopic-date-string date))) 2467 (let ((e (calendar-ethiopic-date-string date)))
2466 (if (not (string-equal e "")) 2468 (unless (string-equal e "")
2467 (format "Ethiopic date: %s\n" e))) 2469 (format "Ethiopic date: %s\n" e)))
2468 (let ((f (calendar-french-date-string date))) 2470 (let ((f (calendar-french-date-string date)))
2469 (if (not (string-equal f "")) 2471 (unless (string-equal f "")
2470 (format "French Revolutionary date: %s\n" f))) 2472 (format "French Revolutionary date: %s\n" f)))
2471 (format "Mayan date: %s\n" 2473 (format "Mayan date: %s\n"
2472 (calendar-mayan-date-string date))))) 2474 (calendar-mayan-date-string date)))))
2473 (goto-char (point-min)) 2475 (goto-char (point-min))
@@ -2491,11 +2493,6 @@ Defaults to today's date if DATE is not given."
2491 "---") 2493 "---")
2492 (calendar-string-spread (list str) ?- width))))) 2494 (calendar-string-spread (list str) ?- width)))))
2493 2495
2494(defun calendar-mod (m n)
2495 "Non-negative remainder of M/N with N instead of 0."
2496 (1+ (mod (1- m) n)))
2497
2498
2499(defun calendar-version () 2496(defun calendar-version ()
2500 "Display the Calendar version." 2497 "Display the Calendar version."
2501 (interactive) 2498 (interactive)