annotate lisp/play/zone.el @ 89324:7f05ba2b8954

*** empty log message ***
author Dave Love <fx@gnu.org>
date Fri, 03 Jan 2003 20:25:06 +0000
parents ac1b9223bb7f
children a04951f92260
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; zone.el --- idle display hacks
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
38677
7177c6c2aaba (zone-pgm-stress): Use unwind-protect to make sure
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
3 ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 32348
diff changeset
5 ;; Author: Victor Zandy <zandy@cs.wisc.edu>
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 32348
diff changeset
6 ;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org>
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 32348
diff changeset
7 ;; Keywords: games
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 32348
diff changeset
8 ;; Created: June 6, 1998
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; any later version.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 ;; Don't zone out in front of Emacs! Try M-x zone.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 ;; If it eventually irritates you, try M-x zone-leave-me-alone.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 ;; Bored by the zone pyrotechnics? Write your own! Add it to
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
33 ;; `zone-programs'. See `zone-call' for higher-ordered zoning.
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35 ;; WARNING: Not appropriate for Emacs sessions over modems or
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 ;; computers as slow as mine.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 ;; THANKS: Christopher Mayer, Scott Flinchbaugh, Rachel Kalmar,
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
39 ;; Max Froumentin.
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 ;;; Code:
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 (require 'timer)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 (require 'tabify)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 (eval-when-compile (require 'cl))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 (defvar zone-idle 20
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 "*Seconds to idle before zoning out.")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
50 (defvar zone-timeout nil
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
51 "*Seconds to timeout the zoning.
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
52 If nil, don't interrupt for about 1^26 seconds.")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
53
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 ;; Vector of functions that zone out. `zone' will execute one of
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 ;; these functions, randomly chosen. The chosen function is invoked
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 ;; in the *zone* buffer, which contains the text of the selected
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 ;; window. If the function loops, it *must* periodically check and
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 ;; halt if `input-pending-p' is t (because quitting is disabled when
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 ;; Emacs idle timers are run).
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 (defvar zone-programs [
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 zone-pgm-jitter
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 zone-pgm-putz-with-case
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 zone-pgm-dissolve
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
64 ;; zone-pgm-explode
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 zone-pgm-whack-chars
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 zone-pgm-rotate
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 zone-pgm-rotate-LR-lockstep
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 zone-pgm-rotate-RL-lockstep
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 zone-pgm-rotate-LR-variable
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 zone-pgm-rotate-RL-variable
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 zone-pgm-drip
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 zone-pgm-drip-fretfully
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 zone-pgm-five-oclock-swan-dive
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 zone-pgm-martini-swan-dive
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75 zone-pgm-paragraph-spaz
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76 zone-pgm-stress
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
77 zone-pgm-stress-destress
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 ])
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 (defmacro zone-orig (&rest body)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81 `(with-current-buffer (get 'zone 'orig-buffer)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 ,@body))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
84 (defmacro zone-hiding-modeline (&rest body)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
85 `(let (bg mode-line-fg mode-line-bg mode-line-box)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
86 (unwind-protect
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
87 (progn
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
88 (when (and (= 0 (get 'zone 'modeline-hidden-level))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
89 (display-color-p))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
90 (setq bg (face-background 'default)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
91 mode-line-box (face-attribute 'mode-line :box)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
92 mode-line-fg (face-attribute 'mode-line :foreground)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
93 mode-line-bg (face-attribute 'mode-line :background))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
94 (set-face-attribute 'mode-line nil
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
95 :foreground bg
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
96 :background bg
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
97 :box nil))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
98 (put 'zone 'modeline-hidden-level
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
99 (1+ (get 'zone 'modeline-hidden-level)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
100 ,@body)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
101 (put 'zone 'modeline-hidden-level
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
102 (1- (get 'zone 'modeline-hidden-level)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
103 (when (and (> 1 (get 'zone 'modeline-hidden-level))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
104 mode-line-fg)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
105 (set-face-attribute 'mode-line nil
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
106 :foreground mode-line-fg
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
107 :background mode-line-bg
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
108 :box mode-line-box)))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
109
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
110 (defun zone-call (program &optional timeout)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
111 "Call PROGRAM in a zoned way.
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
112 If PROGRAM is a function, call it, interrupting after the amount
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
113 of time in seconds specified by optional arg TIMEOUT, or `zone-timeout'
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
114 if unspecified, q.v.
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
115 PROGRAM can also be a list of elements, which are interpreted like so:
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
116 If the element is a function or a list of a function and a number,
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
117 apply `zone-call' recursively."
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
118 (cond ((functionp program)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
119 (with-timeout ((or timeout zone-timeout (ash 1 26)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
120 (funcall program)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
121 ((listp program)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
122 (mapcar (lambda (elem)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
123 (cond ((functionp elem) (zone-call elem))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
124 ((and (listp elem)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
125 (functionp (car elem))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
126 (numberp (cadr elem)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
127 (apply 'zone-call elem))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
128 (t (error "bad `zone-call' elem:" elem))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
129 program))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
130
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131 ;;;###autoload
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 (defun zone ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 "Zone out, completely."
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
134 (interactive)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
135 (let ((timer (get 'zone 'timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
136 (and (timerp timer) (cancel-timer timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
137 (put 'zone 'timer nil)
30592
fbdf4c1e1acf (zone, zone-pgm-stress): Don't use window-system.
Eli Zaretskii <eliz@gnu.org>
parents: 30565
diff changeset
138 (let ((f (selected-frame))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 (outbuf (get-buffer-create "*zone*"))
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
140 (text (buffer-substring (window-start) (window-end)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
141 (wp (1+ (- (window-point (selected-window))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
142 (window-start)))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
143 (put 'zone 'orig-buffer (current-buffer))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
144 (put 'zone 'modeline-hidden-level 0)
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 (set-buffer outbuf)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 (setq mode-name "Zone")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 (erase-buffer)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 (insert text)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 (switch-to-buffer outbuf)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 (setq buffer-undo-list t)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 (untabify (point-min) (point-max))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 (set-window-start (selected-window) (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 (set-window-point (selected-window) wp)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 (sit-for 0 500)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 (let ((pgm (elt zone-programs (random (length zone-programs))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 (ct (and f (frame-parameter f 'cursor-type))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 (when ct (modify-frame-parameters f '((cursor-type . (bar . 0)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 (condition-case nil
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
159 (progn
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 (message "Zoning... (%s)" pgm)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
161 (garbage-collect)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
162 ;; If some input is pending, zone says "sorry", which
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
163 ;; isn't nice; this might happen e.g. when they invoke the
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
164 ;; game by clicking the menu bar. So discard any pending
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
165 ;; input before zoning out.
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
166 (if (input-pending-p)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
167 (discard-input))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
168 (zone-call pgm)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
169 (message "Zoning...sorry"))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
170 (error
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
171 (while (not (input-pending-p))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
172 (message (format "We were zoning when we wrote %s..." pgm))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
173 (sit-for 3)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
174 (message "...here's hoping we didn't hose your buffer!")
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
175 (sit-for 3)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
176 (quit (ding) (message "Zoning...sorry")))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
177 (when ct (modify-frame-parameters f (list (cons 'cursor-type ct)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
178 (kill-buffer outbuf)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
179 (zone-when-idle zone-idle)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 ;;;; Zone when idle, or not.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 (defun zone-when-idle (secs)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 "Zone out when Emacs has been idle for SECS seconds."
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 (interactive "nHow long before I start zoning (seconds): ")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 (or (<= secs 0)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
187 (let ((timer (get 'zone 'timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
188 (or (eq timer t)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
189 (timerp timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
190 (put 'zone 'timer (run-with-idle-timer secs t 'zone))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 (defun zone-leave-me-alone ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 "Don't zone out when Emacs is idle."
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194 (interactive)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
195 (let ((timer (get 'zone 'timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
196 (and (timerp timer) (cancel-timer timer)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
197 (put 'zone 'timer t)
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 (message "I won't zone out any more"))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
201 ;;;; zone-pgm-jitter
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
203 (defun zone-shift-up ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204 (let* ((b (point))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
205 (e (progn
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
206 (end-of-line)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
207 (if (looking-at "\n") (1+ (point)) (point))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
208 (s (buffer-substring b e)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
209 (delete-region b e)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
210 (goto-char (point-max))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
211 (insert s)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
212
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
213 (defun zone-shift-down ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
214 (goto-char (point-max))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
215 (forward-line -1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216 (beginning-of-line)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 (let* ((b (point))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
218 (e (progn
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
219 (end-of-line)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
220 (if (looking-at "\n") (1+ (point)) (point))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
221 (s (buffer-substring b e)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222 (delete-region b e)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
223 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224 (insert s)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 (defun zone-shift-left ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 (while (not (eobp))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
228 (or (eolp)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
229 (let ((c (following-char)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
230 (delete-char 1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
231 (end-of-line)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
232 (insert c)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 (forward-line 1)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235 (defun zone-shift-right ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236 (while (not (eobp))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 (end-of-line)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
238 (or (bolp)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
239 (let ((c (preceding-char)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
240 (delete-backward-char 1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
241 (beginning-of-line)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
242 (insert c)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 (forward-line 1)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
244
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
245 (defun zone-pgm-jitter ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
246 (let ((ops [
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247 zone-shift-left
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 zone-shift-left
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
249 zone-shift-left
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
250 zone-shift-left
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251 zone-shift-right
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
252 zone-shift-down
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
253 zone-shift-down
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
254 zone-shift-down
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
255 zone-shift-down
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
256 zone-shift-down
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
257 zone-shift-up
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
258 ]))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
259 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
261 (funcall (elt ops (random (length ops))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
262 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
263 (sit-for 0 10))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
264
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
265
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
266 ;;;; zone-pgm-whack-chars
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
267
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
268 (defun zone-pgm-whack-chars ()
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
269 (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
270 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
271 (let ((i 48))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
272 (while (< i 122)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
273 (aset tbl i (+ 48 (random (- 123 48))))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
274 (setq i (1+ i)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
275 (translate-region (point-min) (point-max) tbl)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
276 (sit-for 0 2)))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
277
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
278 (put 'zone-pgm-whack-chars 'wc-tbl
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
279 (let ((tbl (make-string 128 ?x))
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
280 (i 0))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
281 (while (< i 128)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
282 (aset tbl i i)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
283 (setq i (1+ i)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
284 tbl))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
285
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
286 ;;;; zone-pgm-dissolve
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
287
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
288 (defun zone-remove-text ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
289 (let ((working t))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
290 (while working
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
291 (setq working nil)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
292 (save-excursion
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
293 (goto-char (point-min))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
294 (while (not (eobp))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
295 (if (looking-at "[^(){}\n\t ]")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
296 (let ((n (random 5)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
297 (if (not (= n 0))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
298 (progn
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
299 (setq working t)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
300 (forward-char 1))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
301 (delete-char 1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
302 (insert " ")))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
303 (forward-char 1))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
304 (sit-for 0 2))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
305
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
306 (defun zone-pgm-dissolve ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
307 (zone-remove-text)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
308 (zone-pgm-jitter))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
309
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
310
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
311 ;;;; zone-pgm-explode
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
312
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
313 (defun zone-exploding-remove ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
314 (let ((i 0))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
315 (while (< i 20)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
316 (save-excursion
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
317 (goto-char (point-min))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
318 (while (not (eobp))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
319 (if (looking-at "[^*\n\t ]")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
320 (let ((n (random 5)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
321 (if (not (= n 0))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
322 (forward-char 1))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
323 (insert " ")))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
324 (forward-char 1)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
325 (setq i (1+ i))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
326 (sit-for 0 2)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
327 (zone-pgm-jitter))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
328
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
329 (defun zone-pgm-explode ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
330 (zone-exploding-remove)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
331 (zone-pgm-jitter))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
332
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
333
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
334 ;;;; zone-pgm-putz-with-case
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
335
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
336 ;; Faster than `zone-pgm-putz-with-case', but not as good: all
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
337 ;; instances of the same letter have the same case, which produces a
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
338 ;; less interesting effect than you might imagine.
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
339 (defun zone-pgm-2nd-putz-with-case ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
340 (let ((tbl (make-string 128 ?x))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
341 (i 0))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
342 (while (< i 128)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
343 (aset tbl i i)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
344 (setq i (1+ i)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
345 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
346 (setq i ?a)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
347 (while (<= i ?z)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
348 (aset tbl i
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
349 (if (zerop (random 5))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
350 (upcase i)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
351 (downcase i)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
352 (setq i (+ i (1+ (random 5)))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
353 (setq i ?A)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
354 (while (<= i ?z)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
355 (aset tbl i
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
356 (if (zerop (random 5))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
357 (downcase i)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
358 (upcase i)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
359 (setq i (+ i (1+ (random 5)))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
360 (translate-region (point-min) (point-max) tbl)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
361 (sit-for 0 2))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
362
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
363 (defun zone-pgm-putz-with-case ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
364 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
365 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
366 (let ((np (+ 2 (random 5)))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
367 (pm (point-max)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
368 (while (< np pm)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
369 (goto-char np)
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
370 (let ((prec (preceding-char))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
371 (props (text-properties-at (1- (point)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
372 (insert (if (zerop (random 2))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
373 (upcase prec)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
374 (downcase prec)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
375 (set-text-properties (1- (point)) (point) props))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
376 (backward-char 2)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
377 (delete-char 1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
378 (setq np (+ np (1+ (random 5))))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
379 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
380 (sit-for 0 2)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
381
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
382
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
383 ;;;; zone-pgm-rotate
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
384
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
385 (defun zone-line-specs ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
386 (let (ret)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
387 (save-excursion
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
388 (goto-char (window-start))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
389 (while (< (point) (window-end))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
390 (when (looking-at "[\t ]*\\([^\n]+\\)")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
391 (setq ret (cons (cons (match-beginning 1) (match-end 1)) ret)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
392 (forward-line 1)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
393 ret))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
394
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
395 (defun zone-pgm-rotate (&optional random-style)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
396 (let* ((specs (apply
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
397 'vector
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
398 (let (res)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
399 (mapcar (lambda (ent)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
400 (let* ((beg (car ent))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
401 (end (cdr ent))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
402 (amt (if random-style
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
403 (funcall random-style)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
404 (- (random 7) 3))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
405 (when (< (- end (abs amt)) beg)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
406 (setq amt (random (- end beg))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
407 (unless (= 0 amt)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
408 (setq res
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
409 (cons
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
410 (vector amt beg (- end (abs amt)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
411 res)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
412 (zone-line-specs))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
413 res)))
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
414 (n (length specs))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
415 amt aamt cut paste txt i ent)
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
416 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
417 (setq i 0)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
418 (while (< i n)
32348
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
419 (setq ent (aref specs i))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
420 (setq amt (aref ent 0) aamt (abs amt))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
421 (if (> 0 amt)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
422 (setq cut 1 paste 2)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
423 (setq cut 2 paste 1))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
424 (goto-char (aref ent cut))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
425 (setq txt (buffer-substring (point) (+ (point) aamt)))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
426 (delete-char aamt)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
427 (goto-char (aref ent paste))
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
428 (insert txt)
abc299ad3386 (zone-timer, zone-wc-tbl): Rework
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 30628
diff changeset
429 (setq i (1+ i)))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
430 (sit-for 0.04))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
431
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
432 (defun zone-pgm-rotate-LR-lockstep ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
433 (zone-pgm-rotate (lambda () 1)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
434
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
435 (defun zone-pgm-rotate-RL-lockstep ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
436 (zone-pgm-rotate (lambda () -1)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
437
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
438 (defun zone-pgm-rotate-LR-variable ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
439 (zone-pgm-rotate (lambda () (1+ (random 3)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
440
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
441 (defun zone-pgm-rotate-RL-variable ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
442 (zone-pgm-rotate (lambda () (1- (- (random 3))))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
443
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
444
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
445 ;;;; zone-pgm-drip
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
446
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
447 (defun zone-cpos (pos)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
448 (buffer-substring pos (1+ pos)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
449
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
450 (defun zone-fret (pos)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
451 (let* ((case-fold-search nil)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
452 (c-string (zone-cpos pos))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
453 (hmm (cond
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
454 ((string-match "[a-z]" c-string) (upcase c-string))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
455 ((string-match "[A-Z]" c-string) (downcase c-string))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
456 (t " "))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
457 (do ((i 0 (1+ i))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
458 (wait 0.5 (* wait 0.8)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
459 ((= i 20))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
460 (goto-char pos)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
461 (delete-char 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
462 (insert (if (= 0 (% i 2)) hmm c-string))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
463 (sit-for wait))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
464 (delete-char -1) (insert c-string)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
465
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
466 (defun zone-fall-through-ws (c col wend)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
467 (let ((fall-p nil) ; todo: move outward
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
468 (wait 0.15)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
469 (o (point)) ; for terminals w/o cursor hiding
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
470 (p (point)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
471 (while (progn
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
472 (forward-line 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
473 (move-to-column col)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
474 (looking-at " "))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
475 (setq fall-p t)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
476 (delete-char 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
477 (insert (if (< (point) wend) c " "))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
478 (save-excursion
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
479 (goto-char p)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
480 (delete-char 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
481 (insert " ")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
482 (goto-char o)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
483 (sit-for (setq wait (* wait 0.8))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
484 (setq p (1- (point))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
485 fall-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
486
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
487 (defun zone-pgm-drip (&optional fret-p pancake-p)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
488 (let* ((ww (1- (window-width)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
489 (wh (window-height))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
490 (mc 0) ; miss count
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
491 (total (* ww wh))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
492 (fall-p nil))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
493 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
494 ;; fill out rectangular ws block
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
495 (while (not (eobp))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
496 (end-of-line)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
497 (let ((cc (current-column)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
498 (if (< cc ww)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
499 (insert (make-string (- ww cc) ? ))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
500 (delete-char (- ww cc))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
501 (unless (eobp)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
502 (forward-char 1)))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
503 ;; pad ws past bottom of screen
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
504 (let ((nl (- wh (count-lines (point-min) (point)))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
505 (when (> nl 0)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
506 (let ((line (concat (make-string (1- ww) ? ) "\n")))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
507 (do ((i 0 (1+ i)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
508 ((= i nl))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
509 (insert line)))))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
510 (catch 'done
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
511 (while (not (input-pending-p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
512 (goto-char (point-min))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
513 (sit-for 0)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
514 (let ((wbeg (window-start))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
515 (wend (window-end)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
516 (setq mc 0)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
517 ;; select non-ws character, but don't miss too much
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
518 (goto-char (+ wbeg (random (- wend wbeg))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
519 (while (looking-at "[ \n\f]")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
520 (if (= total (setq mc (1+ mc)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
521 (throw 'done 'sel)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
522 (goto-char (+ wbeg (random (- wend wbeg))))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
523 ;; character animation sequence
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
524 (let ((p (point)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
525 (when fret-p (zone-fret p))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
526 (goto-char p)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
527 (setq fall-p (zone-fall-through-ws
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
528 (zone-cpos p) (current-column) wend))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
529 ;; assuming current-column has not changed...
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
530 (when (and pancake-p
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
531 fall-p
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
532 (< (count-lines (point-min) (point))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
533 wh))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
534 (previous-line 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
535 (forward-char 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
536 (sit-for 0.137)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
537 (delete-char -1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
538 (insert "@")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
539 (sit-for 0.137)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
540 (delete-char -1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
541 (insert "*")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
542 (sit-for 0.137)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
543 (delete-char -1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
544 (insert "_"))))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
545
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
546 (defun zone-pgm-drip-fretfully ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
547 (zone-pgm-drip t))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
548
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
549 (defun zone-pgm-five-oclock-swan-dive ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
550 (zone-pgm-drip nil t))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
551
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
552 (defun zone-pgm-martini-swan-dive ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
553 (zone-pgm-drip t t))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
554
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
555
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
556 ;;;; zone-pgm-paragraph-spaz
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
557
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
558 (defun zone-pgm-paragraph-spaz ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
559 (if (memq (zone-orig major-mode) '(text-mode fundamental-mode))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
560 (let ((fill-column fill-column)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
561 (fc-min fill-column)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
562 (fc-max fill-column)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
563 (max-fc (1- (frame-width))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
564 (while (sit-for 0.1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
565 (fill-paragraph 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
566 (setq fill-column (+ fill-column (- (random 5) 2)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
567 (when (< fill-column fc-min)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
568 (setq fc-min fill-column))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
569 (when (> fill-column max-fc)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
570 (setq fill-column max-fc))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
571 (when (> fill-column fc-max)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
572 (setq fc-max fill-column))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
573 (message "Zoning... (zone-pgm-rotate)")
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
574 (zone-pgm-rotate)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
575
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
576
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
577 ;;;; zone-pgm-stress
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
578
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
579 (defun zone-pgm-stress ()
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
580 (goto-char (point-min))
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
581 (let (lines)
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
582 (while (< (point) (point-max))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
583 (let ((p (point)))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
584 (forward-line 1)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
585 (setq lines (cons (buffer-substring p (point)) lines))))
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
586 (sit-for 5)
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
587 (zone-hiding-modeline
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
588 (let ((msg "Zoning... (zone-pgm-stress)"))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
589 (while (not (string= msg ""))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
590 (message (setq msg (substring msg 1)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
591 (sit-for 0.05)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
592 (while (not (input-pending-p))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
593 (when (< 50 (random 100))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
594 (goto-char (point-max))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
595 (forward-line -1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
596 (let ((kill-whole-line t))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
597 (kill-line))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
598 (goto-char (point-min))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
599 (insert (nth (random (length lines)) lines)))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
600 (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr"))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
601 (sit-for 0.1)))))
38677
7177c6c2aaba (zone-pgm-stress): Use unwind-protect to make sure
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
602
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
603
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
604 ;;;; zone-pgm-stress-destress
38677
7177c6c2aaba (zone-pgm-stress): Use unwind-protect to make sure
Gerd Moellmann <gerd@gnu.org>
parents: 38414
diff changeset
605
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
606 (defun zone-pgm-stress-destress ()
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
607 (zone-call 'zone-pgm-stress 25)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
608 (zone-hiding-modeline
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
609 (sit-for 3)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
610 (erase-buffer)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
611 (sit-for 3)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
612 (insert-buffer "*Messages*")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
613 (message "")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
614 (goto-char (point-max))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
615 (recenter -1)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
616 (sit-for 3)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
617 (delete-region (point-min) (window-start))
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
618 (message "hey why stress out anyway?")
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
619 (zone-call '((zone-pgm-rotate 30)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
620 (zone-pgm-whack-chars 10)
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
621 zone-pgm-drip))))
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
622
42645
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
623
ac1b9223bb7f (zone-timeout): New var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 40347
diff changeset
624 ;;;;;;;;;;;;;;;
30565
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
625 (provide 'zone)
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
626
338238ca63ce *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
627 ;;; zone.el ends here