From 3d8c091a03c25826755b3735eca9da4b342826ba Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 26 Apr 2020 09:38:03 +0200 Subject: [PATCH 1/4] Kill display-time-world buffer on exit * lisp/time.el (display-time-world-mode-map): New defvar. (display-time-world-exit): New defun to kill buffer on exit. (display-time-world): Doc fix. --- lisp/time.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/time.el b/lisp/time.el index 44fd1a7e33..a5e5b9b4a7 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -509,6 +509,13 @@ display-time-mode 'display-time-event-handler))) +(defvar display-time-world-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "g" nil) + (define-key map "q" 'display-time-world-exit) + map) + "Keymap for `display-time-world-mode'.") + (define-derived-mode display-time-world-mode special-mode "World clock" "Major mode for buffer that displays times in various time zones. See `display-time-world'." @@ -537,11 +544,17 @@ display-time-world-display (delete-char -1)) (goto-char (point-min))) +(defun display-time-world-exit () + "Quit the world time buffer." + (interactive) + (quit-window t)) + ;;;###autoload (defun display-time-world () "Enable updating display of times in various time zones. +\\ `display-time-world-list' specifies the zones. -To turn off the world time display, go to that window and type `q'." +To turn off the world time display, go to that window and type `\\[display-time-world-exit]'." (interactive) (when (and display-time-world-timer-enable (not (get-buffer display-time-world-buffer-name))) -- 2.26.2