;;; 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 <zandy@cs.wisc.edu>
;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org>
,@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.
(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))))
(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)
(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
(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