Mercurial > emacs
comparison lisp/play/animate.el @ 105489:8db047b72241
* play/animate.el (animate-string): For good effect, make sure
`indent-tabs-mode' and `show-trailing-whitespace' are nil.
* play/animate.el (animate-sequence, animate-birthday-present):
* misc.el (butterfly): Don't set `indent-tabs-mode'.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 06 Oct 2009 11:15:01 +0000 |
parents | a9dc0e7c3f2b |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
105488:efd1475ab299 | 105489:8db047b72241 |
---|---|
103 (let ((characters | 103 (let ((characters |
104 (animate-initialize string vpos | 104 (animate-initialize string vpos |
105 (or hpos | 105 (or hpos |
106 ;; HPOS unspecified, so compute | 106 ;; HPOS unspecified, so compute |
107 ;; it so as to center the string. | 107 ;; it so as to center the string. |
108 (max 0 (/ (- (window-width) (length string)) 2)))))) | 108 (max 0 (/ (- (window-width) (length string)) 2))))) |
109 (show-trailing-whitespace nil) | |
110 ;; Make sure indentation does not use tabs. | |
111 ;; They would confuse things. | |
112 (indent-tabs-mode nil)) | |
109 (dotimes (i animate-n-steps) | 113 (dotimes (i animate-n-steps) |
110 ;; Bind buffer-undo-list so it will be unchanged when we are done. | 114 ;; Bind buffer-undo-list so it will be unchanged when we are done. |
111 ;; (We're going to undo all our changes anyway.) | 115 ;; (We're going to undo all our changes anyway.) |
112 (let (buffer-undo-list | 116 (let (buffer-undo-list |
113 list-to-undo) | 117 list-to-undo) |
143 (length list-of-strings)) | 147 (length list-of-strings)) |
144 2))) | 148 2))) |
145 (switch-to-buffer (get-buffer-create "*Animation*")) | 149 (switch-to-buffer (get-buffer-create "*Animation*")) |
146 (erase-buffer) | 150 (erase-buffer) |
147 (sit-for 0) | 151 (sit-for 0) |
148 (setq indent-tabs-mode nil) | |
149 (while list-of-strings | 152 (while list-of-strings |
150 (animate-string (car list-of-strings) vpos) | 153 (animate-string (car list-of-strings) vpos) |
151 (setq vpos (+ vpos space 1)) | 154 (setq vpos (+ vpos space 1)) |
152 (setq list-of-strings (cdr list-of-strings))))) | 155 (setq list-of-strings (cdr list-of-strings))))) |
153 | 156 |
160 ;; Make a suitable buffer to display the birthday present in. | 163 ;; Make a suitable buffer to display the birthday present in. |
161 (switch-to-buffer (get-buffer-create (format "*%s*" name))) | 164 (switch-to-buffer (get-buffer-create (format "*%s*" name))) |
162 (erase-buffer) | 165 (erase-buffer) |
163 ;; Display the empty buffer. | 166 ;; Display the empty buffer. |
164 (sit-for 0) | 167 (sit-for 0) |
165 ;; Make sure indentation does not use tabs. | |
166 ;; They would confuse things. | |
167 (setq indent-tabs-mode nil) | |
168 | 168 |
169 (animate-string "Happy Birthday," 6) | 169 (animate-string "Happy Birthday," 6) |
170 (animate-string (format "%s" name) 7) | 170 (animate-string (format "%s" name) 7) |
171 | 171 |
172 (sit-for 1) | 172 (sit-for 1) |