changeset 5830:6bcdc3ad365d

(insert-diary-entry,insert-weekly-diary-entry, insert-monthly-diary-entry,insert-yearly-diary-entry, insert-anniversary-diary-entry,insert-block-diary-entry, insert-cyclic-diary-entry,insert-hebrew-diary-entry, insert-monthly-hebrew-diary-entry,insert-yearly-hebrew-diary-entry, insert-islamic-diary-entry,insert-monthly-islamic-diary-entry, insert-yearly-islamic-diary-entry): Use new error arg to calendar-cursor-to-date.
author Richard M. Stallman <rms@gnu.org>
date Mon, 07 Feb 1994 20:47:23 +0000
parents d266967cc1cc
children 7a4647230b22
files lisp/=diary-ins.el
diffstat 1 files changed, 18 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/=diary-ins.el	Mon Feb 07 20:42:44 1994 +0000
+++ b/lisp/=diary-ins.el	Mon Feb 07 20:47:23 1994 +0000
@@ -1,6 +1,6 @@
 ;;; diary-ins.el --- calendar functions for adding diary entries.
 
-;; Copyright (C) 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1994 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Keywords: diary, calendar
@@ -52,22 +52,15 @@
   "Insert a diary entry for the date indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
-  (make-diary-entry
-   (calendar-date-string
-    (or (calendar-cursor-to-date)
-        (error "Cursor is not on a date!"))
-    t t)
-   arg))
+  (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t t)
+                    arg))
 
 (defun insert-weekly-diary-entry (arg)
   "Insert a weekly diary entry for the day of the week indicated by point.
 Prefix arg will make the entry nonmarking."
   (interactive "P")
-  (make-diary-entry
-   (calendar-day-name
-    (or (calendar-cursor-to-date)
-        (error "Cursor is not on a date!")))
-   arg))
+  (make-diary-entry (calendar-day-name (calendar-cursor-to-date t))
+                    arg))
 
 (defun insert-monthly-diary-entry (arg)
   "Insert a monthly diary entry for the day of the month indicated by point.
@@ -77,12 +70,8 @@
           (if european-calendar-style
               '(day " * ")
             '("* " day))))
-    (make-diary-entry
-     (calendar-date-string
-      (or (calendar-cursor-to-date)
-          (error "Cursor is not on a date!"))
-      t)
-     arg)))
+    (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
+                      arg)))
 
 (defun insert-yearly-diary-entry (arg)
   "Insert an annual diary entry for the day of the year indicated by point.
@@ -92,12 +81,8 @@
           (if european-calendar-style
               '(day " " monthname)
             '(monthname " " day))))
-    (make-diary-entry
-     (calendar-date-string
-      (or (calendar-cursor-to-date)
-          (error "Cursor is not on a date!"))
-      t)
-     arg)))
+    (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
+                      arg)))
 
 (defun insert-anniversary-diary-entry (arg)
   "Insert an anniversary diary entry for the date given by point.
@@ -110,10 +95,7 @@
     (make-diary-entry
      (format "%s(diary-anniversary %s)"
              sexp-diary-entry-symbol
-             (calendar-date-string
-              (or (calendar-cursor-to-date)
-                  (error "Cursor is not on a date!"))
-              nil t))
+             (calendar-date-string (calendar-cursor-to-date t) nil t))
      arg)))
 
 (defun insert-block-diary-entry (arg)
@@ -124,8 +106,7 @@
           (if european-calendar-style
               '(day " " month " " year)
             '(month " " day " " year)))
-         (cursor (or (calendar-cursor-to-date)
-                     (error "Cursor is not on a date!")))
+         (cursor (calendar-cursor-to-date t))
          (mark (or (car calendar-mark-ring)
                    (error "No mark set in this buffer")))
          (start)
@@ -156,10 +137,7 @@
              sexp-diary-entry-symbol
              (calendar-read "Repeat every how many days: "
                             '(lambda (x) (> x 0)))
-             (calendar-date-string
-              (or (calendar-cursor-to-date)
-                  (error "Cursor is not on a date!"))
-              nil t))
+             (calendar-date-string (calendar-cursor-to-date t) nil t))
      arg)))
 
 (defun insert-hebrew-diary-entry (arg)
@@ -175,8 +153,7 @@
       (calendar-date-string 
        (calendar-hebrew-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))
+         (calendar-cursor-to-date t)))
        nil t))
      arg)))
 
@@ -195,8 +172,7 @@
       (calendar-date-string 
        (calendar-hebrew-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))))
+         (calendar-cursor-to-date t)))))
      arg)))
 
 (defun insert-yearly-hebrew-diary-entry (arg)
@@ -216,8 +192,7 @@
       (calendar-date-string 
        (calendar-hebrew-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))))
+         (calendar-cursor-to-date t)))))
      arg)))
 
 (defun insert-islamic-diary-entry (arg)
@@ -232,8 +207,7 @@
       (calendar-date-string 
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))
+         (calendar-cursor-to-date t)))
        nil t))
      arg)))
 
@@ -251,8 +225,7 @@
       (calendar-date-string 
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))))
+         (calendar-cursor-to-date t)))))
      arg)))
 
 (defun insert-yearly-islamic-diary-entry (arg)
@@ -271,8 +244,7 @@
       (calendar-date-string 
        (calendar-islamic-from-absolute
         (calendar-absolute-from-gregorian
-         (or (calendar-cursor-to-date)
-             (error "Cursor is not on a date!"))))))
+         (calendar-cursor-to-date t)))))
      arg)))
 
 (provide 'diary-ins)