Commit 6cd61ebd authored by Glenn Morris's avatar Glenn Morris
Browse files

(displayed-year): Move declaration where needed.

(calendar-event-to-date, cal-tex-mouse-week, cal-tex-mouse-week-iso): Doc fix.
(calendar-mouse-goto-date): Move definition before use.
parent 5424a530
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
(french-calendar-day-name-array, french-calendar-special-days-array): (french-calendar-day-name-array, french-calendar-special-days-array):
Add doc strings. Add doc strings.
   
* calendar/cal-menu.el (displayed-year): Move declaration where needed.
(calendar-event-to-date, cal-tex-mouse-week, cal-tex-mouse-week-iso):
Doc fix.
(calendar-mouse-goto-date): Move definition before use.
* calendar/cal-persia.el (calendar-goto-persian-date): Doc fix. * calendar/cal-persia.el (calendar-goto-persian-date): Doc fix.
   
* calendar/diary-lib.el (mark-diary-entries): Move some constant * calendar/diary-lib.el (mark-diary-entries): Move some constant
......
...@@ -80,8 +80,6 @@ ...@@ -80,8 +80,6 @@
(declare-function calendar-print-chinese-date "cal-china" nil) (declare-function calendar-print-chinese-date "cal-china" nil)
(declare-function calendar-goto-date "cal-move" (date)) (declare-function calendar-goto-date "cal-move" (date))
(defvar displayed-year)
(defconst cal-menu-moon-menu (defconst cal-menu-moon-menu
'("Moon" '("Moon"
["Lunar Phases" calendar-phases-of-moon])) ["Lunar Phases" calendar-phases-of-moon]))
...@@ -130,6 +128,8 @@ ...@@ -130,6 +128,8 @@
(calendar-month-name (car my2) 'abbrev) (calendar-month-name (car my2) 'abbrev)
(cdr my2))))) (cdr my2)))))
(defvar displayed-year) ; from generate-calendar
(defconst cal-menu-holidays-menu (defconst cal-menu-holidays-menu
`("Holidays" `("Holidays"
["For Cursor Date -" calendar-cursor-holidays ["For Cursor Date -" calendar-cursor-holidays
...@@ -228,12 +228,17 @@ POSITION and MENU are passed to `x-popup-menu'." ...@@ -228,12 +228,17 @@ POSITION and MENU are passed to `x-popup-menu'."
(defun calendar-event-to-date (&optional error) (defun calendar-event-to-date (&optional error)
"Date of last event. "Date of last event.
If event is not on a specific date, signals an error if optional parameter If event is not on a specific date, signals an error if optional parameter
ERROR is t, otherwise just returns nil." ERROR is non-nil, otherwise just returns nil."
(with-current-buffer (with-current-buffer
(window-buffer (posn-window (event-start last-input-event))) (window-buffer (posn-window (event-start last-input-event)))
(goto-char (posn-point (event-start last-input-event))) (goto-char (posn-point (event-start last-input-event)))
(calendar-cursor-to-date error))) (calendar-cursor-to-date error)))
(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 calendar-mouse-sunrise/sunset () (defun calendar-mouse-sunrise/sunset ()
"Show sunrise/sunset times for mouse-selected date." "Show sunrise/sunset times for mouse-selected date."
(interactive) (interactive)
...@@ -332,7 +337,7 @@ is non-nil." ...@@ -332,7 +337,7 @@ is non-nil."
(defun cal-tex-mouse-week () (defun cal-tex-mouse-week ()
"One page calendar for week indicated by cursor. "One page calendar for week indicated by cursor.
Holidays are included if `cal-tex-holidays' is t." Holidays are included if `cal-tex-holidays' is non-nil."
(interactive) (interactive)
(save-excursion (save-excursion
(calendar-mouse-goto-date (calendar-event-to-date)) (calendar-mouse-goto-date (calendar-event-to-date))
...@@ -348,7 +353,7 @@ The printed output will be on two pages." ...@@ -348,7 +353,7 @@ The printed output will be on two pages."
(defun cal-tex-mouse-week-iso () (defun cal-tex-mouse-week-iso ()
"One page calendar for week indicated by cursor. "One page calendar for week indicated by cursor.
Holidays are included if `cal-tex-holidays' is t." Holidays are included if `cal-tex-holidays' is non-nil."
(interactive) (interactive)
(save-excursion (save-excursion
(calendar-mouse-goto-date (calendar-event-to-date)) (calendar-mouse-goto-date (calendar-event-to-date))
...@@ -478,11 +483,6 @@ EVENT is the event that invoked this command." ...@@ -478,11 +483,6 @@ EVENT is the event that invoked this command."
(calendar-mouse-goto-date (calendar-event-to-date)) (calendar-mouse-goto-date (calendar-event-to-date))
(calendar-print-chinese-date))) (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) (defun cal-menu-set-date-title (menu)
"Convert date of last event to title suitable for MENU." "Convert date of last event to title suitable for MENU."
(easy-menu-filter-return (easy-menu-filter-return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment