]> git.eshelyaron.com Git - emacs.git/commitdiff
(calendar-cursor-holidays): Handle mouse events.
authorGlenn Morris <rgm@gnu.org>
Thu, 26 Jun 2008 04:54:37 +0000 (04:54 +0000)
committerGlenn Morris <rgm@gnu.org>
Thu, 26 Jun 2008 04:54:37 +0000 (04:54 +0000)
lisp/ChangeLog
lisp/calendar/holidays.el

index 0dcebf8ca69c2a150c11e2f7b2680a6806e770ca..df9749c1d9472c4ad55d508af18321459c53f371 100644 (file)
@@ -1,12 +1,10 @@
 2008-06-26  Kenichi Handa  <handa@m17n.org>
 
-       * composite.el (terminal-composition-base-character-p): New
-       funciton.
-       (terminal-composition-function): Use
-       terminal-composition-base-character-p.  Include the base character
+       * composite.el (terminal-composition-base-character-p): New function.
+       (terminal-composition-function):
+       Use terminal-composition-base-character-p.  Include the base character
        in the composition.
-       (auto-compose-chars): Don't check font-object for terminal
-       display.
+       (auto-compose-chars): Don't check font-object for terminal display.
 
 2008-06-26  Glenn Morris  <rgm@gnu.org>
 
        * calendar/cal-menu.el (calendar-mouse-print-dates): Remove function.
        (cal-menu-context-mouse-menu): Use calendar-print-other-dates.
 
+       * calendar/holidays.el (calendar-cursor-holidays): Handle mouse events.
+       * calendar/cal-menu.el (calendar-mouse-holidays): Remove function.
+       (cal-menu-context-mouse-menu): Use calendar-cursor-holidays.
+
        * calendar/cal-move.el (calendar-cursor-to-nearest-date):
        Use calendar-column-to-segment, calendar-month-edges, and
        the 'date property to handle intermonth text.
index 5ddc587dcc69bf3b6497f3e75f7b64079a4ab609..8b554e05825499a1af92e927c7a837c27933136e 100644 (file)
@@ -625,25 +625,34 @@ The holidays are those in the list `calendar-holidays'."
   'check-calendar-holidays 'calendar-check-holidays "23.1")
 
 ;;;###cal-autoload
-(defun calendar-cursor-holidays (&optional date)
+(defun calendar-cursor-holidays (&optional date event)
   "Find holidays for the date specified by the cursor in the calendar window.
 Optional DATE is a list (month day year) to use instead of the
-cursor position."
-  (interactive)
+cursor position.  EVENT specifies a buffer position to use for a date."
+  (interactive (list nil last-nonmenu-event))
   (message "Checking holidays...")
-  (or date (setq date (calendar-cursor-to-date t)))
-  (let* ((date-string (calendar-date-string date))
-         (holiday-list (calendar-check-holidays date))
-         (holiday-string (mapconcat 'identity holiday-list ";  "))
-         (msg (format "%s:  %s" date-string holiday-string)))
+  (or date (setq date (calendar-cursor-to-date t event)))
+  (let ((date-string (calendar-date-string date))
+        (holiday-list (calendar-check-holidays date))
+        selection msg)
+    (if (mouse-event-p event)
+        (and (setq selection (cal-menu-x-popup-menu event
+                                 (format "Holidays for %s" date-string)
+                               (if holiday-list
+                                   (mapcar 'list holiday-list)
+                                 '("None"))))
+             (call-interactively selection))
     (if (not holiday-list)
         (message "No holidays known for %s" date-string)
-      (if (<= (length msg) (frame-width))
+      (if (<= (length (setq msg
+                            (format "%s:  %s" date-string
+                                    (mapconcat 'identity holiday-list ";  "))))
+              (frame-width))
           (message "%s" msg)
         (calendar-in-read-only-buffer holiday-buffer
           (calendar-set-mode-line date-string)
           (insert (mapconcat 'identity holiday-list "\n")))
-        (message "Checking holidays...done")))))
+        (message "Checking holidays...done"))))))
 
 ;; FIXME move to calendar?
 ;;;###cal-autoload