annotate lisp/calendar/diary-ins.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; diary-ins.el --- calendar functions for adding diary entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1990, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: diary, calendar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
23 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; This collection of functions implements the diary insertion features as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; described in calendar.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; Comments, corrections, and improvements should be sent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Edward M. Reingold Department of Computer Science
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Urbana, Illinois 61801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (require 'diary-lib)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defun make-diary-entry (string &optional nonmarking file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 "Insert a diary entry STRING which may be NONMARKING in FILE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (find-file-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (substitute-in-file-name (if file file diary-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (if (bolp) "" "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (if nonmarking diary-nonmarking-symbol "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 string " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (defun insert-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 "Insert a diary entry for the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defun insert-weekly-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "Insert a weekly diary entry for the day of the week indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (make-diary-entry (calendar-day-name (calendar-cursor-to-date t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defun insert-monthly-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "Insert a monthly diary entry for the day of the month indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 '(day " * ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 '("* " day))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (defun insert-yearly-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 "Insert an annual diary entry for the day of the year indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 '(day " " monthname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 '(monthname " " day))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defun insert-anniversary-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 "Insert an anniversary diary entry for the date given by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 '(day " " month " " year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 '(month " " day " " year))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (format "%s(diary-anniversary %s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 sexp-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (calendar-date-string (calendar-cursor-to-date t) nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defun insert-block-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 "Insert a block diary entry for the days between the point and marked date.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 '(day " " month " " year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 '(month " " day " " year)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (cursor (calendar-cursor-to-date t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (mark (or (car calendar-mark-ring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (error "No mark set in this buffer")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (if (< (calendar-absolute-from-gregorian mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (calendar-absolute-from-gregorian cursor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (setq start mark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 end cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (setq start cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 end mark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (format "%s(diary-block %s %s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 sexp-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (calendar-date-string start nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (calendar-date-string end nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (defun insert-cyclic-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 "Insert a cyclic diary entry starting at the date given by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 '(day " " month " " year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 '(month " " day " " year))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (format "%s(diary-cyclic %d %s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 sexp-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (calendar-read "Repeat every how many days: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 '(lambda (x) (> x 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (calendar-date-string (calendar-cursor-to-date t) nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (defun insert-hebrew-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 "Insert a diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 For the Hebrew date corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (let* ((calendar-month-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 calendar-hebrew-month-name-array-leap-year))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 hebrew-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (calendar-hebrew-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (calendar-cursor-to-date t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defun insert-monthly-hebrew-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "Insert a monthly diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 For the day of the Hebrew month corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (if european-calendar-style '(day " * ") '("* " day )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (calendar-month-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 calendar-hebrew-month-name-array-leap-year))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 hebrew-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (calendar-hebrew-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (calendar-cursor-to-date t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (defun insert-yearly-hebrew-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "Insert an annual diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 For the day of the Hebrew year corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 '(day " " monthname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 '(monthname " " day)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (calendar-month-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 calendar-hebrew-month-name-array-leap-year))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 hebrew-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (calendar-hebrew-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (calendar-cursor-to-date t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (defun insert-islamic-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "Insert a diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 For the Islamic date corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (let* ((calendar-month-name-array calendar-islamic-month-name-array))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 islamic-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (calendar-islamic-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (calendar-cursor-to-date t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defun insert-monthly-islamic-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 "Insert a monthly diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 For the day of the Islamic month corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (if european-calendar-style '(day " * ") '("* " day )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (calendar-month-name-array calendar-islamic-month-name-array))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 islamic-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (calendar-islamic-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (calendar-cursor-to-date t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (defun insert-yearly-islamic-diary-entry (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 "Insert an annual diary entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 For the day of the Islamic year corresponding to the date indicated by point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 Prefix arg will make the entry nonmarking."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (let* ((calendar-date-display-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (if european-calendar-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 '(day " " monthname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 '(monthname " " day)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (calendar-month-name-array calendar-islamic-month-name-array))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (make-diary-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 islamic-diary-entry-symbol
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (calendar-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (calendar-islamic-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (calendar-cursor-to-date t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 arg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (provide 'diary-ins)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ;;; diary-ins.el ends here