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

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

Re: goof in small function where???


From: Michael Heerdegen
Subject: Re: goof in small function where???
Date: Tue, 22 Jul 2014 13:07:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

ken <address@hidden> writes:

> I'm vaguely understanding that the 'and' doesn't evaluate
> '(message...' when '(kill-new...' returns nil and, since its return
> value is undefined, it can do on occasion.  Replacing 'and' with
> 'when' ensures '(message...' is evaluated regardless of what
> '(kill-new...' returns.
>
> Is that about right?

Exactly.  `and' is not the right way to tell Emacs "do this _and_
that" ;-) 

The following would also be ok, btw:

         (and str
              (progn (kill-new str)
                     (message "Copied filename %s to kill ring" str)))

Regards,

Michael.




reply via email to

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