diff options
| author | Glenn Morris | 2008-06-26 04:54:37 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-06-26 04:54:37 +0000 |
| commit | 3b7de42e679ad9647d246cd12d0974a7eff9f672 (patch) | |
| tree | 671a7b2cc96442814dc49a1f5ad633c95cbb02b6 | |
| parent | cb9069371df1b92649845bb1fc9e249fa6bcff8e (diff) | |
| download | emacs-3b7de42e679ad9647d246cd12d0974a7eff9f672.tar.gz emacs-3b7de42e679ad9647d246cd12d0974a7eff9f672.zip | |
(calendar-cursor-holidays): Handle mouse events.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/calendar/holidays.el | 29 |
2 files changed, 27 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0dcebf8ca69..df9749c1d94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,12 +1,10 @@ | |||
| 1 | 2008-06-26 Kenichi Handa <handa@m17n.org> | 1 | 2008-06-26 Kenichi Handa <handa@m17n.org> |
| 2 | 2 | ||
| 3 | * composite.el (terminal-composition-base-character-p): New | 3 | * composite.el (terminal-composition-base-character-p): New function. |
| 4 | funciton. | 4 | (terminal-composition-function): |
| 5 | (terminal-composition-function): Use | 5 | Use terminal-composition-base-character-p. Include the base character |
| 6 | terminal-composition-base-character-p. Include the base character | ||
| 7 | in the composition. | 6 | in the composition. |
| 8 | (auto-compose-chars): Don't check font-object for terminal | 7 | (auto-compose-chars): Don't check font-object for terminal display. |
| 9 | display. | ||
| 10 | 8 | ||
| 11 | 2008-06-26 Glenn Morris <rgm@gnu.org> | 9 | 2008-06-26 Glenn Morris <rgm@gnu.org> |
| 12 | 10 | ||
| @@ -29,6 +27,10 @@ | |||
| 29 | * calendar/cal-menu.el (calendar-mouse-print-dates): Remove function. | 27 | * calendar/cal-menu.el (calendar-mouse-print-dates): Remove function. |
| 30 | (cal-menu-context-mouse-menu): Use calendar-print-other-dates. | 28 | (cal-menu-context-mouse-menu): Use calendar-print-other-dates. |
| 31 | 29 | ||
| 30 | * calendar/holidays.el (calendar-cursor-holidays): Handle mouse events. | ||
| 31 | * calendar/cal-menu.el (calendar-mouse-holidays): Remove function. | ||
| 32 | (cal-menu-context-mouse-menu): Use calendar-cursor-holidays. | ||
| 33 | |||
| 32 | * calendar/cal-move.el (calendar-cursor-to-nearest-date): | 34 | * calendar/cal-move.el (calendar-cursor-to-nearest-date): |
| 33 | Use calendar-column-to-segment, calendar-month-edges, and | 35 | Use calendar-column-to-segment, calendar-month-edges, and |
| 34 | the 'date property to handle intermonth text. | 36 | the 'date property to handle intermonth text. |
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 5ddc587dcc6..8b554e05825 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -625,25 +625,34 @@ The holidays are those in the list `calendar-holidays'." | |||
| 625 | 'check-calendar-holidays 'calendar-check-holidays "23.1") | 625 | 'check-calendar-holidays 'calendar-check-holidays "23.1") |
| 626 | 626 | ||
| 627 | ;;;###cal-autoload | 627 | ;;;###cal-autoload |
| 628 | (defun calendar-cursor-holidays (&optional date) | 628 | (defun calendar-cursor-holidays (&optional date event) |
| 629 | "Find holidays for the date specified by the cursor in the calendar window. | 629 | "Find holidays for the date specified by the cursor in the calendar window. |
| 630 | Optional DATE is a list (month day year) to use instead of the | 630 | Optional DATE is a list (month day year) to use instead of the |
| 631 | cursor position." | 631 | cursor position. EVENT specifies a buffer position to use for a date." |
| 632 | (interactive) | 632 | (interactive (list nil last-nonmenu-event)) |
| 633 | (message "Checking holidays...") | 633 | (message "Checking holidays...") |
| 634 | (or date (setq date (calendar-cursor-to-date t))) | 634 | (or date (setq date (calendar-cursor-to-date t event))) |
| 635 | (let* ((date-string (calendar-date-string date)) | 635 | (let ((date-string (calendar-date-string date)) |
| 636 | (holiday-list (calendar-check-holidays date)) | 636 | (holiday-list (calendar-check-holidays date)) |
| 637 | (holiday-string (mapconcat 'identity holiday-list "; ")) | 637 | selection msg) |
| 638 | (msg (format "%s: %s" date-string holiday-string))) | 638 | (if (mouse-event-p event) |
| 639 | (and (setq selection (cal-menu-x-popup-menu event | ||
| 640 | (format "Holidays for %s" date-string) | ||
| 641 | (if holiday-list | ||
| 642 | (mapcar 'list holiday-list) | ||
| 643 | '("None")))) | ||
| 644 | (call-interactively selection)) | ||
| 639 | (if (not holiday-list) | 645 | (if (not holiday-list) |
| 640 | (message "No holidays known for %s" date-string) | 646 | (message "No holidays known for %s" date-string) |
| 641 | (if (<= (length msg) (frame-width)) | 647 | (if (<= (length (setq msg |
| 648 | (format "%s: %s" date-string | ||
| 649 | (mapconcat 'identity holiday-list "; ")))) | ||
| 650 | (frame-width)) | ||
| 642 | (message "%s" msg) | 651 | (message "%s" msg) |
| 643 | (calendar-in-read-only-buffer holiday-buffer | 652 | (calendar-in-read-only-buffer holiday-buffer |
| 644 | (calendar-set-mode-line date-string) | 653 | (calendar-set-mode-line date-string) |
| 645 | (insert (mapconcat 'identity holiday-list "\n"))) | 654 | (insert (mapconcat 'identity holiday-list "\n"))) |
| 646 | (message "Checking holidays...done"))))) | 655 | (message "Checking holidays...done")))))) |
| 647 | 656 | ||
| 648 | ;; FIXME move to calendar? | 657 | ;; FIXME move to calendar? |
| 649 | ;;;###cal-autoload | 658 | ;;;###cal-autoload |