(undo-boundary)))
;;;###autoload
-(defun animate-birthday-present ()
- "Display Sarah's birthday present."
- (interactive)
+(defun animate-sequence (list-of-strings space)
+ "Display strings from LIST-OF-STRING with animation in a new buffer.
+Strings will be separated from each other by SPACE lines."
+ (let ((vpos (/ (- (window-height)
+ 1 ;; For the mode-line
+ (* (1- (length list-of-strings)) space)
+ (length list-of-strings))
+ 2)))
+ (switch-to-buffer (get-buffer-create "*Animation*"))
+ (erase-buffer)
+ (sit-for 0)
+ (setq indent-tabs-mode nil)
+ (while list-of-strings
+ (animate-string (car list-of-strings) vpos)
+ (setq vpos (+ vpos space 1))
+ (setq list-of-strings (cdr list-of-strings)))))
+
+;;;###autoload
+(defun animate-birthday-present (&optional name)
+ "Display one's birthday present in a new buffer.
+You can specify the one's name by NAME; the default value is \"Sarah\"."
+ (interactive (list (read-string "Name (default \"Sarah\"): "
+ nil nil "Sarah")))
;; Make a suitable buffer to display the birthday present in.
- (switch-to-buffer (get-buffer-create "Sarah"))
+ (switch-to-buffer (get-buffer-create (format "*%s*" name)))
(erase-buffer)
;; Display the empty buffer.
(sit-for 0)
(setq indent-tabs-mode nil)
(animate-string "Happy Birthday," 6)
- (animate-string "Sarah" 7)
+ (animate-string (format "%s" name) 7)
(sit-for 1)
(animate-string "my sunshine" 18 34)
(animate-string "to stay!" 19 34))
+;;; arch-tag: 275289a3-6ac4-41da-b527-a1147045392f
;;; animate.el ends here