emacs-devel
[Top][All Lists]
Advanced

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

Re: toggle-viper-mode strangeness


From: Giorgos Keramidas
Subject: Re: toggle-viper-mode strangeness
Date: Fri, 20 Jan 2006 04:35:21 +0200

On 2006-01-19 20:14, "Richard M. Stallman" <address@hidden> wrote:
> Here's what that code does:
>
>             (if (eq viper-mode t)
>                 ;; Turn the mode off.
>                 (viper-go-away)
>               ;; Turn the mode on.
>               (setq viper-mode nil)
>               (viper-mode)))
>
> It looks correct to me, except perhaps for the eq call,
> which treats non-nil non-t values as "off" rather than "on".
> That is peculiar, but I don't know whether it is wrong.

I was under the impression that an (if cond then else) expression can
only have 4 parts within the parentheses.  This means that the above
would require a (progn) around the final two parts, i.e.:

        (if (eq viper-mode t)
            ;; Turn the mode off.
            (viper-go-away)
          ;; Turn the mode on.
          (progn
            (setq viper-mode nil)
            (viper-mode)))

It looks like I was wrong, and the else part can contain more than one
s-exp, returning the value of the last one.  Thanks :)





reply via email to

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