• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/calendar/

Lines Matching +defs:calendar +defs:mode +defs:map

1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
9 ;; Keywords: calendar
10 ;; Human-Keywords: calendar, popup menus, menu bar
32 ;; calendar.el.
39 ;; Don't require calendar because calendar requires us.
40 ;; (eval-when-compile (require 'calendar))
41 (defvar calendar-mode-map)
43 (define-key calendar-mode-map [menu-bar edit] 'undefined)
44 (define-key calendar-mode-map [menu-bar search] 'undefined)
46 (define-key calendar-mode-map [down-mouse-2] 'calendar-mouse-2-date-menu)
47 (define-key calendar-mode-map [mouse-2] 'ignore)
49 (defvar calendar-mouse-3-map (make-sparse-keymap "Calendar"))
50 (define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
52 (define-key calendar-mode-map [menu-bar moon]
55 (define-key calendar-mode-map [menu-bar moon moon]
56 '("Lunar Phases" . calendar-phases-of-moon))
58 (define-key calendar-mode-map [menu-bar diary]
61 (define-key calendar-mode-map [menu-bar diary heb]
62 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
63 (define-key calendar-mode-map [menu-bar diary isl]
64 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
65 (define-key calendar-mode-map [menu-bar diary baha]
66 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry))
67 (define-key calendar-mode-map [menu-bar diary cyc]
69 (define-key calendar-mode-map [menu-bar diary blk]
71 (define-key calendar-mode-map [menu-bar diary ann]
73 (define-key calendar-mode-map [menu-bar diary yr]
75 (define-key calendar-mode-map [menu-bar diary mon]
77 (define-key calendar-mode-map [menu-bar diary wk]
79 (define-key calendar-mode-map [menu-bar diary ent]
81 (define-key calendar-mode-map [menu-bar diary all]
83 (define-key calendar-mode-map [menu-bar diary mark]
85 (define-key calendar-mode-map [menu-bar diary view]
87 (define-key calendar-mode-map [menu-bar diary view]
90 (define-key calendar-mode-map [menu-bar Holidays]
93 (define-key calendar-mode-map [menu-bar goto]
96 (define-key calendar-mode-map [menu-bar goto french]
97 '("French Date" . calendar-goto-french-date))
98 (define-key calendar-mode-map [menu-bar goto mayan]
100 (define-key calendar-mode-map [menu-bar goto ethiopic]
101 '("Ethiopic Date" . calendar-goto-ethiopic-date))
102 (define-key calendar-mode-map [menu-bar goto coptic]
103 '("Coptic Date" . calendar-goto-coptic-date))
104 (define-key calendar-mode-map [menu-bar goto chinese]
105 '("Chinese Date" . calendar-goto-chinese-date))
106 (define-key calendar-mode-map [menu-bar goto julian]
107 '("Julian Date" . calendar-goto-julian-date))
108 (define-key calendar-mode-map [menu-bar goto islamic]
109 '("Islamic Date" . calendar-goto-islamic-date))
110 (define-key calendar-mode-map [menu-bar goto persian]
111 '("Baha'i Date" . calendar-goto-bahai-date))
112 (define-key calendar-mode-map [menu-bar goto persian]
113 '("Persian Date" . calendar-goto-persian-date))
114 (define-key calendar-mode-map [menu-bar goto hebrew]
115 '("Hebrew Date" . calendar-goto-hebrew-date))
116 (define-key calendar-mode-map [menu-bar goto astro]
117 '("Astronomical Date" . calendar-goto-astro-day-number))
118 (define-key calendar-mode-map [menu-bar goto iso]
119 '("ISO Date" . calendar-goto-iso-date))
120 (define-key calendar-mode-map [menu-bar goto iso-week]
121 '("ISO Week" . calendar-goto-iso-week))
122 (define-key calendar-mode-map [menu-bar goto day-of-year]
123 '("Day of Year" . calendar-goto-day-of-year))
124 (define-key calendar-mode-map [menu-bar goto gregorian]
125 '("Other Date" . calendar-goto-date))
126 (define-key calendar-mode-map [menu-bar goto end-of-year]
127 '("End of Year" . calendar-end-of-year))
128 (define-key calendar-mode-map [menu-bar goto beginning-of-year]
129 '("Beginning of Year" . calendar-beginning-of-year))
130 (define-key calendar-mode-map [menu-bar goto end-of-month]
131 '("End of Month" . calendar-end-of-month))
132 (define-key calendar-mode-map [menu-bar goto beginning-of-month]
133 '("Beginning of Month" . calendar-beginning-of-month))
134 (define-key calendar-mode-map [menu-bar goto end-of-week]
135 '("End of Week" . calendar-end-of-week))
136 (define-key calendar-mode-map [menu-bar goto beginning-of-week]
137 '("Beginning of Week" . calendar-beginning-of-week))
138 (define-key calendar-mode-map [menu-bar goto today]
139 '("Today" . calendar-goto-today))
142 (define-key calendar-mode-map [menu-bar goto mayan prev-rnd]
143 '("Previous Round" . calendar-previous-calendar-round-date))
144 (define-key calendar-mode-map [menu-bar goto mayan nxt-rnd]
145 '("Next Round" . calendar-next-calendar-round-date))
146 (define-key calendar-mode-map [menu-bar goto mayan prev-haab]
147 '("Previous Haab" . calendar-previous-haab-date))
148 (define-key calendar-mode-map [menu-bar goto mayan next-haab]
149 '("Next Haab" . calendar-next-haab-date))
150 (define-key calendar-mode-map [menu-bar goto mayan prev-tzol]
151 '("Previous Tzolkin" . calendar-previous-tzolkin-date))
152 (define-key calendar-mode-map [menu-bar goto mayan next-tzol]
153 '("Next Tzolkin" . calendar-next-tzolkin-date))
155 (define-key calendar-mode-map [menu-bar scroll]
158 (define-key calendar-mode-map [menu-bar scroll bk-12]
160 (define-key calendar-mode-map [menu-bar scroll bk-3]
161 '("Backward 3 Months" . scroll-calendar-right-three-months))
162 (define-key calendar-mode-map [menu-bar scroll bk-1]
163 '("Backward 1 Month" . scroll-calendar-right))
164 (define-key calendar-mode-map [menu-bar scroll fwd-12]
166 (define-key calendar-mode-map [menu-bar scroll fwd-3]
167 '("Forward 3 Months" . scroll-calendar-left-three-months))
168 (define-key calendar-mode-map [menu-bar scroll fwd-1]
169 '("Forward 1 Month" . scroll-calendar-left))
171 (defun calendar-flatten (list)
177 (append (calendar-flatten (car list)) (calendar-flatten (cdr list)))
178 (calendar-flatten (car list)))))
190 (let ((year (extract-calendar-year (calendar-cursor-to-date))))
196 (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
202 (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
206 ;; Update the holiday part of calendar menu bar for the current display.
208 (if (eq major-mode 'calendar-mode)
218 (setq l (cons ["Mark Holidays" mark-calendar-holidays t]
219 (cons ["Unmark Calendar" calendar-unmark t]
221 (define-key calendar-mode-map [menu-bar Holidays]
223 (define-key calendar-mode-map [menu-bar Holidays separator]
225 (define-key calendar-mode-map [menu-bar Holidays today]
227 (calendar-date-string (calendar-current-date) t t))
230 (let ((my1 (calendar-increment-month -1))
231 (my2 (calendar-increment-month 1)))
234 (calendar-month-name (car my1) 'abbrev)
235 (calendar-month-name (car my2) 'abbrev)
238 (calendar-month-name (car my1) 'abbrev)
240 (calendar-month-name (car my2) 'abbrev)
242 (define-key calendar-mode-map [menu-bar Holidays 3-month]
244 . list-calendar-holidays)))
245 (let ((date (calendar-cursor-to-date)))
247 (define-key calendar-mode-map [menu-bar Holidays 1-day]
249 (calendar-date-string date t t))
250 . calendar-cursor-holidays))))))
251 ;; Try to avoid entering infinite beep mode in case of errors.
254 (defun calendar-event-to-date (&optional error)
261 (calendar-cursor-to-date error)))
263 (defun calendar-mouse-insert-hebrew-diary-entry (event)
270 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
276 (defun calendar-mouse-insert-islamic-diary-entry (event)
283 (list (calendar-islamic-date-string (calendar-cursor-to-date))
289 (defun calendar-mouse-insert-bahai-diary-entry (event)
296 (list (calendar-bahai-date-string (calendar-cursor-to-date))
302 (defun calendar-mouse-sunrise/sunset ()
306 (calendar-mouse-goto-date (calendar-event-to-date))
307 (calendar-sunrise-sunset)))
313 (calendar-cursor-to-date (calendar-current-date))
314 (calendar-cursor-holidays)))
316 (autoload 'check-calendar-holidays "holidays")
319 (defun calendar-mouse-holidays (&optional event)
322 (let* ((date (calendar-event-to-date))
323 (l (mapcar 'list (check-calendar-holidays date)))
328 (format "Holidays for %s" (calendar-date-string date))
330 (list (format "Holidays for %s" (calendar-date-string date)))
334 (defun calendar-mouse-view-diary-entries (&optional date diary event)
340 (let* ((date (if date date (calendar-event-to-date)))
348 (check-calendar-holidays date)))
352 (calendar-date-string date)))
363 (mapcar 'list (calendar-flatten diary-entries))
367 (defun calendar-mouse-view-other-diary-entries ()
370 (calendar-mouse-view-diary-entries
371 (calendar-event-to-date)
374 (defun calendar-mouse-insert-diary-entry ()
378 (calendar-mouse-goto-date (calendar-event-to-date))
381 (defun calendar-mouse-set-mark ()
385 (calendar-mouse-goto-date (calendar-event-to-date))
386 (calendar-set-mark nil)))
392 (calendar-mouse-goto-date (calendar-event-to-date))
396 "One page calendar for week indicated by cursor.
400 (calendar-mouse-goto-date (calendar-event-to-date))
408 (calendar-mouse-goto-date (calendar-event-to-date))
412 "One page calendar for week indicated by cursor.
416 (calendar-mouse-goto-date (calendar-event-to-date))
420 "One page calendar for week indicated by cursor."
423 (calendar-mouse-goto-date (calendar-event-to-date))
427 "Day-per-page Filofax calendar for week indicated by cursor."
430 (calendar-mouse-goto-date (calendar-event-to-date))
434 "One page Filofax calendar for week indicated by cursor."
437 (calendar-mouse-goto-date (calendar-event-to-date))
441 "Two page Filofax calendar for week indicated by cursor."
444 (calendar-mouse-goto-date (calendar-event-to-date))
452 (calendar-mouse-goto-date (calendar-event-to-date))
460 (calendar-mouse-goto-date (calendar-event-to-date))
467 (calendar-mouse-goto-date (calendar-event-to-date))
471 "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on."
474 (calendar-mouse-goto-date (calendar-event-to-date))
481 (calendar-mouse-goto-date (calendar-event-to-date))
484 (defun calendar-mouse-print-dates (&optional event)
487 (let* ((date (calendar-event-to-date))
492 (concat (calendar-date-string date) " (Gregorian)")
495 (concat (calendar-date-string date) " (Gregorian)")
496 (list (calendar-day-of-year-string date))
497 (list (format "ISO date: %s" (calendar-iso-date-string date)))
499 (calendar-julian-date-string date)))
502 (calendar-astro-date-string date)))
505 (calendar-absolute-from-gregorian date)))
507 (calendar-hebrew-date-string date)))
509 (calendar-persian-date-string date)))
511 (calendar-bahai-date-string date))))
512 (let ((i (calendar-islamic-date-string date)))
517 (calendar-chinese-date-string date))))
519 ;; . calendar-mouse-chinese-date))
520 (let ((c (calendar-coptic-date-string date)))
523 (let ((e (calendar-ethiopic-date-string date)))
526 (let ((f (calendar-french-date-string date)))
532 (calendar-mayan-date-string date)))))))))
535 (defun calendar-mouse-chinese-date ()
539 (calendar-mouse-goto-date (calendar-event-to-date))
540 (calendar-print-chinese-date)))
542 (defun calendar-mouse-goto-date (date)
544 (calendar-goto-date date))
546 (defun calendar-mouse-2-date-menu (event)
547 "Pop up menu for Mouse-2 for selected date in the calendar window."
549 (let* ((date (calendar-event-to-date t))
553 (list (calendar-date-string date t nil)
556 '("Holidays" . calendar-mouse-holidays)
557 '("Mark date" . calendar-mouse-set-mark)
558 '("Sunrise/sunset" . calendar-mouse-sunrise/sunset)
559 '("Other calendars" . calendar-mouse-print-dates)
560 '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu)
561 '("Diary entries" . calendar-mouse-view-diary-entries)
562 '("Insert diary entry" . calendar-mouse-insert-diary-entry)
564 . calendar-mouse-view-other-diary-entries)
568 (defun calendar-mouse-cal-tex-menu (event)
569 "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
574 (list (calendar-date-string (calendar-event-to-date t) t nil)
597 (list (calendar-date-string (calendar-event-to-date t) t nil)
610 (define-key calendar-mouse-3-map [exit-calendar]
611 '("Exit calendar" . exit-calendar))
612 (define-key calendar-mouse-3-map [show-diary]
614 (define-key calendar-mouse-3-map [lunar-phases]
615 '("Lunar phases" . calendar-phases-of-moon))
616 (define-key calendar-mouse-3-map [unmark]
617 '("Unmark" . calendar-unmark))
618 (define-key calendar-mouse-3-map [mark-holidays]
619 '("Mark holidays" . mark-calendar-holidays))
620 (define-key calendar-mouse-3-map [list-holidays]
621 '("List holidays" . list-calendar-holidays))
622 (define-key calendar-mouse-3-map [mark-diary-entries]
624 (define-key calendar-mouse-3-map [scroll-backward]
625 '("Scroll backward" . scroll-calendar-right-three-months))
626 (define-key calendar-mouse-3-map [scroll-forward]
627 '("Scroll forward" . scroll-calendar-left-three-months))