diff options
| author | Edward M. Reingold | 1998-06-09 22:03:14 +0000 |
|---|---|---|
| committer | Edward M. Reingold | 1998-06-09 22:03:14 +0000 |
| commit | 6c8a48a6d00136970094b4cfbed513ea58b776ae (patch) | |
| tree | e4e21d71e9883a84d35370d0dbf258f2c2fc89bb | |
| parent | 892e6825a09fabe72e6eb83bd244f9d9a6051855 (diff) | |
| download | emacs-6c8a48a6d00136970094b4cfbed513ea58b776ae.tar.gz emacs-6c8a48a6d00136970094b4cfbed513ea58b776ae.zip | |
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.
| -rw-r--r-- | lisp/calendar/cal-menu.el | 62 |
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." | |||
| 281 | (calendar-cursor-holidays))) | 281 | (calendar-cursor-holidays))) |
| 282 | 282 | ||
| 283 | (defun calendar-mouse-holidays () | 283 | (defun calendar-mouse-holidays () |
| 284 | "Show holidays for mouse-selected date." | 284 | "Pop up menu of holidays for mouse selected date." |
| 285 | (interactive) | 285 | (interactive) |
| 286 | (save-excursion | 286 | (let* ((date (calendar-event-to-date)) |
| 287 | (calendar-mouse-goto-date (calendar-event-to-date)) | 287 | (l (mapcar '(lambda (x) (list x)) |
| 288 | (calendar-cursor-holidays))) | 288 | (check-calendar-holidays date))) |
| 289 | (selection | ||
| 290 | (x-popup-menu | ||
| 291 | event | ||
| 292 | (list | ||
| 293 | (format "Holidays for %s" (calendar-date-string date)) | ||
| 294 | (append | ||
| 295 | (list (format "Holidays for %s" (calendar-date-string date))) | ||
| 296 | (if l l '("None"))))))) | ||
| 297 | (and selection (call-interactively selection)))) | ||
| 289 | 298 | ||
| 290 | (defun calendar-mouse-view-diary-entries () | 299 | (defun calendar-mouse-view-diary-entries () |
| 291 | "View diary entries on mouse-selected date." | 300 | "Pop up menu of diary entries for mouse selected date." |
| 292 | (interactive) | 301 | (interactive) |
| 293 | (save-excursion | 302 | (let* ((date (calendar-event-to-date)) |
| 294 | (calendar-mouse-goto-date (calendar-event-to-date)) | 303 | (l (mapcar '(lambda (x) (list (car (cdr x)))) |
| 295 | (view-diary-entries 1))) | 304 | (let ((diary-list-include-blanks nil) |
| 305 | (diary-display-hook nil)) | ||
| 306 | (list-diary-entries date 1)))) | ||
| 307 | (selection | ||
| 308 | (x-popup-menu | ||
| 309 | event | ||
| 310 | (list | ||
| 311 | (format "Diary entries for %s" (calendar-date-string date)) | ||
| 312 | (append | ||
| 313 | (list (format "Diary entries for %s" (calendar-date-string date))) | ||
| 314 | (if l l '("None"))))))) | ||
| 315 | (and selection (call-interactively selection)))) | ||
| 296 | 316 | ||
| 297 | (defun calendar-mouse-view-other-diary-entries () | 317 | (defun calendar-mouse-view-other-diary-entries () |
| 298 | "View diary entries from alternative file on mouse-selected date." | 318 | "Pop up menu of diary entries from alternative file on mouse-selected date." |
| 299 | (interactive) | 319 | (interactive) |
| 300 | (save-excursion | 320 | (let* ((date (calendar-event-to-date)) |
| 301 | (calendar-mouse-goto-date (calendar-event-to-date)) | 321 | (l (mapcar '(lambda (x) (list (car (cdr x)))) |
| 302 | (call-interactively 'view-other-diary-entries))) | 322 | (let ((diary-list-include-blanks nil) |
| 323 | (diary-display-hook nil) | ||
| 324 | (diary-file (read-file-name | ||
| 325 | "Enter diary file name: " | ||
| 326 | default-directory nil t))) | ||
| 327 | (list-diary-entries date 1)))) | ||
| 328 | (selection | ||
| 329 | (x-popup-menu | ||
| 330 | event | ||
| 331 | (list | ||
| 332 | (format "Diary entries from %s for %s" | ||
| 333 | diary-file | ||
| 334 | (calendar-date-string date)) | ||
| 335 | (append | ||
| 336 | (list (format "Diary entries from %s for %s" | ||
| 337 | diary-file | ||
| 338 | (calendar-date-string date))) | ||
| 339 | (if l l '("None"))))))) | ||
| 340 | (and selection (call-interactively selection)))) | ||
| 303 | 341 | ||
| 304 | (defun calendar-mouse-insert-diary-entry () | 342 | (defun calendar-mouse-insert-diary-entry () |
| 305 | "Insert diary entry for mouse-selected date." | 343 | "Insert diary entry for mouse-selected date." |