[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 04:05:31 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
> As I understand the purpose of this feature is practically to move
> the last expression of the command's body that usually is written as
>
> (if (interactive-p)
> (message "Result of this command is %.0f" return-value)
> (format "%.0f" return-value))
>
> You have the right idea in mind for what the code would be trying to
> do. But code like that would be a strange way to write it, and in
> practice does seem to occur much if at all. The way I would envision
> this is more like
>
> (if interactive-call
> (message "Result of this command is %.0f" return-value))
> return-value)
>
> where `interactive-call' is an argument initialized to non-nil
> for an interactive call.
>
> The job of the second arg to `interactive', that I've proposed, would
> be to control how to generate the message in the interactive case.
Then the second arg to `interactive' could be just a lambda
with one argument with the value this function returns, e.g.
(defun command ()
(interactive
nil
(lambda (ret-val)
(message "Result of this command is %.0f" ret-val)))
...
(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 <=
- Re: Shift selection using interactive spec, Stefan Monnier, 2008/03/30
- Re: Shift selection using interactive spec, Juri Linkov, 2008/03/30
- 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