Commit c8dc27bf authored by Glenn Morris's avatar Glenn Morris

(diary-entry): Add help-echo and follow-link properties to this button.

(diary-fancy-display): Don't extend the button to the final newline.
(diary-fancy-display-mode): Continue to define "q" as a local key.
parent cca065d8
2009-09-05 Glenn Morris <rgm@gnu.org> 2009-09-05 Glenn Morris <rgm@gnu.org>
* calendar/diary-lib.el (diary-entry): Add help-echo and follow-link
properties to this button.
(diary-fancy-display): Don't extend the button to the final newline.
(diary-fancy-display-mode): Continue to define "q" as a local key.
* calendar/cal-china.el (holiday-chinese): Make it slightly more * calendar/cal-china.el (holiday-chinese): Make it slightly more
efficient. efficient.
......
...@@ -908,9 +908,9 @@ in the mode line. This is an option for `diary-display-function'." ...@@ -908,9 +908,9 @@ in the mode line. This is an option for `diary-display-function'."
(define-obsolete-function-alias 'simple-diary-display (define-obsolete-function-alias 'simple-diary-display
'diary-simple-display "23.1") 'diary-simple-display "23.1")
(define-button-type 'diary-entry (define-button-type 'diary-entry 'action #'diary-goto-entry
'action #'diary-goto-entry 'face 'diary-button 'help-echo "Find this diary entry"
'face 'diary-button) 'follow-link t)
(defun diary-goto-entry (button) (defun diary-goto-entry (button)
"Jump to the diary entry for the BUTTON at point." "Jump to the diary entry for the BUTTON at point."
...@@ -1000,7 +1000,7 @@ This is an option for `diary-display-function'." ...@@ -1000,7 +1000,7 @@ This is an option for `diary-display-function'."
this-loc marks temp-face) this-loc marks temp-face)
(unless (zerop (length this-entry)) (unless (zerop (length this-entry))
(if (setq this-loc (nth 3 entry)) (if (setq this-loc (nth 3 entry))
(insert-button (concat this-entry "\n") (insert-button this-entry
;; (MARKER FILENAME SPECIFIER LITERAL) ;; (MARKER FILENAME SPECIFIER LITERAL)
'locator (list (car this-loc) 'locator (list (car this-loc)
(cadr this-loc) (cadr this-loc)
...@@ -1008,7 +1008,8 @@ This is an option for `diary-display-function'." ...@@ -1008,7 +1008,8 @@ This is an option for `diary-display-function'."
(or (nth 2 this-loc) (or (nth 2 this-loc)
(nth 1 entry))) (nth 1 entry)))
:type 'diary-entry) :type 'diary-entry)
(insert this-entry ?\n)) (insert this-entry))
(insert ?\n)
;; Doesn't make sense to check font-lock-mode - see ;; Doesn't make sense to check font-lock-mode - see
;; comments above diary-entry-marker in calendar.el. ;; comments above diary-entry-marker in calendar.el.
(and ; font-lock-mode (and ; font-lock-mode
...@@ -2362,6 +2363,7 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil." ...@@ -2362,6 +2363,7 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil."
t nil nil nil t nil nil nil
(font-lock-fontify-region-function (font-lock-fontify-region-function
. diary-fancy-font-lock-fontify-region-function))) . diary-fancy-font-lock-fontify-region-function)))
(local-set-key "q" 'quit-window)
(set (make-local-variable 'minor-mode-overriding-map-alist) (set (make-local-variable 'minor-mode-overriding-map-alist)
(list (cons t diary-fancy-overriding-map))) (list (cons t diary-fancy-overriding-map)))
(view-mode 1)) (view-mode 1))
......
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