X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/62fb5e25f4a4c7da6fe6a06569b22a27998ae6bf..cbee283dd7dd655124e81a6bd555506476180b5d:/lisp/play/zone.el diff --git a/lisp/play/zone.el b/lisp/play/zone.el index f1bbfb1993..b8b413540b 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -1,7 +1,7 @@ ;;; zone.el --- idle display hacks ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: Victor Zandy ;; Maintainer: Thien-Thi Nguyen @@ -86,30 +86,10 @@ If nil, don't interrupt for about 1^26 seconds.") ,@body)) (defmacro zone-hiding-modeline (&rest body) - `(let (bg mode-line-fg mode-line-bg mode-line-box) - (unwind-protect - (progn - (when (and (= 0 (get 'zone 'modeline-hidden-level)) - (display-color-p)) - (setq bg (face-background 'default) - mode-line-box (face-attribute 'mode-line :box) - mode-line-fg (face-attribute 'mode-line :foreground) - mode-line-bg (face-attribute 'mode-line :background)) - (set-face-attribute 'mode-line nil - :foreground bg - :background bg - :box nil)) - (put 'zone 'modeline-hidden-level - (1+ (get 'zone 'modeline-hidden-level))) - ,@body) - (put 'zone 'modeline-hidden-level - (1- (get 'zone 'modeline-hidden-level))) - (when (and (> 1 (get 'zone 'modeline-hidden-level)) - mode-line-fg) - (set-face-attribute 'mode-line nil - :foreground mode-line-fg - :background mode-line-bg - :box mode-line-box))))) + ;; This formerly worked by temporarily altering face `mode-line', + ;; which did not even work right, it seems. + `(let (mode-line-format) + ,@body)) (defun zone-call (program &optional timeout) "Call PROGRAM in a zoned way. @@ -158,6 +138,7 @@ If the element is a function or a list of a function and a number, (sit-for 0 500) (let ((pgm (elt zone-programs (random (length zone-programs)))) (ct (and f (frame-parameter f 'cursor-type))) + (show-trailing-whitespace nil) (restore (list '(kill-buffer outbuf)))) (when ct (modify-frame-parameters f '((cursor-type . (bar . 0)))) @@ -399,20 +380,20 @@ If the element is a function or a list of a function and a number, (let* ((specs (apply 'vector (let (res) - (mapcar (lambda (ent) - (let* ((beg (car ent)) - (end (cdr ent)) - (amt (if random-style - (funcall random-style) - (- (random 7) 3)))) - (when (< (- end (abs amt)) beg) - (setq amt (random (- end beg)))) - (unless (= 0 amt) - (setq res - (cons - (vector amt beg (- end (abs amt))) - res))))) - (zone-line-specs)) + (mapc (lambda (ent) + (let* ((beg (car ent)) + (end (cdr ent)) + (amt (if random-style + (funcall random-style) + (- (random 7) 3)))) + (when (< (- end (abs amt)) beg) + (setq amt (random (- end beg)))) + (unless (= 0 amt) + (setq res + (cons + (vector amt beg (- end (abs amt))) + res))))) + (zone-line-specs)) res))) (n (length specs)) amt aamt cut paste txt i ent) @@ -508,7 +489,7 @@ If the element is a function or a list of a function and a number, (wait 0.15) newpos fall-p) (while (when (save-excursion - (next-line 1) + (forward-line 1) (and (= col (current-column)) (setq newpos (point)) (string= spaces (buffer-substring-no-properties @@ -704,10 +685,11 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") (life (or zone-pgm-random-life-wait (random 4))) (kill-buffer nil)))) + (random t) ;;;;;;;;;;;;;;; (provide 'zone) -;;; arch-tag: 7092503d-74a9-4325-a55c-a026ede58cea +;; arch-tag: 7092503d-74a9-4325-a55c-a026ede58cea ;;; zone.el ends here