diff options
| author | Karl Heuer | 1995-12-19 21:02:04 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-12-19 21:02:04 +0000 |
| commit | 2eb271bec46b69ab656d147add4c5dceab1fb68f (patch) | |
| tree | e3f953e21676e6b34bb9745bfe8684975e43948e /lisp | |
| parent | 8ee2fef4e081d146684a073787dc13de5d28b6d7 (diff) | |
| download | emacs-2eb271bec46b69ab656d147add4c5dceab1fb68f.tar.gz emacs-2eb271bec46b69ab656d147add4c5dceab1fb68f.zip | |
(display-time): make it work under ms-dos by setting the
`dos-display-time' variable instead of invoking `wakeup' as
asynchronous process (which doesn't work under ms-dos).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/time.el | 31 |
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 | |||
| 62 | are displayed as well. | 62 | are displayed as well. |
| 63 | After each update, `display-time-hook' is run with `run-hooks'." | 63 | After 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) |