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/holidays.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/holidays.el,v
Date: Mon, 17 Mar 2008 02:20:49 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/03/17 02:20:49

Index: holidays.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/holidays.el,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- holidays.el 15 Mar 2008 02:55:45 -0000      1.63
+++ holidays.el 17 Mar 2008 02:20:49 -0000      1.64
@@ -90,8 +90,7 @@
         (progn
           (message "Looking up holidays...none found")
           nil)
-      (set-buffer (get-buffer-create holiday-buffer))
-      (setq buffer-read-only nil)
+      (calendar-in-read-only-buffer holiday-buffer
       (increment-calendar-month m1 y1 -1)
       (increment-calendar-month m2 y2 1)
       (calendar-set-mode-line
@@ -100,16 +99,11 @@
                    (calendar-month-name m1) (calendar-month-name m2) y2)
          (format "Notable Dates from %s, %d to %s, %d%%-"
                  (calendar-month-name m1) y1 (calendar-month-name m2) y2)))
-      (erase-buffer)
       (insert
        (mapconcat
         (lambda (x) (concat (calendar-date-string (car x))
                             ": " (cadr x)))
-        holiday-list "\n"))
-      (goto-char (point-min))
-      (set-buffer-modified-p nil)
-      (setq buffer-read-only t)
-      (display-buffer holiday-buffer)
+          holiday-list "\n")))
       (message "Looking up holidays...done")
       t)))
 
@@ -204,29 +198,22 @@
          (displayed-month 2)
          (displayed-year y1))
     (while (or never (<= d e))
-      (setq holiday-list (append holiday-list (calendar-holiday-list)))
-      (setq never nil)
+      (setq holiday-list (append holiday-list (calendar-holiday-list))
+            never nil)
       (increment-calendar-month displayed-month displayed-year 3)
       (setq d (calendar-absolute-from-gregorian
                (list displayed-month 1 displayed-year))))
     (save-excursion
-      (set-buffer (get-buffer-create holiday-buffer))
-      (setq buffer-read-only nil)
+      (calendar-in-read-only-buffer holiday-buffer
       (calendar-set-mode-line
        (if (= y1 y2)
            (format "%s for %s" title y1)
          (format "%s for %s-%s" title y1 y2)))
-      (erase-buffer)
-      (goto-char (point-min))
       (insert
        (mapconcat
         (lambda (x) (concat (calendar-date-string (car x))
                             ": " (cadr x)))
-        holiday-list "\n"))
-      (goto-char (point-min))
-      (set-buffer-modified-p nil)
-      (setq buffer-read-only t)
-      (display-buffer holiday-buffer)
+          holiday-list "\n")))
       (message "Computing holidays...done"))))
 
 ;;;###autoload
@@ -262,15 +249,9 @@
         (message "No holidays known for %s" date-string)
       (if (<= (length msg) (frame-width))
           (message "%s" msg)
-        (set-buffer (get-buffer-create holiday-buffer))
-        (setq buffer-read-only nil)
+        (calendar-in-read-only-buffer holiday-buffer
         (calendar-set-mode-line date-string)
-        (erase-buffer)
-        (insert (mapconcat 'identity holiday-list "\n"))
-        (goto-char (point-min))
-        (set-buffer-modified-p nil)
-        (setq buffer-read-only t)
-        (display-buffer holiday-buffer)
+          (insert (mapconcat 'identity holiday-list "\n")))
         (message "Checking holidays...done")))))
 
 ;;;###cal-autoload




reply via email to

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