annotate lisp/=diary-ins.el @ 4477:7101a887f80d

(do-auto-fill): Don't keep breaking the line if it doesn't help matters.
author Richard M. Stallman <rms@gnu.org>
date Sat, 07 Aug 1993 08:19:18 +0000
parents a400864e4e37
children 6bcdc3ad365d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2326
cac023fe9d13 * diary-insert.el: Change the name to diary-ins.el.
Jim Blandy <jimb@redhat.com>
parents: 2166
diff changeset
1 ;;; diary-ins.el --- calendar functions for adding diary entries.
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 ;; Copyright (C) 1990 Free Software Foundation, Inc.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 ;; Keywords: diary, calendar
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; GNU Emacs is distributed in the hope that it will be useful,
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; but WITHOUT ANY WARRANTY. No author or distributor
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;; accepts responsibility to anyone for the consequences of using it
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; or for whether it serves any particular purpose or works at all,
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; unless he says so in writing. Refer to the GNU Emacs General Public
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; License for full details.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; Everyone is granted permission to copy, modify and redistribute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU Emacs, but only under the conditions described in the
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; GNU Emacs General Public License. A copy of this license is
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; supposed to have been given to you along with GNU Emacs so you
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; can know your rights and responsibilities. It should be in a
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; file named COPYING. Among other things, the copyright notice
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 ;; and this notice must be preserved on all copies.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 ;;; Commentary:
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;; This collection of functions implements the diary insertion features as
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;; described in calendar.el.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; Comments, corrections, and improvements should be sent to
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 ;; Edward M. Reingold Department of Computer Science
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 ;; Urbana, Illinois 61801
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 ;;; Code:
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 (require 'diary)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (defun make-diary-entry (string &optional nonmarking file)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 "Insert a diary entry STRING which may be NONMARKING in FILE.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 (find-file-other-window
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (substitute-in-file-name (if file file diary-file)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (goto-char (point-max))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 (insert
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 (if (bolp) "" "\n")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 (if nonmarking diary-nonmarking-symbol "")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 string " "))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (defun insert-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 "Insert a diary entry for the date indicated by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (error "Cursor is not on a date!"))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 t t)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 arg))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 (defun insert-weekly-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 "Insert a weekly diary entry for the day of the week indicated by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 (calendar-day-name
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 (error "Cursor is not on a date!")))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 arg))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 (defun insert-monthly-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 "Insert a monthly diary entry for the day of the month indicated by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (if european-calendar-style
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 '(day " * ")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 '("* " day))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 (error "Cursor is not on a date!"))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 t)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 (defun insert-yearly-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 "Insert an annual diary entry for the day of the year indicated by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 (if european-calendar-style
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 '(day " " monthname)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 '(monthname " " day))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 (error "Cursor is not on a date!"))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 t)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 (defun insert-anniversary-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 "Insert an anniversary diary entry for the date given by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 (interactive "P")
2166
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
106 (let* ((calendar-date-display-form
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
107 (if european-calendar-style
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
108 '(day " " month " " year)
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
109 '(month " " day " " year))))
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
110 (make-diary-entry
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
111 (format "%s(diary-anniversary %s)"
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
112 sexp-diary-entry-symbol
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
113 (calendar-date-string
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
114 (or (calendar-cursor-to-date)
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
115 (error "Cursor is not on a date!"))
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
116 nil t))
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
117 arg)))
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 (defun insert-block-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 "Insert a block diary entry for the days between the point and marked date.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 (interactive "P")
2166
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
123 (let* ((calendar-date-display-form
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
124 (if european-calendar-style
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
125 '(day " " month " " year)
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
126 '(month " " day " " year)))
878f67b482b1 * diary-insert.el (insert-anniversary-diary-entry,
Jim Blandy <jimb@redhat.com>
parents: 1356
diff changeset
127 (cursor (or (calendar-cursor-to-date)
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 (error "Cursor is not on a date!")))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 (mark (or (car calendar-mark-ring)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 (error "No mark set in this buffer")))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 (start)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (end))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 (if (< (calendar-absolute-from-gregorian mark)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 (calendar-absolute-from-gregorian cursor))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (setq start mark
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 end cursor)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 (setq start cursor
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 end mark))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 (format "%s(diary-block %s %s)"
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 sexp-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (calendar-date-string start nil t)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 (calendar-date-string end nil t))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 (defun insert-cyclic-diary-entry (arg)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 "Insert a cyclic diary entry starting at the date given by point.
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 Prefix arg will make the entry nonmarking."
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 (interactive "P")
3868
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
150 (let* ((calendar-date-display-form
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
151 (if european-calendar-style
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
152 '(day " " month " " year)
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
153 '(month " " day " " year))))
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
154 (make-diary-entry
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
155 (format "%s(diary-cyclic %d %s)"
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
156 sexp-diary-entry-symbol
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
157 (calendar-read "Repeat every how many days: "
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
158 '(lambda (x) (> x 0)))
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
159 (calendar-date-string
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
160 (or (calendar-cursor-to-date)
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
161 (error "Cursor is not on a date!"))
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
162 nil t))
a400864e4e37 * diary-ins.el (insert-cyclic-diary-entry): Fix date form.
Jim Blandy <jimb@redhat.com>
parents: 2326
diff changeset
163 arg)))
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 (defun insert-hebrew-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
166 "Insert a diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
167 For the Hebrew date corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
168 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 (let* ((calendar-month-name-array
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 calendar-hebrew-month-name-array-leap-year))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 hebrew-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 (calendar-hebrew-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 (error "Cursor is not on a date!"))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 nil t))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 (defun insert-monthly-hebrew-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
184 "Insert a monthly diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
185 For the day of the Hebrew month corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
186 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 (if european-calendar-style '(day " * ") '("* " day )))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 (calendar-month-name-array
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 calendar-hebrew-month-name-array-leap-year))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 hebrew-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 (calendar-hebrew-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 (error "Cursor is not on a date!"))))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 (defun insert-yearly-hebrew-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
203 "Insert an annual diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
204 For the day of the Hebrew year corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
205 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 (if european-calendar-style
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 '(day " " monthname)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 '(monthname " " day)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 (calendar-month-name-array
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 calendar-hebrew-month-name-array-leap-year))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 hebrew-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 (calendar-hebrew-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (error "Cursor is not on a date!"))))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (defun insert-islamic-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
224 "Insert a diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
225 For the Islamic date corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
226 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 (let* ((calendar-month-name-array calendar-islamic-month-name-array))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 islamic-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (calendar-islamic-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (error "Cursor is not on a date!"))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 nil t))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (defun insert-monthly-islamic-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
241 "Insert a monthly diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
242 For the day of the Islamic month corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
243 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 (if european-calendar-style '(day " * ") '("* " day )))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (calendar-month-name-array calendar-islamic-month-name-array))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 islamic-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 (calendar-islamic-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (error "Cursor is not on a date!"))))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (defun insert-yearly-islamic-diary-entry (arg)
1356
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
259 "Insert an annual diary entry.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
260 For the day of the Islamic year corresponding to the date indicated by point.
dcf780f7ae1b Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 957
diff changeset
261 Prefix arg will make the entry nonmarking."
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (interactive "P")
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (let* ((calendar-date-display-form
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (if european-calendar-style
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 '(day " " monthname)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 '(monthname " " day)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (calendar-month-name-array calendar-islamic-month-name-array))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 (make-diary-entry
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 (concat
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 islamic-diary-entry-symbol
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (calendar-date-string
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (calendar-islamic-from-absolute
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 (calendar-absolute-from-gregorian
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 (or (calendar-cursor-to-date)
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (error "Cursor is not on a date!"))))))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 arg)))
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277
2326
cac023fe9d13 * diary-insert.el: Change the name to diary-ins.el.
Jim Blandy <jimb@redhat.com>
parents: 2166
diff changeset
278 (provide 'diary-ins)
957
2619b7a9c11e entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279
2326
cac023fe9d13 * diary-insert.el: Change the name to diary-ins.el.
Jim Blandy <jimb@redhat.com>
parents: 2166
diff changeset
280 ;;; diary-ins.el ends here