Mercurial > emacs
comparison lisp/play/animate.el @ 38783:255503bac5c2
(animate-string): Doc fix. Use a buffer
name with stars in it.
(animate-sequence): New function.
From Richard Stallman <rms@gnu.org>.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 10 Aug 2001 18:10:16 +0000 |
parents | 456acc0ad1ee |
children | 0d8b17d428b5 |
comparison
equal
deleted
inserted
replaced
38782:162cad3d76ea | 38783:255503bac5c2 |
---|---|
131 ;; This is so that the undo command, used afterwards, | 131 ;; This is so that the undo command, used afterwards, |
132 ;; will undo the "animate" calls one by one. | 132 ;; will undo the "animate" calls one by one. |
133 (undo-boundary))) | 133 (undo-boundary))) |
134 | 134 |
135 ;;;###autoload | 135 ;;;###autoload |
136 (defun animate-sequence (list-of-strings space) | |
137 "Display strings from LIST-OF-STRING with animation in a new buffer. | |
138 Strings will be separated from each other by SPACE lines." | |
139 (let ((vpos (/ (- (window-height) | |
140 1 ;; For the mode-line | |
141 (* (1- (length list-of-strings)) space) | |
142 (length list-of-strings)) | |
143 2))) | |
144 (switch-to-buffer (get-buffer-create "*Animation*")) | |
145 (erase-buffer) | |
146 (sit-for 0) | |
147 (setq indent-tabs-mode nil) | |
148 (while list-of-strings | |
149 (animate-string (car list-of-strings) vpos) | |
150 (setq vpos (+ vpos space 1)) | |
151 (setq list-of-strings (cdr list-of-strings))))) | |
152 | |
153 ;;;###autoload | |
136 (defun animate-birthday-present () | 154 (defun animate-birthday-present () |
137 "Display Sarah's birthday present." | 155 "Display Sarah's birthday present in a new buffer." |
138 (interactive) | 156 (interactive) |
139 ;; Make a suitable buffer to display the birthday present in. | 157 ;; Make a suitable buffer to display the birthday present in. |
140 (switch-to-buffer (get-buffer-create "Sarah")) | 158 (switch-to-buffer (get-buffer-create "*Sarah*")) |
141 (erase-buffer) | 159 (erase-buffer) |
142 ;; Display the empty buffer. | 160 ;; Display the empty buffer. |
143 (sit-for 0) | 161 (sit-for 0) |
144 ;; Make sure indentation does not use tabs. | 162 ;; Make sure indentation does not use tabs. |
145 ;; They would confuse things. | 163 ;; They would confuse things. |