changeset 92647:8b4648ec6f76

(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): Doc fixes. (cal-menu-set-date-title): Move definition before use.
author Glenn Morris <rgm@gnu.org>
date Sat, 08 Mar 2008 21:04:33 +0000
parents 0ba3fd2cffe1
children 6e0a9f226208
files lisp/calendar/cal-menu.el
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-menu.el	Sat Mar 08 20:55:46 2008 +0000
+++ b/lisp/calendar/cal-menu.el	Sat Mar 08 21:04:33 2008 +0000
@@ -116,6 +116,7 @@
      ["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))
@@ -200,8 +201,8 @@
     ["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 @@
 (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 @@
 
 (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 @@
     (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 @@
     (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 @@
     ["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"