comparison lisp/calendar/cal-persia.el @ 93487:426872139a89

(Commentary): Point to calendar.el. (calendar-persian-date-string): Reduce nesting of some lets.
author Glenn Morris <rgm@gnu.org>
date Tue, 01 Apr 2008 02:43:30 +0000
parents da8dabfafecc
children 05a344ce267f
comparison
equal deleted inserted replaced
93486:b9615f927009 93487:426872139a89
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, USA. 26 ;; Boston, MA 02110-1301, USA.
27 27
28 ;;; Commentary: 28 ;;; Commentary:
29 29
30 ;; This collection of functions implements the features of calendar.el and 30 ;; See calendar.el.
31 ;; diary.el that deal with the Persian calendar.
32 31
33 ;;; Code: 32 ;;; Code:
34 33
35 (require 'calendar) 34 (require 'calendar)
36 35
146 "String of Persian date of Gregorian DATE, default today." 145 "String of Persian date of Gregorian DATE, default today."
147 (let* ((persian-date (calendar-persian-from-absolute 146 (let* ((persian-date (calendar-persian-from-absolute
148 (calendar-absolute-from-gregorian 147 (calendar-absolute-from-gregorian
149 (or date (calendar-current-date))))) 148 (or date (calendar-current-date)))))
150 (y (extract-calendar-year persian-date)) 149 (y (extract-calendar-year persian-date))
151 (m (extract-calendar-month persian-date))) 150 (m (extract-calendar-month persian-date))
152 (let ((monthname (aref persian-calendar-month-name-array (1- m))) 151 (monthname (aref persian-calendar-month-name-array (1- m)))
153 (day (int-to-string (extract-calendar-day persian-date))) 152 (day (int-to-string (extract-calendar-day persian-date)))
154 (dayname nil) 153 (year (int-to-string y))
155 (month (int-to-string m)) 154 (month (int-to-string m))
156 (year (int-to-string y))) 155 dayname)
157 (mapconcat 'eval calendar-date-display-form "")))) 156 (mapconcat 'eval calendar-date-display-form "")))
158 157
159 ;;;###cal-autoload 158 ;;;###cal-autoload
160 (defun calendar-print-persian-date () 159 (defun calendar-print-persian-date ()
161 "Show the Persian calendar equivalent of the selected date." 160 "Show the Persian calendar equivalent of the selected date."
162 (interactive) 161 (interactive)