Mercurial > emacs
comparison lisp/play/zone.el @ 30592:fbdf4c1e1acf
(zone, zone-pgm-stress): Don't use window-system.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 04 Aug 2000 12:16:39 +0000 |
parents | 338238ca63ce |
children | abcc7a8d4fe4 |
comparison
equal
deleted
inserted
replaced
30591:6667ca2d422d | 30592:fbdf4c1e1acf |
---|---|
82 (defun zone () | 82 (defun zone () |
83 "Zone out, completely." | 83 "Zone out, completely." |
84 (interactive) | 84 (interactive) |
85 (and (timerp zone-timer) (cancel-timer zone-timer)) | 85 (and (timerp zone-timer) (cancel-timer zone-timer)) |
86 (setq zone-timer nil) | 86 (setq zone-timer nil) |
87 (let ((f (and window-system (selected-frame))) | 87 (let ((f (selected-frame)) |
88 (outbuf (get-buffer-create "*zone*")) | 88 (outbuf (get-buffer-create "*zone*")) |
89 (text (buffer-substring (window-start) (window-end))) | 89 (text (buffer-substring (window-start) (window-end))) |
90 (wp (1+ (- (window-point (selected-window)) | 90 (wp (1+ (- (window-point (selected-window)) |
91 (window-start))))) | 91 (window-start))))) |
92 (put 'zone 'orig-buffer (current-buffer)) | 92 (put 'zone 'orig-buffer (current-buffer)) |
528 (while (< (point) (point-max)) | 528 (while (< (point) (point-max)) |
529 (let ((p (point))) | 529 (let ((p (point))) |
530 (forward-line 1) | 530 (forward-line 1) |
531 (setq lines (cons (buffer-substring p (point)) lines)))) | 531 (setq lines (cons (buffer-substring p (point)) lines)))) |
532 (sit-for 5) | 532 (sit-for 5) |
533 (when window-system | 533 (when (display-color-p) |
534 (setq bg (frame-parameter (selected-frame) 'background-color) | 534 (setq bg (frame-parameter (selected-frame) 'background-color) |
535 m-fg (face-foreground 'modeline) | 535 m-fg (face-foreground 'modeline) |
536 m-bg (face-background 'modeline)) | 536 m-bg (face-background 'modeline)) |
537 (set-face-foreground 'modeline bg) | 537 (set-face-foreground 'modeline bg) |
538 (set-face-background 'modeline bg)) | 538 (set-face-background 'modeline bg)) |
548 (kill-line)) | 548 (kill-line)) |
549 (goto-char (point-min)) | 549 (goto-char (point-min)) |
550 (insert (nth (random (length lines)) lines))) | 550 (insert (nth (random (length lines)) lines))) |
551 (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr")) | 551 (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr")) |
552 (sit-for 0.1)) | 552 (sit-for 0.1)) |
553 (when window-system | 553 (when (display-color-p) |
554 (set-face-foreground 'modeline m-fg) | 554 (set-face-foreground 'modeline m-fg) |
555 (set-face-background 'modeline m-bg)))) | 555 (set-face-background 'modeline m-bg)))) |
556 | 556 |
557 (provide 'zone) | 557 (provide 'zone) |
558 | 558 |