summaryrefslogtreecommitdiff
path: root/lisp/calendar/cal-menu.el
diff options
context:
space:
mode:
authorEdward M. Reingold <reingold@emr.cs.iit.edu>1998-06-09 22:03:14 +0000
committerEdward M. Reingold <reingold@emr.cs.iit.edu>1998-06-09 22:03:14 +0000
commit7bc6b3cc7dbdee6f14f6a35626eb63a8eef21f29 (patch)
tree661aab320cf1625fe1d127d779f186a9b1ce8afe /lisp/calendar/cal-menu.el
parent5f76989cf650517152136c90d50dc497f87cf561 (diff)
downloademacs-7bc6b3cc7dbdee6f14f6a35626eb63a8eef21f29.tar.gz
Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
calendar-mouse-view-other-diary-entries to put results in popup menu to be consistent with other functions.
Diffstat (limited to 'lisp/calendar/cal-menu.el')
-rw-r--r--lisp/calendar/cal-menu.el62
1 files changed, 50 insertions, 12 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 936996f9b43..614adace202 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -281,25 +281,63 @@ ERROR is t, otherwise just returns nil."
(calendar-cursor-holidays)))
(defun calendar-mouse-holidays ()
- "Show holidays for mouse-selected date."
+ "Pop up menu of holidays for mouse selected date."
(interactive)
- (save-excursion
- (calendar-mouse-goto-date (calendar-event-to-date))
- (calendar-cursor-holidays)))
+ (let* ((date (calendar-event-to-date))
+ (l (mapcar '(lambda (x) (list x))
+ (check-calendar-holidays date)))
+ (selection
+ (x-popup-menu
+ event
+ (list
+ (format "Holidays for %s" (calendar-date-string date))
+ (append
+ (list (format "Holidays for %s" (calendar-date-string date)))
+ (if l l '("None")))))))
+ (and selection (call-interactively selection))))
(defun calendar-mouse-view-diary-entries ()
- "View diary entries on mouse-selected date."
+ "Pop up menu of diary entries for mouse selected date."
(interactive)
- (save-excursion
- (calendar-mouse-goto-date (calendar-event-to-date))
- (view-diary-entries 1)))
+ (let* ((date (calendar-event-to-date))
+ (l (mapcar '(lambda (x) (list (car (cdr x))))
+ (let ((diary-list-include-blanks nil)
+ (diary-display-hook nil))
+ (list-diary-entries date 1))))
+ (selection
+ (x-popup-menu
+ event
+ (list
+ (format "Diary entries for %s" (calendar-date-string date))
+ (append
+ (list (format "Diary entries for %s" (calendar-date-string date)))
+ (if l l '("None")))))))
+ (and selection (call-interactively selection))))
(defun calendar-mouse-view-other-diary-entries ()
- "View diary entries from alternative file on mouse-selected date."
+ "Pop up menu of diary entries from alternative file on mouse-selected date."
(interactive)
- (save-excursion
- (calendar-mouse-goto-date (calendar-event-to-date))
- (call-interactively 'view-other-diary-entries)))
+ (let* ((date (calendar-event-to-date))
+ (l (mapcar '(lambda (x) (list (car (cdr x))))
+ (let ((diary-list-include-blanks nil)
+ (diary-display-hook nil)
+ (diary-file (read-file-name
+ "Enter diary file name: "
+ default-directory nil t)))
+ (list-diary-entries date 1))))
+ (selection
+ (x-popup-menu
+ event
+ (list
+ (format "Diary entries from %s for %s"
+ diary-file
+ (calendar-date-string date))
+ (append
+ (list (format "Diary entries from %s for %s"
+ diary-file
+ (calendar-date-string date)))
+ (if l l '("None")))))))
+ (and selection (call-interactively selection))))
(defun calendar-mouse-insert-diary-entry ()
"Insert diary entry for mouse-selected date."