gzz-dev
[Top][All Lists]
Advanced

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

Re: [Gzz] New PEG: prefix_argument--benja


From: Tuomas Lukka
Subject: Re: [Gzz] New PEG: prefix_argument--benja
Date: Sat, 16 Nov 2002 18:27:01 +0200
User-agent: Mutt/1.4i

> Historical precedent
> --------------------
> 
> Emacs commands normally read their arguments through the
> minibuffer, after they have been called. For example, if I
> type '``C-x C-f``' (``find-file``) to open a file, Emacs says
> "``Find file:``" in the minibuffer and allows me to enter
> a file name. I type the name in *after* I typing '``C-x C-f``.'
> 
> However, there is one exception: A command may take a numerical
> "prefix argument," which can be specified in various ways.
> Often, but not always, this argument will specify
> the number of times the command is to be executed.

Vi uses " to specify register as a prefix.

PUI uses click&drag to select area, then apply command
(i.e. start typing --> erase area; ctrl-c --> copy etc.)

> Specification
> -------------
> 
> "The prefix argument" is an ordered set of cells
> that a binding may use. (By "ordered set" I mean a list on which
> each element may appear only once.) 

It might be good to mention that this is not that special a concept:
a rank is just like that as well.

It would be good to say:
        
        The user interface should show the current prefix argument
        to the user in a reasonable way.

i.e. note "should", used as in internet standards.

> The prefix argument
> is currently determined as follows:
> 
>    - If a search according to ``search_bindings--benja``
>      has just been finished (according to the PEG, by pressing
>      the space bar twice), and this search has returned more
>      than zero cells, these cells are the prefix argument.
>      (The order is defined by the search policy, configurable
>      by the user in an as-yet-undefined way).
>    - Else, if there any cells are marked, they are
>      the prefix argument. (Marks are ordered; this is outside
>      the scope of this PEG, but normally the cell that
>      was marked first is the first in the list.)
>    - Else, there is no prefix argument.
> 
> Bindings usually use the prefix argument in one of two ways:
> 
>    - "Prefix or other:" If there is no prefix argument, the cell
>      accursed in the other window is used instead. Examples:
>      Connect, Put (see ``containment--benja``), Go (the 'g' key).
>    - "Prefix or this:" If there is no prefix argument, the cell
>      accursed in *this* window is used instead. Examples:
>      Hop, Break, Clone, Delete, Excise, New Cell.

This feels a bit complicated way to explain this. I agree with 
the result but it *might* be better to explain this instead by
saying that if there's no marked cells, the prefix argument
is either the this or other.


> so we need a third case here. There may be
> more special cases, but the above are the usual ones.
> 
> In the future, it should also be possible to set the prefix argument
> through at least two more mechanisms:
> 
>    - Entering a cell number. (If you've typed '``734``,' the cell
>      of that number is the prefix argument.)
>    - Building an expression, using menus. It should be possible
>      to build expressions like "all emails on gzz-commits which
>      are newer than three days" easily, using the zaubertrank.
>      (Once such an expression is built, it'll become
>      the prefix argument. For example, building the above expression,
>      then hitting 't' and a direction will clone all those emails
>      in a single rank.)
> 
> The details of these are out of scope for this PEG; a future PEG
> will deal with them. Once they are implemented, the prefix argument
> will be determined as follows:
> 
>    - The latest search result, cell number or expression, if any.
>    - Else, the marked cells, if any.
>    - Else, there is no prefix argument.
> 
> That means if you enter a cell number, then perform a search,
> the cell number will be thrown away and the search will be
> the prefix argument; if you perform a search and then enter
> a cell number, the search will be thrown away; and so on.

Hmm... how do I search and then leave the search result in the background
for a moment?

Actually, I'm not completely sure that using the marked cells like this
is good, without being specific: I'd prefer saying

        "Ok, now with the marked cells, do X"

instead of accidentally using the marked cells when moving around to 
mark cells.

        Tuomas




reply via email to

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