help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redefining functions and variables


From: Elena
Subject: Re: Redefining functions and variables
Date: Wed, 08 Dec 2010 15:21:46 -0000
User-agent: G2/1.0

On Jul 29, 10:03 am, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> the "..." are only used to display the list when print-length or
> eval-expression-print-length are not nil.  See also print-level and
> eval-expression-print-level.

Didn't know about this. Thanks.

> %s can format symbols too:
>
> (format ">> %s <<" 'example)
> ;; --> ">> example <<"
>
> And you had your the old defun inside the when!

Gosh! What an oversight... Sorry.

> Note: while name is known at macroexpansion time, you should refrain
> to insert it in the string like this:
>
>       (message ,(format "Warning: %s is being redefined in %%s." name) 
> load-file-name)
>
> since name could contain percents and then you'd have build a wrong
> format string for message.

I don't understand this. Doc about `message' says:

> Note: Use (message "%s" VALUE) to print the value of expressions and
> variables to avoid accidentally interpreting `%' as format specifiers.

And in fact:

(message "%s" 'example%)

correctly outputs:

"example%"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]