comparison lisp/calendar/cal-persia.el @ 93186:3c66b698cc43

(calendar-persian-read-date): New name for persian-prompt-for-date. Update callers, make old name an obsolete alias. Doc fix. Move definition before use.
author Glenn Morris <rgm@gnu.org>
date Tue, 25 Mar 2008 03:42:01 +0000
parents eaaa58ed78d4
children da8dabfafecc
comparison
equal deleted inserted replaced
93185:5a7437fafea3 93186:3c66b698cc43
157 "Show the Persian calendar equivalent of the selected date." 157 "Show the Persian calendar equivalent of the selected date."
158 (interactive) 158 (interactive)
159 (message "Persian date: %s" 159 (message "Persian date: %s"
160 (calendar-persian-date-string (calendar-cursor-to-date t)))) 160 (calendar-persian-date-string (calendar-cursor-to-date t))))
161 161
162 ;;;###cal-autoload 162 (defun calendar-persian-read-date ()
163 (defun calendar-goto-persian-date (date &optional noecho) 163 "Interactively read the arguments for a Persian date command.
164 "Move cursor to Persian date DATE. 164 Reads a year, month, and day."
165 Echo Persian date unless NOECHO is non-nil."
166 (interactive (persian-prompt-for-date))
167 (calendar-goto-date (calendar-gregorian-from-absolute
168 (calendar-absolute-from-persian date)))
169 (or noecho (calendar-print-persian-date)))
170
171 (defun persian-prompt-for-date ()
172 "Ask for a Persian date."
173 (let* ((year (calendar-read 165 (let* ((year (calendar-read
174 "Persian calendar year (not 0): " 166 "Persian calendar year (not 0): "
175 (lambda (x) (not (zerop x))) 167 (lambda (x) (not (zerop x)))
176 (int-to-string 168 (int-to-string
177 (extract-calendar-year 169 (extract-calendar-year
191 (day (calendar-read 183 (day (calendar-read
192 (format "Persian calendar day (1-%d): " last) 184 (format "Persian calendar day (1-%d): " last)
193 (lambda (x) (and (< 0 x) (<= x last)))))) 185 (lambda (x) (and (< 0 x) (<= x last))))))
194 (list (list month day year)))) 186 (list (list month day year))))
195 187
188 (define-obsolete-function-alias
189 'persian-prompt-for-date 'calendar-persian-read-date "23.1")
190
191 ;;;###cal-autoload
192 (defun calendar-goto-persian-date (date &optional noecho)
193 "Move cursor to Persian date DATE.
194 Echo Persian date unless NOECHO is non-nil."
195 (interactive (calendar-persian-read-date))
196 (calendar-goto-date (calendar-gregorian-from-absolute
197 (calendar-absolute-from-persian date)))
198 (or noecho (calendar-print-persian-date)))
199
196 (defvar date) 200 (defvar date)
197 201
198 ;; To be called from list-sexp-diary-entries, where DATE is bound. 202 ;; To be called from list-sexp-diary-entries, where DATE is bound.
199 ;;;###diary-autoload 203 ;;;###diary-autoload
200 (defun diary-persian-date () 204 (defun diary-persian-date ()