Commit a769dd15 authored by Glenn Morris's avatar Glenn Morris
Browse files

Small cal-menu fix for bug#9976

* lisp/calendar/cal-menu.el (cal-menu-set-date-title):
Do nothing if not in a calendar.
parent 441950c7
2011-11-07 Glenn Morris <rgm@gnu.org>
* calendar/cal-menu.el (cal-menu-set-date-title):
Do nothing if not in a calendar. (Bug#9976)
2011-11-07 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (find-file): Always use selected-window.
......
......@@ -215,13 +215,15 @@ is non-nil."
;; but easymenu does not seem to allow this (?).
;; The ignore-errors is because `documentation' can end up calling
;; this in a non-calendar buffer where displayed-month is unbound. (Bug#3862)
;; This still has issues - bug#9976, so added derived-mode-p call.
(defun cal-menu-set-date-title (menu)
"Convert date of last event to title suitable for MENU."
(let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event))))
(if date
(easy-menu-filter-return menu (calendar-date-string date t nil))
(message "Not on a date!")
nil)))
(when (derived-mode-p 'calendar-mode)
(let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event))))
(if date
(easy-menu-filter-return menu (calendar-date-string date t nil))
(message "Not on a date!")
nil))))
(easy-menu-define cal-menu-context-mouse-menu nil
"Pop up mouse menu for selected date in the calendar window."
......
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