aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/time.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/time.el b/lisp/time.el
index 8e93bef5e02..371d81578e6 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -62,8 +62,9 @@ If `display-time-day-and-date' is non-nil, the current day and date
62are displayed as well. 62are displayed as well.
63After each update, `display-time-hook' is run with `run-hooks'." 63After each update, `display-time-hook' is run with `run-hooks'."
64 (interactive) 64 (interactive)
65 (let ((live (and display-time-process 65 (let ((live (or (and (eq system-type 'ms-dos) dos-display-time)
66 (eq (process-status display-time-process) 'run)))) 66 (and display-time-process
67 (eq (process-status display-time-process) 'run)))))
67 (if (not live) 68 (if (not live)
68 (progn 69 (progn
69 (if display-time-process 70 (if display-time-process
@@ -73,16 +74,22 @@ After each update, `display-time-hook' is run with `run-hooks'."
73 (setq global-mode-string 74 (setq global-mode-string
74 (append global-mode-string '(display-time-string)))) 75 (append global-mode-string '(display-time-string))))
75 (setq display-time-string "") 76 (setq display-time-string "")
76 ;; Using a pty is wasteful, and the separate session causes 77 (if (eq system-type 'ms-dos)
77 ;; annoyance sometimes (some systems kill idle sessions). 78 (setq dos-display-time t)
78 (let ((process-connection-type nil)) 79 ;; Using a pty is wasteful, and the separate session causes
79 (setq display-time-process 80 ;; annoyance sometimes (some systems kill idle sessions).
80 (start-process "display-time" nil 81 (progn
81 (expand-file-name "wakeup" exec-directory) 82 (let ((process-connection-type nil))
82 (int-to-string display-time-interval)))) 83 (setq display-time-process
83 (process-kill-without-query display-time-process) 84 (start-process "display-time" nil
84 (set-process-sentinel display-time-process 'display-time-sentinel) 85 (expand-file-name
85 (set-process-filter display-time-process 'display-time-filter))))) 86 "wakeup" exec-directory)
87 (int-to-string display-time-interval))))
88 (process-kill-without-query display-time-process)
89 (set-process-sentinel display-time-process
90 'display-time-sentinel)
91 (set-process-filter display-time-process
92 'display-time-filter)))))))
86 93
87(defun display-time-sentinel (proc reason) 94(defun display-time-sentinel (proc reason)
88 (or (eq (process-status proc) 'run) 95 (or (eq (process-status proc) 'run)