emacs-devel
[Top][All Lists]
Advanced

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

Re: toggle-viper-mode strangeness


From: Kevin Rodgers
Subject: Re: toggle-viper-mode strangeness
Date: Thu, 19 Jan 2006 14:43:58 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Giorgos Keramidas wrote:
It's been several days since I updated cvs-emacs here, so forgive me if
this is fixed already.

Isn't the following in `toggle-viper-mode' strange?

        ;;;###autoload
        (defun toggle-viper-mode ()
          "Toggle Viper on/off.
        If Viper is enabled, turn it off.  Otherwise, turn it on."
          (interactive)
          (if (eq viper-mode t)
              (viper-go-away)
==>         (setq viper-mode nil)
            (viper-mode)))

Looking at the indentation I'd expect the if expression to end where the
arrow points, but it doesn't.  Or is an implicit (progn ...) added
automatically by Emacs around the third ... N-th elements of the if
expression?

Yes:

,----[ C-h f if RET ]
| if is a special form.
| (if COND THEN ELSE...)
|
| If COND yields non-nil, do THEN, else do ELSE...
| Returns the value of THEN or the value of the last of the ELSE's.
| THEN must be one expression, but ELSE... can be zero or more expressions.
| If COND yields nil, and there are no ELSE's, the value is nil.
`----

--
Kevin Rodgers





reply via email to

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