emacs-devel
[Top][All Lists]
Advanced

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

Re: Shift selection using interactive spec


From: Lennart Borgman (gmail)
Subject: Re: Shift selection using interactive spec
Date: Sat, 29 Mar 2008 02:15:03 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Juri Linkov wrote:
The hard part is to figure out a good design for it.

It is important to support both returning a single value and returning
a list of values.  There could be a character at the beginning of the
interactive output string which specifies that it's a list of values.
Otherwise it is one value.

But what do we use after that?

It could be a format string to format the values.
Is that general enough?

And what about using Lisp code for how to format the value?
How would that Lisp code refer to the value itself?
Perhaps that Lisp code should take the form of a lambda expression.

But how do we specify whether it wants a list of values or a single
value?  I don't see any clean and natural way to specify that.

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))

to the second argument of `interactive'?

If so, then I see no way to generalize this expression as it can be
anything allowed in Lisp.

I can't understand the usefulness of this feature for an interactive function. Why not just do something like the above?

But there is another rather similar feature that I think would be useful: handling of errors differently when a function is called interactively. I think the current implementation with debug-ignored-errors is a bug since it does not distinguish when a function is called interactively or not. This can be cured in other ways too, of course.




reply via email to

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