changeset 93025:1e3b2cf969d4

(list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace previous code and disable undo.
author Glenn Morris <rgm@gnu.org>
date Mon, 17 Mar 2008 02:21:37 +0000
parents efee212e0b17
children 8e1a78482251
files lisp/calendar/cal-hebrew.el
diffstat 1 files changed, 18 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-hebrew.el	Mon Mar 17 02:20:49 2008 +0000
+++ b/lisp/calendar/cal-hebrew.el	Mon Mar 17 02:21:37 2008 +0000
@@ -687,32 +687,24 @@
          (h-month (extract-calendar-month h-date))
          (h-day (extract-calendar-day h-date))
          (h-year (extract-calendar-year h-date)))
-    (set-buffer (get-buffer-create cal-hebrew-yahrzeit-buffer))
-    (setq buffer-read-only nil)
-    (calendar-set-mode-line
-     (format "Yahrzeit dates for %s = %s"
-             (calendar-date-string death-date)
-             (let ((calendar-month-name-array
-                    (if (hebrew-calendar-leap-year-p h-year)
-                        calendar-hebrew-month-name-array-leap-year
-                      calendar-hebrew-month-name-array-common-year)))
-               (calendar-date-string h-date nil t))))
-    (erase-buffer)
-    (goto-char (point-min))
-    (calendar-for-loop i from start-year to end-year do
-                       (insert
-                        (calendar-date-string
-                         (calendar-gregorian-from-absolute
-                          (hebrew-calendar-yahrzeit
-                           h-date
-                           (extract-calendar-year
-                            (calendar-hebrew-from-absolute
-                             (calendar-absolute-from-gregorian
-                              (list 1 1 i))))))) "\n"))
-    (goto-char (point-min))
-    (set-buffer-modified-p nil)
-    (setq buffer-read-only t)
-    (display-buffer cal-hebrew-yahrzeit-buffer)
+    (calendar-in-read-only-buffer cal-hebrew-yahrzeit-buffer
+      (calendar-set-mode-line
+       (format "Yahrzeit dates for %s = %s"
+               (calendar-date-string death-date)
+               (let ((calendar-month-name-array
+                      (if (hebrew-calendar-leap-year-p h-year)
+                          calendar-hebrew-month-name-array-leap-year
+                        calendar-hebrew-month-name-array-common-year)))
+                 (calendar-date-string h-date nil t))))
+      (calendar-for-loop i from start-year to end-year do
+        (insert
+         (calendar-date-string
+          (calendar-gregorian-from-absolute
+           (hebrew-calendar-yahrzeit
+            h-date
+            (extract-calendar-year
+             (calendar-hebrew-from-absolute
+              (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n")))
     (message "Computing Yahrzeits...done")))
 
 (defvar date)