diff options
| author | Thien-Thi Nguyen | 2002-01-10 22:14:26 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2002-01-10 22:14:26 +0000 |
| commit | df9d055ed4e48ecca34927e2479d1284c964c57a (patch) | |
| tree | 11a02cd6e88c9c90f21202732df6fe200a7f306d /lisp | |
| parent | 33f1148dad269d8c81a8d01dd0cf101512e70322 (diff) | |
| download | emacs-df9d055ed4e48ecca34927e2479d1284c964c57a.tar.gz emacs-df9d055ed4e48ecca34927e2479d1284c964c57a.zip | |
(zone-timeout): New var.
(zone-hiding-modeline): New macro.
(zone-call): New func.
(zone): Init `modeline-hidden-level' symbol property.
Use `zone-call' instead of `funcall'.
(zone-pgm-whack-chars): Use `make-string' (bug introduced in 2001-10-26T20:11:25Z!monnier@iro.umontreal.ca).
(zone-pgm-stress): Use `zone-hiding-modeline'.
(zone-pgm-stress-destress): New zone program.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 101 | ||||
| -rw-r--r-- | lisp/play/zone.el | 264 |
2 files changed, 217 insertions, 148 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 089536cca21..9114fb5555c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,12 +1,27 @@ | |||
| 1 | 2002-01-10 Thien-Thi Nguyen <ttn@giblet.glug.org> | ||
| 2 | |||
| 3 | * play/zone.el (zone-timeout): New var. | ||
| 4 | (zone-hiding-modeline): New macro. | ||
| 5 | (zone-call): New func. | ||
| 6 | |||
| 7 | (zone): Init `modeline-hidden-level' symbol property. | ||
| 8 | Use `zone-call' instead of `funcall'. | ||
| 9 | |||
| 10 | (zone-pgm-whack-chars): Use `make-string' (fix bug introduced in 2001-10-26T20:11:25Z!monnier@iro.umontreal.ca). | ||
| 11 | |||
| 12 | (zone-pgm-stress): Use `zone-hiding-modeline'. | ||
| 13 | |||
| 14 | (zone-pgm-stress-destress): New zone program. | ||
| 15 | |||
| 1 | 2002-01-10 Eli Zaretskii <eliz@is.elta.co.il> | 16 | 2002-01-10 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 17 | ||
| 3 | * faces.el (minibuffer-prompt): Special face definition for MS-DOS. | 18 | * faces.el (minibuffer-prompt): Special face definition for MS-DOS. |
| 4 | 19 | ||
| 5 | 2002-01-09 Michael Kifer <kifer@cs.stonybrook.edu> | 20 | 2002-01-09 Michael Kifer <kifer@cs.stonybrook.edu> |
| 6 | 21 | ||
| 7 | * viper.el (viper-set-hooks): zap viper-unfriendly bindings in | 22 | * viper.el (viper-set-hooks): zap viper-unfriendly bindings in |
| 8 | flyspell-mouse-map. | 23 | flyspell-mouse-map. |
| 9 | 24 | ||
| 10 | 2002-01-08 Richard M. Stallman <rms@gnu.org> | 25 | 2002-01-08 Richard M. Stallman <rms@gnu.org> |
| 11 | 26 | ||
| 12 | * emacs-lisp/regexp-opt.el (regexp-opt): Bind max-specpdl-size. | 27 | * emacs-lisp/regexp-opt.el (regexp-opt): Bind max-specpdl-size. |
| @@ -42,9 +57,9 @@ | |||
| 42 | 2000-08-30. | 57 | 2000-08-30. |
| 43 | 58 | ||
| 44 | 2002-01-08 Michael Kifer <kifer@cs.stonybrook.edu> | 59 | 2002-01-08 Michael Kifer <kifer@cs.stonybrook.edu> |
| 45 | 60 | ||
| 46 | * ediff-hook.el: added an autoload cookie. | 61 | * ediff-hook.el: added an autoload cookie. |
| 47 | 62 | ||
| 48 | 2002-01-08 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 63 | 2002-01-08 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 49 | 64 | ||
| 50 | * net/eudcb-ph.el, net/ldap.el: New maintainer. New e-mail | 65 | * net/eudcb-ph.el, net/ldap.el: New maintainer. New e-mail |
| @@ -56,37 +71,37 @@ | |||
| 56 | (occur-mode-map): Bind `o' to that. | 71 | (occur-mode-map): Bind `o' to that. |
| 57 | 72 | ||
| 58 | 2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> | 73 | 2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu> |
| 59 | 74 | ||
| 60 | * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): | 75 | * viper-init.el (viper-cond-compile-for-xemacs-or-emacs): |
| 61 | new macro that replaces viper-emacs-p and viper-xemacs-p in many | 76 | new macro that replaces viper-emacs-p and viper-xemacs-p in many |
| 62 | cases. Used to reduce the number of warnings. | 77 | cases. Used to reduce the number of warnings. |
| 63 | 78 | ||
| 64 | * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. | 79 | * viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs. |
| 65 | (viper-standard-value): moved here from viper.el. | 80 | (viper-standard-value): moved here from viper.el. |
| 66 | (viper-set-unread-command-events): moved to viper-util.el | 81 | (viper-set-unread-command-events): moved to viper-util.el |
| 67 | (viper-check-minibuffer-overlay): make sure | 82 | (viper-check-minibuffer-overlay): make sure |
| 68 | viper-minibuffer-overlay is moved to cover the entire input field. | 83 | viper-minibuffer-overlay is moved to cover the entire input field. |
| 69 | 84 | ||
| 70 | * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. | 85 | * viper-util.el: use viper-cond-compile-for-xemacs-or-emacs. |
| 71 | (viper-read-key-sequence, viper-set-unread-command-events, | 86 | (viper-read-key-sequence, viper-set-unread-command-events, |
| 72 | viper-char-symbol-sequence-p, viper-char-array-p): moved here. | 87 | viper-char-symbol-sequence-p, viper-char-array-p): moved here. |
| 73 | 88 | ||
| 74 | * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. | 89 | * viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs. |
| 75 | 90 | ||
| 76 | * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. | 91 | * viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs. |
| 77 | 92 | ||
| 78 | * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. | 93 | * viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs. |
| 79 | 94 | ||
| 80 | * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, | 95 | * viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p, |
| 81 | viper-event-vector-p): moved to viper-util.el | 96 | viper-event-vector-p): moved to viper-util.el |
| 82 | 97 | ||
| 83 | * viper.el (viper-standard-value): moved to viper-cmd.el. | 98 | * viper.el (viper-standard-value): moved to viper-cmd.el. |
| 84 | Use viper-cond-compile-for-xemacs-or-emacs. | 99 | Use viper-cond-compile-for-xemacs-or-emacs. |
| 85 | 100 | ||
| 86 | * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. | 101 | * ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs. |
| 87 | 102 | ||
| 88 | * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. | 103 | * ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs. |
| 89 | 104 | ||
| 90 | * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new | 105 | * ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new |
| 91 | macro designed to be used in many places where ediff-emacs-p or | 106 | macro designed to be used in many places where ediff-emacs-p or |
| 92 | ediff-xemacs-p was previously used. Reduces the number of | 107 | ediff-xemacs-p was previously used. Reduces the number of |
| @@ -98,11 +113,11 @@ | |||
| 98 | ediff-whitespace-diff-region-p, ediff-get-region-contents): | 113 | ediff-whitespace-diff-region-p, ediff-get-region-contents): |
| 99 | moved to ediff-util.el. | 114 | moved to ediff-util.el. |
| 100 | (ediff-event-key): moved here. | 115 | (ediff-event-key): moved here. |
| 101 | 116 | ||
| 102 | * ediff-merge.el: got rid of unreferenced variables. | 117 | * ediff-merge.el: got rid of unreferenced variables. |
| 103 | 118 | ||
| 104 | * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. | 119 | * ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs. |
| 105 | 120 | ||
| 106 | * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. | 121 | * ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs. |
| 107 | (ediff-cleanup-mess): improved the way windows are set up after | 122 | (ediff-cleanup-mess): improved the way windows are set up after |
| 108 | quitting ediff. | 123 | quitting ediff. |
| @@ -126,11 +141,11 @@ | |||
| 126 | (ediff-arrange-autosave-in-merge-jobs): check if the merge file | 141 | (ediff-arrange-autosave-in-merge-jobs): check if the merge file |
| 127 | is visited by another buffer and ask to save/delete that buffer. | 142 | is visited by another buffer and ask to save/delete that buffer. |
| 128 | (ediff-verify-file-merge-buffer): new function to do the above. | 143 | (ediff-verify-file-merge-buffer): new function to do the above. |
| 129 | 144 | ||
| 130 | * ediff-vers.el: load ediff-init.el at compile time. | 145 | * ediff-vers.el: load ediff-init.el at compile time. |
| 131 | 146 | ||
| 132 | * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. | 147 | * ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs. |
| 133 | 148 | ||
| 134 | * ediff.el (ediff-windows, ediff-regions-wordwise, | 149 | * ediff.el (ediff-windows, ediff-regions-wordwise, |
| 135 | ediff-regions-linewise): use indirect buffers to improve | 150 | ediff-regions-linewise): use indirect buffers to improve |
| 136 | robustness and make it possible to compare regions of the same | 151 | robustness and make it possible to compare regions of the same |
| @@ -140,7 +155,7 @@ | |||
| 140 | (ediff-files-internal): refuse to compare identical files. | 155 | (ediff-files-internal): refuse to compare identical files. |
| 141 | (ediff-regions-internal): get rid of the warning about comparing | 156 | (ediff-regions-internal): get rid of the warning about comparing |
| 142 | regions of the same buffer. | 157 | regions of the same buffer. |
| 143 | 158 | ||
| 144 | * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. | 159 | * ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here. |
| 145 | Plus the following fixes courtesy of Dave Love: | 160 | Plus the following fixes courtesy of Dave Love: |
| 146 | Doc fixes. | 161 | Doc fixes. |
| @@ -150,7 +165,7 @@ | |||
| 150 | (ediff-copy-to-buffer): Use insert-buffer-substring rather than | 165 | (ediff-copy-to-buffer): Use insert-buffer-substring rather than |
| 151 | consing buffer contents. | 166 | consing buffer contents. |
| 152 | (ediff-goto-word): Move syntax table setting outside loop. | 167 | (ediff-goto-word): Move syntax table setting outside loop. |
| 153 | 168 | ||
| 154 | 2002-01-07 Richard M. Stallman <rms@gnu.org> | 169 | 2002-01-07 Richard M. Stallman <rms@gnu.org> |
| 155 | 170 | ||
| 156 | * dired.el (dired-copy-filename-as-kill): Call kill-append | 171 | * dired.el (dired-copy-filename-as-kill): Call kill-append |
| @@ -223,8 +238,8 @@ | |||
| 223 | 238 | ||
| 224 | * enriched.el (enriched-make-annotation): Doc fix. | 239 | * enriched.el (enriched-make-annotation): Doc fix. |
| 225 | 240 | ||
| 226 | * format.el (format-replace-strings, format-subtract-regions) | 241 | * format.el (format-replace-strings, format-subtract-regions) |
| 227 | (format-annotate-region, format-annotate-location) | 242 | (format-annotate-region, format-annotate-location) |
| 228 | (format-annotate-atomic-property-change) | 243 | (format-annotate-atomic-property-change) |
| 229 | (format-annotate-single-property-change): Doc fixes. | 244 | (format-annotate-single-property-change): Doc fixes. |
| 230 | 245 | ||
| @@ -292,7 +307,7 @@ | |||
| 292 | 2002-01-02 Chris Hanson <cph@aarau.ai.mit.edu> | 307 | 2002-01-02 Chris Hanson <cph@aarau.ai.mit.edu> |
| 293 | 308 | ||
| 294 | * xscheme.el: Eleven years of updates on a private copy. | 309 | * xscheme.el: Eleven years of updates on a private copy. |
| 295 | 310 | ||
| 296 | Extensive changes to support multiple xscheme buffers: | 311 | Extensive changes to support multiple xscheme buffers: |
| 297 | (run-scheme): Break up into new functions to facilitate starting | 312 | (run-scheme): Break up into new functions to facilitate starting |
| 298 | processes in other buffers. | 313 | processes in other buffers. |
| @@ -415,11 +430,11 @@ | |||
| 415 | * comint.el, cus-edit.el, diff-mode.el, enriched.el, font-lock.el: | 430 | * comint.el, cus-edit.el, diff-mode.el, enriched.el, font-lock.el: |
| 416 | * generic-x.el, info.el, log-view.el, pcvs-info.el, speedbar.el: | 431 | * generic-x.el, info.el, log-view.el, pcvs-info.el, speedbar.el: |
| 417 | * wid-edit.el, woman.el, calendar/calendar.el, textmodes/flyspell.el: | 432 | * wid-edit.el, woman.el, calendar/calendar.el, textmodes/flyspell.el: |
| 418 | * emulation/viper-init.el, eshell/em-ls.el, progmodes/antlr-mode.el: | 433 | * emulation/viper-init.el, eshell/em-ls.el, progmodes/antlr-mode.el: |
| 419 | * progmodes/cperl-mode.el, progmodes/idlwave.el: | 434 | * progmodes/cperl-mode.el, progmodes/idlwave.el: |
| 420 | * progmodes/sh-script.el, progmodes/vhdl-mode.el: | 435 | * progmodes/sh-script.el, progmodes/vhdl-mode.el: |
| 421 | Adapt face definitions to use :weight and :slant. | 436 | Adapt face definitions to use :weight and :slant. |
| 422 | 437 | ||
| 423 | * ps-print.el (ps-font-lock-face-attributes): Use :weight and :slant. | 438 | * ps-print.el (ps-font-lock-face-attributes): Use :weight and :slant. |
| 424 | 439 | ||
| 425 | * cus-edit.el (custom-face-edit-fix-value): Delete `assert' call. | 440 | * cus-edit.el (custom-face-edit-fix-value): Delete `assert' call. |
| @@ -454,7 +469,7 @@ | |||
| 454 | 469 | ||
| 455 | * replace.el (query-replace-read-args): Immediate error if read-only. | 470 | * replace.el (query-replace-read-args): Immediate error if read-only. |
| 456 | 471 | ||
| 457 | * textmodes/makeinfo.el (makeinfo-compilation-sentinel): | 472 | * textmodes/makeinfo.el (makeinfo-compilation-sentinel): |
| 458 | Display the output buffer in a more intelligent way. | 473 | Display the output buffer in a more intelligent way. |
| 459 | 474 | ||
| 460 | 2001-12-30 Eli Zaretskii <eliz@is.elta.co.il> | 475 | 2001-12-30 Eli Zaretskii <eliz@is.elta.co.il> |
| @@ -493,8 +508,8 @@ | |||
| 493 | * international/iso-transl.el (iso-transl-char-map) Eliminate the | 508 | * international/iso-transl.el (iso-transl-char-map) Eliminate the |
| 494 | alias symbols--put the translated sequences here directly. | 509 | alias symbols--put the translated sequences here directly. |
| 495 | 510 | ||
| 496 | * progmodes/cc-mode.el (c-mode-abbrev-table) | 511 | * progmodes/cc-mode.el (c-mode-abbrev-table) |
| 497 | (c++-mode-abbrev-table, objc-mode-abbrev-table) | 512 | (c++-mode-abbrev-table, objc-mode-abbrev-table) |
| 498 | (java-mode-abbrev-table, pike-mode-abbrev-table): | 513 | (java-mode-abbrev-table, pike-mode-abbrev-table): |
| 499 | Mark all the predefined abbrevs as "system" abbrevs. | 514 | Mark all the predefined abbrevs as "system" abbrevs. |
| 500 | 515 | ||
| @@ -616,29 +631,29 @@ | |||
| 616 | (occur-mode-map): Bind C-o to it. | 631 | (occur-mode-map): Bind C-o to it. |
| 617 | 632 | ||
| 618 | 2001-12-24 Michael Kifer <kifer@cs.sunysb.edu> | 633 | 2001-12-24 Michael Kifer <kifer@cs.sunysb.edu> |
| 619 | 634 | ||
| 620 | * viper-cmd.el (viper-change-state): Got rid of make-local-hook. | 635 | * viper-cmd.el (viper-change-state): Got rid of make-local-hook. |
| 621 | (viper-special-read-and-insert-char): Make C-m work right in the r | 636 | (viper-special-read-and-insert-char): Make C-m work right in the r |
| 622 | comand. | 637 | comand. |
| 623 | (viper-buffer-search-enable): Fixed format string. | 638 | (viper-buffer-search-enable): Fixed format string. |
| 624 | 639 | ||
| 625 | * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name | 640 | * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name |
| 626 | instead of viper-info-on-file. | 641 | instead of viper-info-on-file. |
| 627 | (ex-set-visited-file-name): New function. | 642 | (ex-set-visited-file-name): New function. |
| 628 | 643 | ||
| 629 | * viper.el (viper-emacs-state-mode-list): Added mail-mode. | 644 | * viper.el (viper-emacs-state-mode-list): Added mail-mode. |
| 630 | 645 | ||
| 631 | * ediff-mult.el (ediff-meta-mark-equal-files): Added optional | 646 | * ediff-mult.el (ediff-meta-mark-equal-files): Added optional |
| 632 | action argument. | 647 | action argument. |
| 633 | 648 | ||
| 634 | * ediff-init.el: Fixed some doc strings. | 649 | * ediff-init.el: Fixed some doc strings. |
| 635 | 650 | ||
| 636 | * ediff-util.el (ediff-after-quit-hook-internal): New variable. | 651 | * ediff-util.el (ediff-after-quit-hook-internal): New variable. |
| 637 | Got rid of make-local-hook. | 652 | Got rid of make-local-hook. |
| 638 | 653 | ||
| 639 | * ediff-wind.el (ediff-setup-control-frame): Got rid of | 654 | * ediff-wind.el (ediff-setup-control-frame): Got rid of |
| 640 | make-local-hook. | 655 | make-local-hook. |
| 641 | 656 | ||
| 642 | 2001-12-23 Richard M. Stallman <rms@gnu.org> | 657 | 2001-12-23 Richard M. Stallman <rms@gnu.org> |
| 643 | 658 | ||
| 644 | * term/x-win.el (x-handle-geometry): Put height and width | 659 | * term/x-win.el (x-handle-geometry): Put height and width |
| @@ -681,7 +696,7 @@ | |||
| 681 | 696 | ||
| 682 | * time.el (display-time-load-average-threshold): New variable. | 697 | * time.el (display-time-load-average-threshold): New variable. |
| 683 | (display-time-update): Use it. | 698 | (display-time-update): Use it. |
| 684 | 699 | ||
| 685 | These changes allow cycling through past 1, 5 and 15 minutes | 700 | These changes allow cycling through past 1, 5 and 15 minutes |
| 686 | load-average displayed in the mode-line. | 701 | load-average displayed in the mode-line. |
| 687 | 702 | ||
| @@ -725,7 +740,7 @@ | |||
| 725 | 740 | ||
| 726 | * net/ange-ftp.el (ange-ftp-file-modtime): Use save-match-data. | 741 | * net/ange-ftp.el (ange-ftp-file-modtime): Use save-match-data. |
| 727 | 742 | ||
| 728 | * emacs-lisp/easy-mmode.el (define-minor-mode): | 743 | * emacs-lisp/easy-mmode.el (define-minor-mode): |
| 729 | Make no arg by default in an interactive call, | 744 | Make no arg by default in an interactive call, |
| 730 | so that repeating the command toggles again. | 745 | so that repeating the command toggles again. |
| 731 | 746 | ||
| @@ -847,9 +862,9 @@ | |||
| 847 | 862 | ||
| 848 | 2001-12-19 Richard M. Stallman <rms@gnu.org> | 863 | 2001-12-19 Richard M. Stallman <rms@gnu.org> |
| 849 | 864 | ||
| 850 | * international/mule-cmds.el (describe-language-environment): | 865 | * international/mule-cmds.el (describe-language-environment): |
| 851 | Fix calls to help-xref-button. | 866 | Fix calls to help-xref-button. |
| 852 | 867 | ||
| 853 | 2001-12-19 Miles Bader <miles@gnu.org> | 868 | 2001-12-19 Miles Bader <miles@gnu.org> |
| 854 | 869 | ||
| 855 | * international/fontset.el: Require `ind-util' when compiling. | 870 | * international/fontset.el: Require `ind-util' when compiling. |
| @@ -967,7 +982,7 @@ | |||
| 967 | 982 | ||
| 968 | * startup.el (command-line-1): Display startup screen | 983 | * startup.el (command-line-1): Display startup screen |
| 969 | even if there are command line args. | 984 | even if there are command line args. |
| 970 | Add a note about how to go to editing your files. | 985 | Add a note about how to go to editing your files. |
| 971 | (fancy-splash-head): Add a note about how to go to your files. | 986 | (fancy-splash-head): Add a note about how to go to your files. |
| 972 | (fancy-splash-outer-buffer): New variable. | 987 | (fancy-splash-outer-buffer): New variable. |
| 973 | (fancy-splash-screens): Bind variable fancy-splash-outer-buffer. | 988 | (fancy-splash-screens): Bind variable fancy-splash-outer-buffer. |
diff --git a/lisp/play/zone.el b/lisp/play/zone.el index 4ef3c2cb517..8c0a581c088 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el | |||
| @@ -30,13 +30,13 @@ | |||
| 30 | ;; If it eventually irritates you, try M-x zone-leave-me-alone. | 30 | ;; If it eventually irritates you, try M-x zone-leave-me-alone. |
| 31 | 31 | ||
| 32 | ;; Bored by the zone pyrotechnics? Write your own! Add it to | 32 | ;; Bored by the zone pyrotechnics? Write your own! Add it to |
| 33 | ;; `zone-programs'. | 33 | ;; `zone-programs'. See `zone-call' for higher-ordered zoning. |
| 34 | 34 | ||
| 35 | ;; WARNING: Not appropriate for Emacs sessions over modems or | 35 | ;; WARNING: Not appropriate for Emacs sessions over modems or |
| 36 | ;; computers as slow as mine. | 36 | ;; computers as slow as mine. |
| 37 | 37 | ||
| 38 | ;; THANKS: Christopher Mayer, Scott Flinchbaugh, Rachel Kalmar, | 38 | ;; THANKS: Christopher Mayer, Scott Flinchbaugh, Rachel Kalmar, |
| 39 | ;; Max Froumentin. | 39 | ;; Max Froumentin. |
| 40 | 40 | ||
| 41 | ;;; Code: | 41 | ;;; Code: |
| 42 | 42 | ||
| @@ -47,6 +47,10 @@ | |||
| 47 | (defvar zone-idle 20 | 47 | (defvar zone-idle 20 |
| 48 | "*Seconds to idle before zoning out.") | 48 | "*Seconds to idle before zoning out.") |
| 49 | 49 | ||
| 50 | (defvar zone-timeout nil | ||
| 51 | "*Seconds to timeout the zoning. | ||
| 52 | If nil, don't interrupt for about 1^26 seconds.") | ||
| 53 | |||
| 50 | ;; Vector of functions that zone out. `zone' will execute one of | 54 | ;; Vector of functions that zone out. `zone' will execute one of |
| 51 | ;; these functions, randomly chosen. The chosen function is invoked | 55 | ;; these functions, randomly chosen. The chosen function is invoked |
| 52 | ;; in the *zone* buffer, which contains the text of the selected | 56 | ;; in the *zone* buffer, which contains the text of the selected |
| @@ -57,7 +61,7 @@ | |||
| 57 | zone-pgm-jitter | 61 | zone-pgm-jitter |
| 58 | zone-pgm-putz-with-case | 62 | zone-pgm-putz-with-case |
| 59 | zone-pgm-dissolve | 63 | zone-pgm-dissolve |
| 60 | ;; zone-pgm-explode | 64 | ;; zone-pgm-explode |
| 61 | zone-pgm-whack-chars | 65 | zone-pgm-whack-chars |
| 62 | zone-pgm-rotate | 66 | zone-pgm-rotate |
| 63 | zone-pgm-rotate-LR-lockstep | 67 | zone-pgm-rotate-LR-lockstep |
| @@ -70,12 +74,60 @@ | |||
| 70 | zone-pgm-martini-swan-dive | 74 | zone-pgm-martini-swan-dive |
| 71 | zone-pgm-paragraph-spaz | 75 | zone-pgm-paragraph-spaz |
| 72 | zone-pgm-stress | 76 | zone-pgm-stress |
| 77 | zone-pgm-stress-destress | ||
| 73 | ]) | 78 | ]) |
| 74 | 79 | ||
| 75 | (defmacro zone-orig (&rest body) | 80 | (defmacro zone-orig (&rest body) |
| 76 | `(with-current-buffer (get 'zone 'orig-buffer) | 81 | `(with-current-buffer (get 'zone 'orig-buffer) |
| 77 | ,@body)) | 82 | ,@body)) |
| 78 | 83 | ||
| 84 | (defmacro zone-hiding-modeline (&rest body) | ||
| 85 | `(let (bg mode-line-fg mode-line-bg mode-line-box) | ||
| 86 | (unwind-protect | ||
| 87 | (progn | ||
| 88 | (when (and (= 0 (get 'zone 'modeline-hidden-level)) | ||
| 89 | (display-color-p)) | ||
| 90 | (setq bg (face-background 'default) | ||
| 91 | mode-line-box (face-attribute 'mode-line :box) | ||
| 92 | mode-line-fg (face-attribute 'mode-line :foreground) | ||
| 93 | mode-line-bg (face-attribute 'mode-line :background)) | ||
| 94 | (set-face-attribute 'mode-line nil | ||
| 95 | :foreground bg | ||
| 96 | :background bg | ||
| 97 | :box nil)) | ||
| 98 | (put 'zone 'modeline-hidden-level | ||
| 99 | (1+ (get 'zone 'modeline-hidden-level))) | ||
| 100 | ,@body) | ||
| 101 | (put 'zone 'modeline-hidden-level | ||
| 102 | (1- (get 'zone 'modeline-hidden-level))) | ||
| 103 | (when (and (> 1 (get 'zone 'modeline-hidden-level)) | ||
| 104 | mode-line-fg) | ||
| 105 | (set-face-attribute 'mode-line nil | ||
| 106 | :foreground mode-line-fg | ||
| 107 | :background mode-line-bg | ||
| 108 | :box mode-line-box))))) | ||
| 109 | |||
| 110 | (defun zone-call (program &optional timeout) | ||
| 111 | "Call PROGRAM in a zoned way. | ||
| 112 | If PROGRAM is a function, call it, interrupting after the amount | ||
| 113 | of time in seconds specified by optional arg TIMEOUT, or `zone-timeout' | ||
| 114 | if unspecified, q.v. | ||
| 115 | PROGRAM can also be a list of elements, which are interpreted like so: | ||
| 116 | If the element is a function or a list of a function and a number, | ||
| 117 | apply `zone-call' recursively." | ||
| 118 | (cond ((functionp program) | ||
| 119 | (with-timeout ((or timeout zone-timeout (ash 1 26))) | ||
| 120 | (funcall program))) | ||
| 121 | ((listp program) | ||
| 122 | (mapcar (lambda (elem) | ||
| 123 | (cond ((functionp elem) (zone-call elem)) | ||
| 124 | ((and (listp elem) | ||
| 125 | (functionp (car elem)) | ||
| 126 | (numberp (cadr elem))) | ||
| 127 | (apply 'zone-call elem)) | ||
| 128 | (t (error "bad `zone-call' elem:" elem)))) | ||
| 129 | program)))) | ||
| 130 | |||
| 79 | ;;;###autoload | 131 | ;;;###autoload |
| 80 | (defun zone () | 132 | (defun zone () |
| 81 | "Zone out, completely." | 133 | "Zone out, completely." |
| @@ -89,6 +141,7 @@ | |||
| 89 | (wp (1+ (- (window-point (selected-window)) | 141 | (wp (1+ (- (window-point (selected-window)) |
| 90 | (window-start))))) | 142 | (window-start))))) |
| 91 | (put 'zone 'orig-buffer (current-buffer)) | 143 | (put 'zone 'orig-buffer (current-buffer)) |
| 144 | (put 'zone 'modeline-hidden-level 0) | ||
| 92 | (set-buffer outbuf) | 145 | (set-buffer outbuf) |
| 93 | (setq mode-name "Zone") | 146 | (setq mode-name "Zone") |
| 94 | (erase-buffer) | 147 | (erase-buffer) |
| @@ -112,7 +165,7 @@ | |||
| 112 | ;; input before zoning out. | 165 | ;; input before zoning out. |
| 113 | (if (input-pending-p) | 166 | (if (input-pending-p) |
| 114 | (discard-input)) | 167 | (discard-input)) |
| 115 | (funcall pgm) | 168 | (zone-call pgm) |
| 116 | (message "Zoning...sorry")) | 169 | (message "Zoning...sorry")) |
| 117 | (error | 170 | (error |
| 118 | (while (not (input-pending-p)) | 171 | (while (not (input-pending-p)) |
| @@ -149,10 +202,10 @@ | |||
| 149 | 202 | ||
| 150 | (defun zone-shift-up () | 203 | (defun zone-shift-up () |
| 151 | (let* ((b (point)) | 204 | (let* ((b (point)) |
| 152 | (e (progn | 205 | (e (progn |
| 153 | (end-of-line) | 206 | (end-of-line) |
| 154 | (if (looking-at "\n") (1+ (point)) (point)))) | 207 | (if (looking-at "\n") (1+ (point)) (point)))) |
| 155 | (s (buffer-substring b e))) | 208 | (s (buffer-substring b e))) |
| 156 | (delete-region b e) | 209 | (delete-region b e) |
| 157 | (goto-char (point-max)) | 210 | (goto-char (point-max)) |
| 158 | (insert s))) | 211 | (insert s))) |
| @@ -162,10 +215,10 @@ | |||
| 162 | (forward-line -1) | 215 | (forward-line -1) |
| 163 | (beginning-of-line) | 216 | (beginning-of-line) |
| 164 | (let* ((b (point)) | 217 | (let* ((b (point)) |
| 165 | (e (progn | 218 | (e (progn |
| 166 | (end-of-line) | 219 | (end-of-line) |
| 167 | (if (looking-at "\n") (1+ (point)) (point)))) | 220 | (if (looking-at "\n") (1+ (point)) (point)))) |
| 168 | (s (buffer-substring b e))) | 221 | (s (buffer-substring b e))) |
| 169 | (delete-region b e) | 222 | (delete-region b e) |
| 170 | (goto-char (point-min)) | 223 | (goto-char (point-min)) |
| 171 | (insert s))) | 224 | (insert s))) |
| @@ -173,20 +226,20 @@ | |||
| 173 | (defun zone-shift-left () | 226 | (defun zone-shift-left () |
| 174 | (while (not (eobp)) | 227 | (while (not (eobp)) |
| 175 | (or (eolp) | 228 | (or (eolp) |
| 176 | (let ((c (following-char))) | 229 | (let ((c (following-char))) |
| 177 | (delete-char 1) | 230 | (delete-char 1) |
| 178 | (end-of-line) | 231 | (end-of-line) |
| 179 | (insert c))) | 232 | (insert c))) |
| 180 | (forward-line 1))) | 233 | (forward-line 1))) |
| 181 | 234 | ||
| 182 | (defun zone-shift-right () | 235 | (defun zone-shift-right () |
| 183 | (while (not (eobp)) | 236 | (while (not (eobp)) |
| 184 | (end-of-line) | 237 | (end-of-line) |
| 185 | (or (bolp) | 238 | (or (bolp) |
| 186 | (let ((c (preceding-char))) | 239 | (let ((c (preceding-char))) |
| 187 | (delete-backward-char 1) | 240 | (delete-backward-char 1) |
| 188 | (beginning-of-line) | 241 | (beginning-of-line) |
| 189 | (insert c))) | 242 | (insert c))) |
| 190 | (forward-line 1))) | 243 | (forward-line 1))) |
| 191 | 244 | ||
| 192 | (defun zone-pgm-jitter () | 245 | (defun zone-pgm-jitter () |
| @@ -216,14 +269,14 @@ | |||
| 216 | (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl)))) | 269 | (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl)))) |
| 217 | (while (not (input-pending-p)) | 270 | (while (not (input-pending-p)) |
| 218 | (let ((i 48)) | 271 | (let ((i 48)) |
| 219 | (while (< i 122) | 272 | (while (< i 122) |
| 220 | (aset tbl i (+ 48 (random (- 123 48)))) | 273 | (aset tbl i (+ 48 (random (- 123 48)))) |
| 221 | (setq i (1+ i))) | 274 | (setq i (1+ i))) |
| 222 | (translate-region (point-min) (point-max) tbl) | 275 | (translate-region (point-min) (point-max) tbl) |
| 223 | (sit-for 0 2))))) | 276 | (sit-for 0 2))))) |
| 224 | 277 | ||
| 225 | (put 'zone-pgm-whack-chars 'wc-tbl | 278 | (put 'zone-pgm-whack-chars 'wc-tbl |
| 226 | (let ((tbl (make-vector 128 ?x)) | 279 | (let ((tbl (make-string 128 ?x)) |
| 227 | (i 0)) | 280 | (i 0)) |
| 228 | (while (< i 128) | 281 | (while (< i 128) |
| 229 | (aset tbl i i) | 282 | (aset tbl i i) |
| @@ -237,17 +290,17 @@ | |||
| 237 | (while working | 290 | (while working |
| 238 | (setq working nil) | 291 | (setq working nil) |
| 239 | (save-excursion | 292 | (save-excursion |
| 240 | (goto-char (point-min)) | 293 | (goto-char (point-min)) |
| 241 | (while (not (eobp)) | 294 | (while (not (eobp)) |
| 242 | (if (looking-at "[^(){}\n\t ]") | 295 | (if (looking-at "[^(){}\n\t ]") |
| 243 | (let ((n (random 5))) | 296 | (let ((n (random 5))) |
| 244 | (if (not (= n 0)) | 297 | (if (not (= n 0)) |
| 245 | (progn | 298 | (progn |
| 246 | (setq working t) | 299 | (setq working t) |
| 247 | (forward-char 1)) | 300 | (forward-char 1)) |
| 248 | (delete-char 1) | 301 | (delete-char 1) |
| 249 | (insert " "))) | 302 | (insert " "))) |
| 250 | (forward-char 1)))) | 303 | (forward-char 1)))) |
| 251 | (sit-for 0 2)))) | 304 | (sit-for 0 2)))) |
| 252 | 305 | ||
| 253 | (defun zone-pgm-dissolve () | 306 | (defun zone-pgm-dissolve () |
| @@ -261,14 +314,14 @@ | |||
| 261 | (let ((i 0)) | 314 | (let ((i 0)) |
| 262 | (while (< i 20) | 315 | (while (< i 20) |
| 263 | (save-excursion | 316 | (save-excursion |
| 264 | (goto-char (point-min)) | 317 | (goto-char (point-min)) |
| 265 | (while (not (eobp)) | 318 | (while (not (eobp)) |
| 266 | (if (looking-at "[^*\n\t ]") | 319 | (if (looking-at "[^*\n\t ]") |
| 267 | (let ((n (random 5))) | 320 | (let ((n (random 5))) |
| 268 | (if (not (= n 0)) | 321 | (if (not (= n 0)) |
| 269 | (forward-char 1)) | 322 | (forward-char 1)) |
| 270 | (insert " "))) | 323 | (insert " "))) |
| 271 | (forward-char 1))) | 324 | (forward-char 1))) |
| 272 | (setq i (1+ i)) | 325 | (setq i (1+ i)) |
| 273 | (sit-for 0 2))) | 326 | (sit-for 0 2))) |
| 274 | (zone-pgm-jitter)) | 327 | (zone-pgm-jitter)) |
| @@ -285,25 +338,25 @@ | |||
| 285 | ;; less interesting effect than you might imagine. | 338 | ;; less interesting effect than you might imagine. |
| 286 | (defun zone-pgm-2nd-putz-with-case () | 339 | (defun zone-pgm-2nd-putz-with-case () |
| 287 | (let ((tbl (make-string 128 ?x)) | 340 | (let ((tbl (make-string 128 ?x)) |
| 288 | (i 0)) | 341 | (i 0)) |
| 289 | (while (< i 128) | 342 | (while (< i 128) |
| 290 | (aset tbl i i) | 343 | (aset tbl i i) |
| 291 | (setq i (1+ i))) | 344 | (setq i (1+ i))) |
| 292 | (while (not (input-pending-p)) | 345 | (while (not (input-pending-p)) |
| 293 | (setq i ?a) | 346 | (setq i ?a) |
| 294 | (while (<= i ?z) | 347 | (while (<= i ?z) |
| 295 | (aset tbl i | 348 | (aset tbl i |
| 296 | (if (zerop (random 5)) | 349 | (if (zerop (random 5)) |
| 297 | (upcase i) | 350 | (upcase i) |
| 298 | (downcase i))) | 351 | (downcase i))) |
| 299 | (setq i (+ i (1+ (random 5))))) | 352 | (setq i (+ i (1+ (random 5))))) |
| 300 | (setq i ?A) | 353 | (setq i ?A) |
| 301 | (while (<= i ?z) | 354 | (while (<= i ?z) |
| 302 | (aset tbl i | 355 | (aset tbl i |
| 303 | (if (zerop (random 5)) | 356 | (if (zerop (random 5)) |
| 304 | (downcase i) | 357 | (downcase i) |
| 305 | (upcase i))) | 358 | (upcase i))) |
| 306 | (setq i (+ i (1+ (random 5))))) | 359 | (setq i (+ i (1+ (random 5))))) |
| 307 | (translate-region (point-min) (point-max) tbl) | 360 | (translate-region (point-min) (point-max) tbl) |
| 308 | (sit-for 0 2)))) | 361 | (sit-for 0 2)))) |
| 309 | 362 | ||
| @@ -311,18 +364,18 @@ | |||
| 311 | (goto-char (point-min)) | 364 | (goto-char (point-min)) |
| 312 | (while (not (input-pending-p)) | 365 | (while (not (input-pending-p)) |
| 313 | (let ((np (+ 2 (random 5))) | 366 | (let ((np (+ 2 (random 5))) |
| 314 | (pm (point-max))) | 367 | (pm (point-max))) |
| 315 | (while (< np pm) | 368 | (while (< np pm) |
| 316 | (goto-char np) | 369 | (goto-char np) |
| 317 | (let ((prec (preceding-char)) | 370 | (let ((prec (preceding-char)) |
| 318 | (props (text-properties-at (1- (point))))) | 371 | (props (text-properties-at (1- (point))))) |
| 319 | (insert (if (zerop (random 2)) | 372 | (insert (if (zerop (random 2)) |
| 320 | (upcase prec) | 373 | (upcase prec) |
| 321 | (downcase prec))) | 374 | (downcase prec))) |
| 322 | (set-text-properties (1- (point)) (point) props)) | 375 | (set-text-properties (1- (point)) (point) props)) |
| 323 | (backward-char 2) | 376 | (backward-char 2) |
| 324 | (delete-char 1) | 377 | (delete-char 1) |
| 325 | (setq np (+ np (1+ (random 5)))))) | 378 | (setq np (+ np (1+ (random 5)))))) |
| 326 | (goto-char (point-min)) | 379 | (goto-char (point-min)) |
| 327 | (sit-for 0 2))) | 380 | (sit-for 0 2))) |
| 328 | 381 | ||
| @@ -334,9 +387,9 @@ | |||
| 334 | (save-excursion | 387 | (save-excursion |
| 335 | (goto-char (window-start)) | 388 | (goto-char (window-start)) |
| 336 | (while (< (point) (window-end)) | 389 | (while (< (point) (window-end)) |
| 337 | (when (looking-at "[\t ]*\\([^\n]+\\)") | 390 | (when (looking-at "[\t ]*\\([^\n]+\\)") |
| 338 | (setq ret (cons (cons (match-beginning 1) (match-end 1)) ret))) | 391 | (setq ret (cons (cons (match-beginning 1) (match-end 1)) ret))) |
| 339 | (forward-line 1))) | 392 | (forward-line 1))) |
| 340 | ret)) | 393 | ret)) |
| 341 | 394 | ||
| 342 | (defun zone-pgm-rotate (&optional random-style) | 395 | (defun zone-pgm-rotate (&optional random-style) |
| @@ -413,7 +466,7 @@ | |||
| 413 | (defun zone-fall-through-ws (c col wend) | 466 | (defun zone-fall-through-ws (c col wend) |
| 414 | (let ((fall-p nil) ; todo: move outward | 467 | (let ((fall-p nil) ; todo: move outward |
| 415 | (wait 0.15) | 468 | (wait 0.15) |
| 416 | (o (point)) ; for terminals w/o cursor hiding | 469 | (o (point)) ; for terminals w/o cursor hiding |
| 417 | (p (point))) | 470 | (p (point))) |
| 418 | (while (progn | 471 | (while (progn |
| 419 | (forward-line 1) | 472 | (forward-line 1) |
| @@ -447,15 +500,14 @@ | |||
| 447 | (delete-char (- ww cc)))) | 500 | (delete-char (- ww cc)))) |
| 448 | (unless (eobp) | 501 | (unless (eobp) |
| 449 | (forward-char 1))) | 502 | (forward-char 1))) |
| 450 | ;; what the hell is going on here? | 503 | ;; pad ws past bottom of screen |
| 451 | (let ((nl (- wh (count-lines (point-min) (point))))) | 504 | (let ((nl (- wh (count-lines (point-min) (point))))) |
| 452 | (when (> nl 0) | 505 | (when (> nl 0) |
| 453 | (let ((line (concat (make-string (1- ww) ? ) "\n"))) | 506 | (let ((line (concat (make-string (1- ww) ? ) "\n"))) |
| 454 | (do ((i 0 (1+ i))) | 507 | (do ((i 0 (1+ i))) |
| 455 | ((= i nl)) | 508 | ((= i nl)) |
| 456 | (insert line))))) | 509 | (insert line))))) |
| 457 | ;; | 510 | (catch 'done |
| 458 | (catch 'done ;; ugh | ||
| 459 | (while (not (input-pending-p)) | 511 | (while (not (input-pending-p)) |
| 460 | (goto-char (point-min)) | 512 | (goto-char (point-min)) |
| 461 | (sit-for 0) | 513 | (sit-for 0) |
| @@ -526,48 +578,50 @@ | |||
| 526 | 578 | ||
| 527 | (defun zone-pgm-stress () | 579 | (defun zone-pgm-stress () |
| 528 | (goto-char (point-min)) | 580 | (goto-char (point-min)) |
| 529 | (let (lines bg mode-line-fg mode-line-bg mode-line-box) | 581 | (let (lines) |
| 530 | (while (< (point) (point-max)) | 582 | (while (< (point) (point-max)) |
| 531 | (let ((p (point))) | 583 | (let ((p (point))) |
| 532 | (forward-line 1) | 584 | (forward-line 1) |
| 533 | (setq lines (cons (buffer-substring p (point)) lines)))) | 585 | (setq lines (cons (buffer-substring p (point)) lines)))) |
| 534 | (sit-for 5) | 586 | (sit-for 5) |
| 535 | (unwind-protect | 587 | (zone-hiding-modeline |
| 536 | (progn | 588 | (let ((msg "Zoning... (zone-pgm-stress)")) |
| 537 | (when (display-color-p) | 589 | (while (not (string= msg "")) |
| 538 | (setq bg (face-background 'default) | 590 | (message (setq msg (substring msg 1))) |
| 539 | mode-line-box (face-attribute 'mode-line :box) | 591 | (sit-for 0.05))) |
| 540 | mode-line-fg (face-attribute 'mode-line :foreground) | 592 | (while (not (input-pending-p)) |
| 541 | mode-line-bg (face-attribute 'mode-line :background)) | 593 | (when (< 50 (random 100)) |
| 542 | (set-face-attribute 'mode-line nil | 594 | (goto-char (point-max)) |
| 543 | :foreground bg | 595 | (forward-line -1) |
| 544 | :background bg | 596 | (let ((kill-whole-line t)) |
| 545 | :box nil)) | 597 | (kill-line)) |
| 546 | 598 | (goto-char (point-min)) | |
| 547 | (let ((msg "Zoning... (zone-pgm-stress)")) | 599 | (insert (nth (random (length lines)) lines))) |
| 548 | (while (not (string= msg "")) | 600 | (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr")) |
| 549 | (message (setq msg (substring msg 1))) | 601 | (sit-for 0.1))))) |
| 550 | (sit-for 0.05))) | 602 | |
| 551 | 603 | ||
| 552 | (while (not (input-pending-p)) | 604 | ;;;; zone-pgm-stress-destress |
| 553 | (when (< 50 (random 100)) | 605 | |
| 554 | (goto-char (point-max)) | 606 | (defun zone-pgm-stress-destress () |
| 555 | (forward-line -1) | 607 | (zone-call 'zone-pgm-stress 25) |
| 556 | (unless (eobp) | 608 | (zone-hiding-modeline |
| 557 | (let ((kill-whole-line t)) | 609 | (sit-for 3) |
| 558 | (kill-line))) | 610 | (erase-buffer) |
| 559 | (goto-char (point-min)) | 611 | (sit-for 3) |
| 560 | (when lines | 612 | (insert-buffer "*Messages*") |
| 561 | (insert (nth (random (1- (length lines))) lines)))) | 613 | (message "") |
| 562 | (message (concat (make-string (random (- (frame-width) 5)) ? ) | 614 | (goto-char (point-max)) |
| 563 | "grrr")) | 615 | (recenter -1) |
| 564 | (sit-for 0.1))) | 616 | (sit-for 3) |
| 565 | (when mode-line-fg | 617 | (delete-region (point-min) (window-start)) |
| 566 | (set-face-attribute 'mode-line nil | 618 | (message "hey why stress out anyway?") |
| 567 | :foreground mode-line-fg | 619 | (zone-call '((zone-pgm-rotate 30) |
| 568 | :background mode-line-bg | 620 | (zone-pgm-whack-chars 10) |
| 569 | :box mode-line-box))))) | 621 | zone-pgm-drip)))) |
| 570 | 622 | ||
| 623 | |||
| 624 | ;;;;;;;;;;;;;;; | ||
| 571 | (provide 'zone) | 625 | (provide 'zone) |
| 572 | 626 | ||
| 573 | ;;; zone.el ends here | 627 | ;;; zone.el ends here |