emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/holidays.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/holidays.el,v
Date: Thu, 26 Jun 2008 04:54:28 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/06/26 04:54:28

Index: holidays.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/holidays.el,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- holidays.el 18 Jun 2008 02:55:32 -0000      1.81
+++ holidays.el 26 Jun 2008 04:54:27 -0000      1.82
@@ -625,25 +625,34 @@
   '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))
+  (or date (setq date (calendar-cursor-to-date t event)))
+  (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)))
+        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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]