emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/calendar.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/calendar.el,v
Date: Sun, 16 Mar 2008 01:22:59 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/03/16 01:22:59

Index: calendar.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/calendar.el,v
retrieving revision 1.225
retrieving revision 1.226
diff -u -b -r1.225 -r1.226
--- calendar.el 15 Mar 2008 03:00:17 -0000      1.225
+++ calendar.el 16 Mar 2008 01:22:58 -0000      1.226
@@ -107,7 +107,9 @@
 ;; Bound in diary-list-entries:
 ;; diary-entries-list: use in d-l, appt.el, and by add-to-diary-list
 ;; diary-saved-point: only used in diary-lib.el, passed to the display func
-;; date-string: only used in diary-lib.el FIXME could be removed?
+;; date-string: only used in diary-lib.el
+;; list-only: don't modify the diary-buffer, just return a list of entries
+;; file-glob-attrs: yuck
 
 ;;; Code:
 
@@ -635,17 +637,17 @@
 (defun european-calendar ()
   "Set the interpretation and display of dates to the European style."
   (interactive)
-  (setq european-calendar-style t)
-  (setq calendar-date-display-form european-calendar-display-form)
-  (setq diary-date-forms european-date-diary-pattern)
+  (setq european-calendar-style t
+        calendar-date-display-form european-calendar-display-form
+        diary-date-forms european-date-diary-pattern)
   (update-calendar-mode-line))
 
 (defun american-calendar ()
   "Set the interpretation and display of dates to the American style."
   (interactive)
-  (setq european-calendar-style nil)
-  (setq calendar-date-display-form american-calendar-display-form)
-  (setq diary-date-forms american-date-diary-pattern)
+  (setq european-calendar-style nil
+        calendar-date-display-form american-calendar-display-form
+        diary-date-forms american-date-diary-pattern)
   (update-calendar-mode-line))
 
 ;; FIXME move to diary-lib and adjust appt.
@@ -1207,7 +1209,8 @@
   "Execute a for loop.
 Evaluate BODY with VAR bound to successive integers from INIT to FINAL,
 inclusive.  The standard macro `dotimes' is preferable in most cases."
-  (declare (debug (symbolp "from" form "to" form "do" body)))
+  (declare (debug (symbolp "from" form "to" form "do" body))
+           (indent defun))
   `(let ((,var (1- ,init)))
     (while (>= ,final (setq ,var (1+ ,var)))
       ,@body)))
@@ -1837,8 +1840,8 @@
     (dolist (string strings)
       (setq s (concat s
                       (make-string (max 0 (/ (+ n i) m)) char)
-                      string))
-      (setq i (1+ i)))
+                      string)
+            i (1+ i)))
     (substring s 0 length)))
 
 (defun update-calendar-mode-line ()
@@ -1998,9 +2001,8 @@
 (defun calendar-other-month (month year)
   "Display a three-month calendar centered around MONTH and YEAR."
   (interactive (calendar-read-date 'noday))
-  (if (and (= month displayed-month)
+  (unless (and (= month displayed-month)
            (= year displayed-year))
-      nil
     (let ((old-date (calendar-cursor-to-date))
           (today (calendar-current-date)))
       (generate-calendar-window month year)
@@ -2242,8 +2244,8 @@
 (defun calendar-unmark ()
   "Delete all diary/holiday marks/highlighting from the calendar."
   (interactive)
-  (setq mark-holidays-in-calendar nil)
-  (setq mark-diary-entries-in-calendar nil)
+  (setq mark-holidays-in-calendar nil
+        mark-diary-entries-in-calendar nil)
   (redraw-calendar))
 
 (defun calendar-date-is-visible-p (date)
@@ -2452,21 +2454,21 @@
                 (format "Persian date: %s\n"
                         (calendar-persian-date-string date))
                 (let ((i (calendar-islamic-date-string date)))
-                  (if (not (string-equal i ""))
+                  (unless (string-equal i "")
                       (format "Islamic date (before sunset): %s\n" i)))
                 (let ((b (calendar-bahai-date-string date)))
-                  (if (not (string-equal b ""))
+                  (unless (string-equal b "")
                       (format "Baha'i date (before sunset): %s\n" b)))
                 (format "Chinese date: %s\n"
                         (calendar-chinese-date-string date))
                 (let ((c (calendar-coptic-date-string date)))
-                  (if (not (string-equal c ""))
+                  (unless (string-equal c "")
                       (format "Coptic date: %s\n" c)))
                 (let ((e (calendar-ethiopic-date-string date)))
-                  (if (not (string-equal e ""))
+                  (unless (string-equal e "")
                       (format "Ethiopic date: %s\n" e)))
                 (let ((f (calendar-french-date-string date)))
-                  (if (not (string-equal f ""))
+                  (unless (string-equal f "")
                       (format "French Revolutionary date: %s\n" f)))
                 (format "Mayan date: %s\n"
                         (calendar-mayan-date-string date)))))
@@ -2491,11 +2493,6 @@
                 "---")
             (calendar-string-spread (list str) ?- width)))))
 
-(defun calendar-mod (m n)
-  "Non-negative remainder of M/N with N instead of 0."
-  (1+ (mod (1- m) n)))
-
-
 (defun calendar-version ()
   "Display the Calendar version."
   (interactive)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]