Tim Harper <[email protected]> writes: > On Fri, Aug 20, 2010 at 8:46 AM, Stephen Bach <[email protected]> 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))
Indeed, thank you both for catching that. As the docstring of `message' mentions, one should always use (message "%s" SOMETHING) unless SOMETHING is a plain string (i.e. one without formatting instructions). Should be fixed by commit db9368fc. Štěpán _______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
