[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shift selection using interactive spec
From: |
Juri Linkov |
Subject: |
Re: Shift selection using interactive spec |
Date: |
Sun, 30 Mar 2008 21:33:33 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
>> Then the second arg to `interactive' could be just a lambda
>> with one argument with the value this function returns, e.g.
>
> Yes, and if the use of `lambda' turns out to be a bit heavy, we can
> provide a handy alternative: if the return-spec is a list but not
> a function, then take the list as a function call with a missing argument:
>
> (defun command ()
> (interactive
> nil
> (lambda (ret-val)
> (message "Result of this command is %.0f" ret-val)))
> ...
> (let ((return-value ...))
> ...
> return-value))
>
> =>
>
> (defun command ()
> (interactive
> nil
> (message "Result of this command is %.0f"))
> ...
> (let ((return-value ...))
> ...
> return-value))
And then another simplest alternative we could provide is t when the
return value should be displayed with just `(message "%s" ret-val)':
(defun command ()
(interactive
nil
t)
...
(let ((return-value ...))
...
return-value))
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: Shift selection using interactive spec, (continued)
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/26
- Re: Shift selection using interactive spec, Chong Yidong, 2008/03/26
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/27
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/27
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/28
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/28
- Re: Shift selection using interactive spec, Lennart Borgman (gmail), 2008/03/28
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/29
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/29
- Re: Shift selection using interactive spec, Stefan Monnier, 2008/03/30
- Re: Shift selection using interactive spec,
Juri Linkov <=
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/31
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/30
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/30
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/26
- Re: Shift selection using interactive spec, Thomas Lord, 2008/03/18
- Re: Shift selection using interactive spec, Richard Stallman, 2008/03/15
Re: Shift selection using interactive spec, Robert J. Chassell, 2008/03/16