emacs-devel
[Top][All Lists]
Advanced

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

Re: propose adding Icicles to Emacs


From: Richard Stallman
Subject: Re: propose adding Icicles to Emacs
Date: Mon, 02 Jul 2007 15:47:41 -0400

    You say, "And [the command] can do something different if it wants to." That
    was precisely my point. Somehow, someone needs to tell it whether, and if so
    how, to let users do something different, if that is appropriate for that
    particular command.

The programmer will do this by checking a flag that `interactive' will
provide as an argument.

    The question is _how_ a programmer can indicate which function, if any, to
    apply to the entire list (as a whole) and which function, if any, to apply
    to each set member individually (all or selected members only). In some
    cases it makes sense to let users do one, in some cases the other, and in
    some cases both (separately).

No, that's not the question.  The question is how a programmer can
implement the desired behavior in each case.  With my proposal, the
programmer will make the command get an argument saying which behavior
to use.

Here's one idea:  use ! in the interactive spec to mean

   if the user uses the multi-command feature for this
   argument, read all the argument values, make a list of them,
   and pass that as the argument.

It would look like this:

(defun command (file)
  (interactive "!fFile: ")
  (if (listp file)
      ...operate on list of files...
    ...operate on one file...))

When using a Lisp expression inside `interactive',
it could look like this:

(defun command (file)
  (interactive
    (list (multi-arg-repeat
            (read-file-name ...))))
  (if (listp file)
      ...operate on list of files...
    ...operate on one file...))

where `multi-arg-repeat' is a suitable macro
that expands into something like

   (multi-arg-repeat-internal (lambda () (read-file-name ...)))




reply via email to

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