[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/play/zone.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/play/zone.el |
Date: |
Thu, 13 Jun 2002 18:26:55 -0400 |
Index: emacs/lisp/play/zone.el
diff -c emacs/lisp/play/zone.el:1.8 emacs/lisp/play/zone.el:1.9
*** emacs/lisp/play/zone.el:1.8 Thu Jan 10 17:09:54 2002
--- emacs/lisp/play/zone.el Thu Jun 13 18:26:55 2002
***************
*** 47,52 ****
--- 47,55 ----
(defvar zone-idle 20
"*Seconds to idle before zoning out.")
+ (defvar zone-timer nil
+ "The timer we use to decide when to zone out, or nil if none.")
+
(defvar zone-timeout nil
"*Seconds to timeout the zoning.
If nil, don't interrupt for about 1^26 seconds.")
***************
*** 132,140 ****
(defun zone ()
"Zone out, completely."
(interactive)
- (let ((timer (get 'zone 'timer)))
- (and (timerp timer) (cancel-timer timer)))
- (put 'zone 'timer nil)
(let ((f (selected-frame))
(outbuf (get-buffer-create "*zone*"))
(text (buffer-substring (window-start) (window-end)))
--- 135,140 ----
***************
*** 175,200 ****
(sit-for 3)))
(quit (ding) (message "Zoning...sorry")))
(when ct (modify-frame-parameters f (list (cons 'cursor-type ct)))))
! (kill-buffer outbuf)
! (zone-when-idle zone-idle)))
;;;; Zone when idle, or not.
(defun zone-when-idle (secs)
"Zone out when Emacs has been idle for SECS seconds."
(interactive "nHow long before I start zoning (seconds): ")
(or (<= secs 0)
! (let ((timer (get 'zone 'timer)))
! (or (eq timer t)
! (timerp timer)))
! (put 'zone 'timer (run-with-idle-timer secs t 'zone))))
(defun zone-leave-me-alone ()
"Don't zone out when Emacs is idle."
(interactive)
! (let ((timer (get 'zone 'timer)))
! (and (timerp timer) (cancel-timer timer)))
! (put 'zone 'timer t)
(message "I won't zone out any more"))
--- 175,199 ----
(sit-for 3)))
(quit (ding) (message "Zoning...sorry")))
(when ct (modify-frame-parameters f (list (cons 'cursor-type ct)))))
! (kill-buffer outbuf)))
;;;; Zone when idle, or not.
(defun zone-when-idle (secs)
"Zone out when Emacs has been idle for SECS seconds."
(interactive "nHow long before I start zoning (seconds): ")
+ (if (timerp zone-timer)
+ (cancel-timer zone-timer))
+ (setq zone-timer nil)
(or (<= secs 0)
! (setq zone-timer (run-with-idle-timer secs t 'zone))))
(defun zone-leave-me-alone ()
"Don't zone out when Emacs is idle."
(interactive)
! (if (timerp zone-timer)
! (cancel-timer zone-timer))
! (setq zone-timer nil)
(message "I won't zone out any more"))
- [Emacs-diffs] Changes to emacs/lisp/play/zone.el,
Richard M. Stallman <=