[Vimpulse] "Not enough arguments to format string"

Tim Harper timcharper at gmail.com
Fri Aug 20 18:14:02 CEST 2010


On Fri, Aug 20, 2010 at 8:46 AM, Stephen Bach <sjbach at sjbach.com> wrote:
> Hi,
>
> There's some code in vimpulse-range and a couple other functions to save
> and restore the message stored in the echo area.  It's got a small bug
> because of this behaviour of (current-message):
>
> (message "%%s message)
> --> displays "%s message string"
>
> (progn
>  (message "%%s message string")
>  (current-message))
> --> returns "%s message string"
>
> (progn
>  (message "%%s message string")
>  (message (current-message)))
> --> (error "Not enough arguments for format string")
>
> Seems like the string returned by current-message should be escaped
> for % before redisplay.
>

Stephen, I believe you're absolutely right.  That's a common mistake
made in e-lisp to assume it takes a string to display.  The easiest
work around would be to simply change it to this:

(message "%s" (current-message))

Would you like to submit a patch?  Or can you just point out where it's broken?

Tim



More information about the implementations-list mailing list