diff options
| author | Chong Yidong | 2006-09-26 18:05:41 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-09-26 18:05:41 +0000 |
| commit | 90e93246f3c9bcb309d706728c3215ada77638ec (patch) | |
| tree | 802d42ed7a016a49cc672684f48d180b4840cb45 | |
| parent | 44ea768c8c9ebe99e7e41c2b6f539173e6a4a384 (diff) | |
| download | emacs-90e93246f3c9bcb309d706728c3215ada77638ec.tar.gz emacs-90e93246f3c9bcb309d706728c3215ada77638ec.zip | |
* gnus-demon.el (gnus-demon): Use with-local-quit to avoid hangs.
| -rw-r--r-- | lisp/gnus/gnus-demon.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el index 8df3a3b0e70..bf35f1ddee7 100644 --- a/lisp/gnus/gnus-demon.el +++ b/lisp/gnus/gnus-demon.el | |||
| @@ -218,7 +218,7 @@ time Emacs has been idle for IDLE `gnus-demon-timestep's." | |||
| 218 | (< idle gnus-demon-idle-time)) ; Idle timed out. | 218 | (< idle gnus-demon-idle-time)) ; Idle timed out. |
| 219 | (t (< 0 gnus-demon-idle-time)))) ; Or just need to be idle. | 219 | (t (< 0 gnus-demon-idle-time)))) ; Or just need to be idle. |
| 220 | ;; So we call the handler. | 220 | ;; So we call the handler. |
| 221 | (progn | 221 | (with-local-quit |
| 222 | (ignore-errors (funcall (car handler))) | 222 | (ignore-errors (funcall (car handler))) |
| 223 | ;; And reset the timer. | 223 | ;; And reset the timer. |
| 224 | (setcar (nthcdr 1 handler) | 224 | (setcar (nthcdr 1 handler) |
| @@ -232,14 +232,15 @@ time Emacs has been idle for IDLE `gnus-demon-timestep's." | |||
| 232 | (gnus-demon-is-idle-p)) | 232 | (gnus-demon-is-idle-p)) |
| 233 | ;; We want to call this handler each and every time that | 233 | ;; We want to call this handler each and every time that |
| 234 | ;; Emacs is idle. | 234 | ;; Emacs is idle. |
| 235 | (ignore-errors (funcall (car handler)))) | 235 | (with-local-quit |
| 236 | (ignore-errors (funcall (car handler))))) | ||
| 236 | (t | 237 | (t |
| 237 | ;; We want to call this handler only if Emacs has been idle | 238 | ;; We want to call this handler only if Emacs has been idle |
| 238 | ;; for a specified number of timesteps. | 239 | ;; for a specified number of timesteps. |
| 239 | (and (not (memq (car handler) gnus-demon-idle-has-been-called)) | 240 | (and (not (memq (car handler) gnus-demon-idle-has-been-called)) |
| 240 | (< idle gnus-demon-idle-time) | 241 | (< idle gnus-demon-idle-time) |
| 241 | (gnus-demon-is-idle-p) | 242 | (gnus-demon-is-idle-p) |
| 242 | (progn | 243 | (with-local-quit |
| 243 | (ignore-errors (funcall (car handler))) | 244 | (ignore-errors (funcall (car handler))) |
| 244 | ;; Make sure the handler won't be called once more in | 245 | ;; Make sure the handler won't be called once more in |
| 245 | ;; this idle-cycle. | 246 | ;; this idle-cycle. |