diff options
| author | Eli Zaretskii | 2001-10-01 11:08:06 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-10-01 11:08:06 +0000 |
| commit | 87671c2577bf0503d24fc68b1a43258ffa97a069 (patch) | |
| tree | bd76c9588e4d850a7d992575fdc8b6ccdf3cc24b | |
| parent | d24f1b150a30807e3fdc457c628b8e972815fa92 (diff) | |
| download | emacs-87671c2577bf0503d24fc68b1a43258ffa97a069.tar.gz emacs-87671c2577bf0503d24fc68b1a43258ffa97a069.zip | |
(cal-menu-x-popup-menu): New function,
calls x-popup-menu only if popup menus are supported.
(calendar-mouse-insert-hebrew-diary-entry)
(calendar-mouse-insert-islamic-diary-entry)
(calendar-mouse-holidays, calendar-mouse-view-diary-entries)
(calendar-mouse-view-other-diary-entries)
(calendar-mouse-print-dates, calendar-mouse-2-date-menu)
(calendar-mouse-cal-tex-menu, cal-tex-mouse-filofax): Call
cal-menu-x-popup-menu instead of x-popup-menu.
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/calendar/cal-menu.el | 25 |
2 files changed, 35 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11a429aefe6..3b9d07da154 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2001-10-01 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 2 | |||
| 3 | These changes add support for Calendar-related items in the | ||
| 4 | menu bar on tty's as well: | ||
| 5 | |||
| 6 | * calendar/calendar.el (calendar-mode-map): Require cal-menu | ||
| 7 | unconditionally. | ||
| 8 | (calendar-mode): Set up activate-menubar-hook unconditionally. | ||
| 9 | |||
| 10 | * calendar/cal-menu.el (cal-menu-x-popup-menu): New function, | ||
| 11 | calls x-popup-menu only if popup menus are supported. | ||
| 12 | (calendar-mouse-insert-hebrew-diary-entry) | ||
| 13 | (calendar-mouse-insert-islamic-diary-entry) | ||
| 14 | (calendar-mouse-holidays, calendar-mouse-view-diary-entries) | ||
| 15 | (calendar-mouse-view-other-diary-entries) | ||
| 16 | (calendar-mouse-print-dates, calendar-mouse-2-date-menu) | ||
| 17 | (calendar-mouse-cal-tex-menu, cal-tex-mouse-filofax): Call | ||
| 18 | cal-menu-x-popup-menu instead of x-popup-menu. | ||
| 19 | |||
| 1 | 2001-10-01 Gerd Moellmann <gerd@gnu.org> | 20 | 2001-10-01 Gerd Moellmann <gerd@gnu.org> |
| 2 | 21 | ||
| 3 | * gs.el (gs-set-ghostview-window-prop): Fix args of `elt'. | 22 | * gs.el (gs-set-ghostview-window-prop): Fix args of `elt'. |
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 3391dd0d242..9b0cdd3e7b8 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el | |||
| @@ -161,6 +161,13 @@ | |||
| 161 | (define-key calendar-mode-map [menu-bar scroll fwd-1] | 161 | (define-key calendar-mode-map [menu-bar scroll fwd-1] |
| 162 | '("Forward 1 Month" . scroll-calendar-left)) | 162 | '("Forward 1 Month" . scroll-calendar-left)) |
| 163 | 163 | ||
| 164 | (defun cal-menu-x-popup-menu (position menu) | ||
| 165 | "Like `x-popup-menu', but prints an error message if popup menus are | ||
| 166 | not available." | ||
| 167 | (if (display-popup-menus-p) | ||
| 168 | (x-popup-menu position menu) | ||
| 169 | (error "Popup menus are not available on this system."))) | ||
| 170 | |||
| 164 | (defun cal-menu-list-holidays-year () | 171 | (defun cal-menu-list-holidays-year () |
| 165 | "Display a list of the holidays of the selected date's year." | 172 | "Display a list of the holidays of the selected date's year." |
| 166 | (interactive) | 173 | (interactive) |
| @@ -244,7 +251,7 @@ ERROR is t, otherwise just returns nil." | |||
| 244 | "Pop up menu to insert a Hebrew-date diary entry." | 251 | "Pop up menu to insert a Hebrew-date diary entry." |
| 245 | (interactive "e") | 252 | (interactive "e") |
| 246 | (let ((hebrew-selection | 253 | (let ((hebrew-selection |
| 247 | (x-popup-menu | 254 | (cal-menu-x-popup-menu |
| 248 | event | 255 | event |
| 249 | (list "Hebrew insert menu" | 256 | (list "Hebrew insert menu" |
| 250 | (list (calendar-hebrew-date-string (calendar-cursor-to-date)) | 257 | (list (calendar-hebrew-date-string (calendar-cursor-to-date)) |
| @@ -257,7 +264,7 @@ ERROR is t, otherwise just returns nil." | |||
| 257 | "Pop up menu to insert an Islamic-date diary entry." | 264 | "Pop up menu to insert an Islamic-date diary entry." |
| 258 | (interactive "e") | 265 | (interactive "e") |
| 259 | (let ((islamic-selection | 266 | (let ((islamic-selection |
| 260 | (x-popup-menu | 267 | (cal-menu-x-popup-menu |
| 261 | event | 268 | event |
| 262 | (list "Islamic insert menu" | 269 | (list "Islamic insert menu" |
| 263 | (list (calendar-islamic-date-string (calendar-cursor-to-date)) | 270 | (list (calendar-islamic-date-string (calendar-cursor-to-date)) |
| @@ -287,7 +294,7 @@ ERROR is t, otherwise just returns nil." | |||
| 287 | (l (mapcar '(lambda (x) (list x)) | 294 | (l (mapcar '(lambda (x) (list x)) |
| 288 | (check-calendar-holidays date))) | 295 | (check-calendar-holidays date))) |
| 289 | (selection | 296 | (selection |
| 290 | (x-popup-menu | 297 | (cal-menu-x-popup-menu |
| 291 | event | 298 | event |
| 292 | (list | 299 | (list |
| 293 | (format "Holidays for %s" (calendar-date-string date)) | 300 | (format "Holidays for %s" (calendar-date-string date)) |
| @@ -305,7 +312,7 @@ ERROR is t, otherwise just returns nil." | |||
| 305 | (diary-display-hook 'ignore)) | 312 | (diary-display-hook 'ignore)) |
| 306 | (list-diary-entries date 1)))) | 313 | (list-diary-entries date 1)))) |
| 307 | (selection | 314 | (selection |
| 308 | (x-popup-menu | 315 | (cal-menu-x-popup-menu |
| 309 | event | 316 | event |
| 310 | (list | 317 | (list |
| 311 | (format "Diary entries for %s" (calendar-date-string date)) | 318 | (format "Diary entries for %s" (calendar-date-string date)) |
| @@ -331,7 +338,7 @@ ERROR is t, otherwise just returns nil." | |||
| 331 | (l (mapcar '(lambda (x) (list (car (cdr x)))) | 338 | (l (mapcar '(lambda (x) (list (car (cdr x)))) |
| 332 | (list-diary-entries date 1))) | 339 | (list-diary-entries date 1))) |
| 333 | (selection | 340 | (selection |
| 334 | (x-popup-menu | 341 | (cal-menu-x-popup-menu |
| 335 | event | 342 | event |
| 336 | (list | 343 | (list |
| 337 | (format "Diary entries from %s for %s" | 344 | (format "Diary entries from %s for %s" |
| @@ -459,7 +466,7 @@ The output is in landscape format, one month to a page." | |||
| 459 | (interactive) | 466 | (interactive) |
| 460 | (let ((date (calendar-event-to-date)) | 467 | (let ((date (calendar-event-to-date)) |
| 461 | (selection | 468 | (selection |
| 462 | (x-popup-menu | 469 | (cal-menu-x-popup-menu |
| 463 | event | 470 | event |
| 464 | (list | 471 | (list |
| 465 | (concat (calendar-date-string date) " (Gregorian)") | 472 | (concat (calendar-date-string date) " (Gregorian)") |
| @@ -519,7 +526,7 @@ The output is in landscape format, one month to a page." | |||
| 519 | (interactive "e") | 526 | (interactive "e") |
| 520 | (let* ((date (calendar-event-to-date t)) | 527 | (let* ((date (calendar-event-to-date t)) |
| 521 | (selection | 528 | (selection |
| 522 | (x-popup-menu | 529 | (cal-menu-x-popup-menu |
| 523 | event | 530 | event |
| 524 | (list (calendar-date-string date t nil) | 531 | (list (calendar-date-string date t nil) |
| 525 | (list | 532 | (list |
| @@ -540,7 +547,7 @@ The output is in landscape format, one month to a page." | |||
| 540 | "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window." | 547 | "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window." |
| 541 | (interactive "e") | 548 | (interactive "e") |
| 542 | (let* ((selection | 549 | (let* ((selection |
| 543 | (x-popup-menu | 550 | (cal-menu-x-popup-menu |
| 544 | event | 551 | event |
| 545 | (list (calendar-date-string date t nil) | 552 | (list (calendar-date-string date t nil) |
| 546 | (list | 553 | (list |
| @@ -563,7 +570,7 @@ The output is in landscape format, one month to a page." | |||
| 563 | "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date." | 570 | "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date." |
| 564 | (interactive "e") | 571 | (interactive "e") |
| 565 | (let* ((selection | 572 | (let* ((selection |
| 566 | (x-popup-menu | 573 | (cal-menu-x-popup-menu |
| 567 | event | 574 | event |
| 568 | (list (calendar-date-string date t nil) | 575 | (list (calendar-date-string date t nil) |
| 569 | (list | 576 | (list |