GNU bug report logs - #5417
Patch for animate.el bugs `animate-n-steps', `animate-sequence', `animate-birthday-present'

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Mon, 18 Jan 2010 23:23:01 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5417 in the body.
You can then email your comments to 5417 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5417; Package emacs. (Mon, 18 Jan 2010 23:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to MON KEY <monkey <at> sandpframing.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 18 Jan 2010 23:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: MON KEY <monkey <at> sandpframing.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Patch for animate.el bugs `animate-n-steps', `animate-sequence', 
	`animate-birthday-present'
Date: Mon, 18 Jan 2010 18:22:20 -0500
[Message part 1 (text/plain, inline)]
This is a bug report regarding play/animate.el for:

variable `animate-n-steps'
function `animate-sequence'
function `animate-birthday-present'

As there are not any customization options for this package the docstring of
variable `animate-n-steps':

 "Number of steps to use `animate-string'."

should get the asterisk leadin docstring asterisk as presumably

 (user-variable-p 'animate-n-steps)

should evaluate to t. It currently does not.

The function `animate-sequence' switches to the buffer "*Animation*" by default.
The user should have some way to bind an alternate destination.

The function `animate-birthday-present' uses a default buffer "Sarah".
This is not a good default.
Also, it should capitalize the name in the returned animated strring.

The patch below attempt to address some of these concerns without resorting to
defcustom forms which understandably might be overkill given this packages
directory location e.g. /lisp/play/animate.el

Note, it adds a variable `*animation*'.


;;; ==============================

--- /quickfixes/lisp/play/animate.el.~99304~	2010-01-18 17:44:04.000000000 -0500
+++ /quickfixes/lisp/play/animate.el	2010-01-18 17:13:27.000000000 -0500
@@ -90,11 +90,15 @@
   (insert-char char 1))

 (defvar animate-n-steps 10
-  "Number of steps to use `animate-string'.")
+"*Number of steps `animate-string' will place a char before its last
position.")
+
+(defvar *animation* nil
+  "*String naming the default buffer for animations.
+When null animations dipslayed in the buffer named *Animation*.")

 ;;;###autoload
 (defun animate-string (string vpos &optional hpos)
-  "Display STRING starting at position VPOS, HPOS, using animation.
+  "Display STRING animations starting at position VPOS, HPOS.
 The characters start at randomly chosen places,
 and all slide in parallel to their final positions,
 passing through `animate-n-steps' positions before the final ones.
@@ -139,14 +143,20 @@

 ;;;###autoload
 (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."
+  "Display animation strings from LIST-OF-STRING with buffer *Animation*.
+Strings will be separated from each other by SPACE lines.
+When the variable `*animation*' is non-nil display animation in the
+buffer named by variable's value creating the buffer if one does not exist."
   (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*"))
+    (switch-to-buffer (get-buffer-create
+                       (if (and (bound-and-true-p *animation*)
+                                (stringp *animation*))
+                                *animation*
+                           (capitalize (symbol-name '*animation*)))))
     (erase-buffer)
     (sit-for 0)
     (while list-of-strings
@@ -156,19 +166,24 @@

 ;;;###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")))
+  "Return a birthday present in the buffer *Birthday-Present*.
+When optional arg NAME is non-nil or called-interactively, prompt for
+NAME of birthday present receiver and return a birthday present in
+the buffer *Birthday-Present-for-Name*."
+  (interactive (list (read-string "Birthday present for: "
+				  nil nil)))
   ;; Make a suitable buffer to display the birthday present in.
-  (switch-to-buffer (get-buffer-create (format "*%s*" name)))
+  (switch-to-buffer (get-buffer-create (if name
+                                           (concat "*A-Present-for-"
(capitalize name) "*")
+                                           "*Birthday-Present*")))
   (erase-buffer)
   ;; Display the empty buffer.
   (sit-for 0)

-  (animate-string "Happy Birthday," 6)
-  (animate-string (format "%s" name) 7)
-
+  (if name
+      (animate-string "Happy Birthday," 6)
+      (animate-string "Happy Birthday" 6))
+  (when name (animate-string (format "%s" (capitalize name)) 7))
   (sit-for 1)

   (animate-string "You are my sunshine," 10 30)

;;; ==============================
[animate.el.diff (application/octet-stream, attachment)]

Added tag(s) patch. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 18 Jan 2010 23:44:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 18 Jan 2010 23:44:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5417; Package emacs. (Sun, 03 Jul 2011 19:38:02 GMT) Full text and rfc822 format available.

Message #12 received at 5417 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: MON KEY <monkey <at> sandpframing.com>
Cc: 5417 <at> debbugs.gnu.org
Subject: Re: Patch for animate.el bugs `animate-n-steps', `animate-sequence',
	`animate-birthday-present'
Date: Sun, 03 Jul 2011 21:36:54 +0200
MON KEY <monkey <at> sandpframing.com> writes:

> This is a bug report regarding play/animate.el for:
>
> variable `animate-n-steps'
> function `animate-sequence'
> function `animate-birthday-present'

The patch looks OK to me.

It's over 10 lines, though, so the FSF needs copyright assignment papers
on file before I can apply the patch.

Do you have such papers on file with the FSF?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5417; Package emacs. (Mon, 04 Jul 2011 02:42:02 GMT) Full text and rfc822 format available.

Message #15 received at 5417 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 5417 <at> debbugs.gnu.org, MON KEY <monkey <at> sandpframing.com>
Subject: Re: bug#5417: Patch for animate.el bugs `animate-n-steps',
	`animate-sequence', `animate-birthday-present'
Date: Sun, 03 Jul 2011 22:41:40 -0400
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> It's over 10 lines, though, so the FSF needs copyright assignment papers
> on file before I can apply the patch.
>
> Do you have such papers on file with the FSF?

Yes, he has an assignment.





Added tag(s) fixed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 04 Jul 2011 11:46:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.1, send any further explanations to 5417 <at> debbugs.gnu.org and MON KEY <monkey <at> sandpframing.com> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 04 Jul 2011 11:46:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5417; Package emacs. (Mon, 04 Jul 2011 11:47:02 GMT) Full text and rfc822 format available.

Message #22 received at 5417 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: MON KEY <monkey <at> sandpframing.com>
Cc: 5417 <at> debbugs.gnu.org
Subject: Re: Patch for animate.el bugs `animate-n-steps', `animate-sequence',
	`animate-birthday-present'
Date: Mon, 04 Jul 2011 13:45:58 +0200
MON KEY <monkey <at> sandpframing.com> writes:

> The patch below attempt to address some of these concerns without resorting to
> defcustom forms which understandably might be overkill given this packages
> directory location e.g. /lisp/play/animate.el

I've now applied your patch, and fixed up the naming to match Emacs'
conventions.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 02 Aug 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.