]> git.eshelyaron.com Git - emacs.git/commitdiff
(cal-menu-holiday-window-suffix)
authorGlenn Morris <rgm@gnu.org>
Sat, 8 Mar 2008 21:05:13 +0000 (21:05 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 8 Mar 2008 21:05:13 +0000 (21:05 +0000)
(cal-menu-x-popup-menu, calendar-mouse-holidays)
(calendar-mouse-view-diary-entries, calendar-mouse-print-dates)
(calendar-mouse-goto-date): Doc fixes.
(cal-menu-set-date-title): Move definition before use.

lisp/ChangeLog
lisp/calendar/cal-menu.el

index fd96e1ae5786218da4848fd1b855b741d7b2703e..ddc59b237bd84f5f4cd9a9529fbd497a5884912c 100644 (file)
        (calendar-read-mayan-haab-date, calendar-read-mayan-tzolkin-date)
        (calendar-next-calendar-round-date)
        (calendar-mayan-long-count-common-era):
+       * calendar/cal-menu.el (cal-menu-holiday-window-suffix)
+       (cal-menu-x-popup-menu, calendar-mouse-holidays)
+       (calendar-mouse-view-diary-entries, calendar-mouse-print-dates)
+       (calendar-mouse-goto-date):
        * calendar/cal-move.el (calendar-scroll-left, calendar-scroll-right):
        * calendar/lunar.el (phases-of-moon, lunar-new-moon-on-or-after):
        Doc fixes.
index 2b2efd1cb3a4b20dadf8c2c368e72a6704d107e8..f458ebec2f70df958095c8ef9807ff19f2d299e3 100644 (file)
      ["Yearly" insert-yearly-hebrew-diary-entry])))
 
 (defun cal-menu-holiday-window-suffix ()
+  "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'."
   (let ((my1 (calendar-increment-month -1))
         (my2 (calendar-increment-month 1)))
     (if (= (cdr my1) (cdr my2))
     ["Backward 1 Year" "4\ev"]))
 
 (defun cal-menu-x-popup-menu (position menu)
-  "Like `x-popup-menu', but prints an error message if popup menus are
-not available."
+  "Like `x-popup-menu', but print an error message if popups are unavailable.
+POSITION and MENU are passed to `x-popup-menu'."
   (if (display-popup-menus-p)
       (x-popup-menu position menu)
     (error "Popup menus are not available on this system")))
@@ -251,7 +252,8 @@ ERROR is t, otherwise just returns nil."
 (autoload 'diary-list-entries "diary-lib")
 
 (defun calendar-mouse-holidays (&optional event)
-  "Pop up menu of holidays for mouse selected date."
+  "Pop up menu of holidays for mouse selected date.
+EVENT is the event that invoked this command."
   (interactive "e")
   (let* ((date (calendar-event-to-date))
          (l (mapcar 'list (calendar-check-holidays date)))
@@ -269,9 +271,9 @@ ERROR is t, otherwise just returns nil."
 
 (defun calendar-mouse-view-diary-entries (&optional date diary event)
   "Pop up menu of diary entries for mouse-selected date.
-Use optional DATE and alternative file DIARY.
-
-Any holidays are shown if `holidays-in-diary-buffer' is t."
+Use optional DATE and alternative file DIARY.  EVENT is the event
+that invoked this command.  Shows holidays if `holidays-in-diary-buffer'
+is non-nil."
   (interactive "i\ni\ne")
   (let* ((date (or date (calendar-event-to-date)))
          (diary-file (if diary diary diary-file))
@@ -418,7 +420,8 @@ The output is in landscape format, one month to a page."
     (cal-tex-cursor-year-landscape nil)))
 
 (defun calendar-mouse-print-dates (&optional event)
-  "Pop up menu of equivalent dates to mouse selected date."
+  "Pop up menu of equivalent dates to mouse selected date.
+EVENT is the event that invoked this command."
   (interactive "e")
   (let* ((date (calendar-event-to-date))
         (selection
@@ -476,9 +479,15 @@ The output is in landscape format, one month to a page."
     (calendar-print-chinese-date)))
 
 (defun calendar-mouse-goto-date (date)
+  "Goto DATE in the buffer specified by `last-input-event'."
   (set-buffer (window-buffer (posn-window (event-start last-input-event))))
   (calendar-goto-date date))
 
+(defun cal-menu-set-date-title (menu)
+  "Convert date of last event to title suitable for MENU."
+  (easy-menu-filter-return
+   menu (calendar-date-string (calendar-event-to-date t) t nil)))
+
 (easy-menu-define cal-menu-context-mouse-menu nil
   "Pop up menu for Mouse-2 for selected date in the calendar window."
   '("foo" :filter cal-menu-set-date-title
@@ -506,10 +515,6 @@ The output is in landscape format, one month to a page."
     ["Insert diary entry" calendar-mouse-insert-diary-entry]
     ["Other diary file entries" calendar-mouse-view-other-diary-entries]))
 
-(defun cal-menu-set-date-title (menu)
-  (easy-menu-filter-return
-   menu (calendar-date-string (calendar-event-to-date t) t nil)))
-
 (easy-menu-define cal-menu-global-mouse-menu nil
   "Menu bound to a mouse event, not specific to the mouse-click location."
   '("Calendar"