[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: minor mode on/off/toggle with t/nil question
From: |
Stefan Monnier |
Subject: |
Re: minor mode on/off/toggle with t/nil question |
Date: |
Wed, 08 Dec 2010 15:19:35 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> May i ask how does one toggle the mode in elisp code with the new
> scheme?
Here's one way:
(foo-mode (if foo-mode -1 1))
it works with the new scheme as well as the old scheme.
> some question about elisp: when calling a function interactively
> without any arg, how does emacs lisp engine distinguish it from with a
> nil argument?
The Emacs Lisp engine is only called after the `interactive' spec was
used to build the actual arguments. So the interactive spec is set up
such that it doesn't pass nil but something else (e.g. `toggle').
Stefan
- Re: line-move-visual, (continued)
- Re: line-move-visual, Tim X, 2010/12/08
- Re: line-move-visual, Stefan Monnier, 2010/12/08
- Re: line-move-visual, Uday S Reddy, 2010/12/08
- Message not available
- Re: line-move-visual, Leo, 2010/12/08
- Message not available
- Re: Emacs language, Leo, 2010/12/08
- Re: Emacs language, Teemu Likonen, 2010/12/08
- Message not available
- Re: line-move-visual, Uday S Reddy, 2010/12/08
- Re: line-move-visual, Alan Mackenzie, 2010/12/08
- Re: line-move-visual, Uday S Reddy, 2010/12/08
- Re: line-move-visual, Stefan Monnier, 2010/12/08
- Message not available
- Re: minor mode on/off/toggle with t/nil question,
Stefan Monnier <=
- Re: line-move-visual, David Kastrup, 2010/12/08
- Message not available
- Re: line-move-visual, David Kastrup, 2010/12/08
- Re: line-move-visual, Alan Mackenzie, 2010/12/08
- Re: line-move-visual, David Kastrup, 2010/12/08
- Re: line-move-visual, Xah Lee, 2010/12/08
- espresso-mode (was: line-move-visual), Stefan Monnier, 2010/12/08
- Re: line-move-visual, Thad Floryan, 2010/12/09
- Re: line-move-visual, Xah Lee, 2010/12/08
- Re: line-move-visual, Stefan Monnier, 2010/12/08
- Re: line-move-visual, Evans Winner, 2010/12/09