new command modifiers

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

new command modifiers

Marian Csontos
Hi folks,

I was looking around a bit if is possible to show :find matches in list  
and select from it - as with :tselect - or in quickfix window. And it is  
not.

What about adding ``modifiers'' (something like :vertical, :topleft,  
:silent) for tasks in which list could be returned?
:select for showing list and allow user to select from it,
:ccmd or :qf or :anything for showing quickfix window.

And
:scmd which splits if there is some result from command
:aadd to add results to agrlist

Regards

-- Marian


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: new command modifiers

Bram Moolenaar

Marian Csontos wrote:

> I was looking around a bit if is possible to show :find matches in list  
> and select from it - as with :tselect - or in quickfix window. And it is  
> not.
>
> What about adding ``modifiers'' (something like :vertical, :topleft,  
> :silent) for tasks in which list could be returned?
> :select for showing list and allow user to select from it,
> :ccmd or :qf or :anything for showing quickfix window.
>
> And
> :scmd which splits if there is some result from command
> :aadd to add results to agrlist

Something like this is near the top of the todo list.  But how it would
work is still unclear.

One important issue is whether you want to list files first and then
decide what to do with it, or the other way around.  For example:

        :select write `find . -name "foo*"`

Here you first decide to write the file, then select the file name from
a list.  This is a bit like ":browse".

Another method would be to open a window with matches:

        :select `find . -name "foo*"`

Then in the window you can select the action what to do.  A bit like the
file explorer (now netrw plugin).

The first is more a short-term thing, after selecting the name the list
is gone.  With the second you could do more commands and close the list
when you're done.

Instead of files you could list other matches, e.g., tags or class
names.  But then you need something else to specify where to jump to.

Perhaps we need both?

--
A salesperson says:            Translation:
"backward compatible"          Old technology
"Premium"                      Overpriced
"Can't keep it on the shelf"   Unavailable
"Stands alone"                 Piece of shit
"Proprietary"                  Incompatible
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: new command modifiers

Marian Csontos
On Tue, 02 Aug 2005 12:39:56 +0200, Bram Moolenaar <[hidden email]>  
wrote:

>
> Marian Csontos wrote:
>
>> I was looking around a bit if is possible to show :find matches in list
>> and select from it - as with :tselect - or in quickfix window. And it is
>> not.
>>
>> What about adding ``modifiers'' (something like :vertical, :topleft,
>> :silent) for tasks in which list could be returned?
>> :select for showing list and allow user to select from it,
>> :ccmd or :qf or :anything for showing quickfix window.
>>
>> And
>> :scmd which splits if there is some result from command
>> :aadd to add results to agrlist
>
> Something like this is near the top of the todo list.  But how it would
> work is still unclear.
>
> One important issue is whether you want to list files first and then
> decide what to do with it, or the other way around.  For example:
>
> :select write `find . -name "foo*"`
>
> Here you first decide to write the file, then select the file name from
> a list.  This is a bit like ":browse".
>
> Another method would be to open a window with matches:
>
> :select `find . -name "foo*"`
>
> Then in the window you can select the action what to do.  A bit like the
> file explorer (now netrw plugin).
>
> The first is more a short-term thing, after selecting the name the list
> is gone.  With the second you could do more commands and close the list
> when you're done.
>
> Instead of files you could list other matches, e.g., tags or class
> names.  But then you need something else to specify where to jump to.
>
> Perhaps we need both?
>

It looks that some kind of command nesting would be needed. Now it is  
difficult to distinguish which argument belongs to which command (of  
course one could use nested exec). I don't know how commands works  
internally - if it is possible to return object of some type and when  
passed to next command to do some conversions.

It's better for me to write it as functions:
        find(pattern) - expects pattern, returns list
        select(list) - expects list, opens selector window and returns selected  
item
        write(fname) - expects file name, writes file, return NULL
so:
        write(select(find("*.txt"))) behaves like your first example
or:
        select(find("*.txt")) as second
and then map them to some command.

It's hard to have options for everything, but some kind of overloading  
give us tool for even more customization of behaviour.
We could call it emacsization (I should think over me. :-)

-- Marian


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com