mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Minor improvements to world-clock
* lisp/time.el (world-clock-mode-map): New variable. Bind 'n' and 'p' to 'next-line' and 'previous-line'. (world-clock-update): Preserve point.
This commit is contained in:
parent
61828e55a8
commit
e860430edc
1 changed files with 9 additions and 1 deletions
10
lisp/time.el
10
lisp/time.el
|
|
@ -525,6 +525,12 @@ If the value is t instead of an alist, use the value of
|
|||
'((t :inherit font-lock-variable-name-face))
|
||||
"Face for time zone label in `world-clock' buffer.")
|
||||
|
||||
(defvar world-clock-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map "n" #'next-line)
|
||||
(define-key map "p" #'previous-line)
|
||||
map))
|
||||
|
||||
(define-derived-mode world-clock-mode special-mode "World clock"
|
||||
"Major mode for buffer that displays times in various time zones.
|
||||
See `world-clock'."
|
||||
|
|
@ -591,7 +597,9 @@ To turn off the world time display, go to the window and type `\\[quit-window]'.
|
|||
"Update the `world-clock' buffer."
|
||||
(if (get-buffer world-clock-buffer-name)
|
||||
(with-current-buffer (get-buffer world-clock-buffer-name)
|
||||
(world-clock-display (time--display-world-list)))
|
||||
(let ((op (point)))
|
||||
(world-clock-display (time--display-world-list))
|
||||
(goto-char op)))
|
||||
(world-clock-cancel-timer)))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue