9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Acme 2-1 chord arguments
@ 2015-07-15 14:06 Brian Zwahr
  2015-07-15 15:41 ` dexen deVries
  2015-07-16 16:54 ` Alexander Kapshuk
  0 siblings, 2 replies; 8+ messages in thread
From: Brian Zwahr @ 2015-07-15 14:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:

1.) Is there a way to do what I’m trying to do?

2.) What was the reasoning behind 2-1 chording sending distinct arguments? 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-15 14:06 [9fans] Acme 2-1 chord arguments Brian Zwahr
@ 2015-07-15 15:41 ` dexen deVries
  2015-07-16 15:44   ` Brian Zwahr
  2015-07-16 16:54 ` Alexander Kapshuk
  1 sibling, 1 reply; 8+ messages in thread
From: dexen deVries @ 2015-07-15 15:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

dirty 1.) rc -c 'git '^
note the space after git

idiomatic 1.) use win(1), pass 'command' argument a script which executes
git for each line of input as arguments through rc(1) to evaluate the
arguments in the usual way

2.) you can pass complex regular expression as argument to grep(1), without
rc(1) choking on metacharacters.
the argument is guaranteed not to have unforeseen side effects.


example win(1) script:
#!/usr/bin/env rc

orig_ifs = $ifs

PAGER=cat

while (true) {
    ifs=''
    echo -n 'git> '
    line = `{read}
    ifs = $orig_ifs
    rc -c 'git '^ $line
}

[-- Attachment #2: Type: text/html, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-15 15:41 ` dexen deVries
@ 2015-07-16 15:44   ` Brian Zwahr
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Zwahr @ 2015-07-16 15:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks for the information! I must confess, I don’t fully understand your idiomatic answer. 

> On Jul 15, 2015, at 10:41 AM, dexen deVries <dexen.devries@gmail.com> wrote:
> 
> dirty 1.) rc -c 'git '^  
> note the space after git
> 
> idiomatic 1.) use win(1), pass 'command' argument a script which executes git for each line of input as arguments through rc(1) to evaluate the arguments in the usual way
> 
> 2.) you can pass complex regular expression as argument to grep(1), without rc(1) choking on metacharacters.
> the argument is guaranteed not to have unforeseen side effects.
> 
> 
> example win(1) script:
> #!/usr/bin/env rc
> 
> orig_ifs = $ifs
> 
> PAGER=cat
> 
> while (true) {
>     ifs=''
>     echo -n 'git> '
>     line = `{read}
>     ifs = $orig_ifs
>     rc -c 'git '^ $line
> }
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-15 14:06 [9fans] Acme 2-1 chord arguments Brian Zwahr
  2015-07-15 15:41 ` dexen deVries
@ 2015-07-16 16:54 ` Alexander Kapshuk
  2015-07-16 17:15   ` Brian Zwahr
  1 sibling, 1 reply; 8+ messages in thread
From: Alexander Kapshuk @ 2015-07-16 16:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr <echosa@icloud.com> wrote:
> According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>
> 1.) Is there a way to do what I’m trying to do?
>
> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>
>

Have you tried typing git into the win tag and typing and selecting
the subsequent arguments in another window, passing them to git via
the 2-1 chord?

I've just tried doing that with 'git pull', and 'ls -ld .', both
commands working as expected for me.

Is this what you've been trying to do, or am I thinking wrong here?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-16 16:54 ` Alexander Kapshuk
@ 2015-07-16 17:15   ` Brian Zwahr
  2015-07-16 17:39     ` Alexander Kapshuk
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Zwahr @ 2015-07-16 17:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I guess I should clarify that I’m not using win. I normally do everything in a +Errors window. So, for git, I run all the commands in /project/root/dir/+Errors.

I just tried in a win window, and it does work. I’m assuming this is because win parses what’s passed in differently. 

> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> 
> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr <echosa@icloud.com> wrote:
>> According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>> 
>> 1.) Is there a way to do what I’m trying to do?
>> 
>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>> 
>> 
> 
> Have you tried typing git into the win tag and typing and selecting
> the subsequent arguments in another window, passing them to git via
> the 2-1 chord?
> 
> I've just tried doing that with 'git pull', and 'ls -ld .', both
> commands working as expected for me.
> 
> Is this what you've been trying to do, or am I thinking wrong here?
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-16 17:15   ` Brian Zwahr
@ 2015-07-16 17:39     ` Alexander Kapshuk
  2015-07-16 17:45       ` Brian Zwahr
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Kapshuk @ 2015-07-16 17:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I just tried typing 'git' into my '/project/root/dir/+Errors' with
'log' selected in a different Acme window. Executing chord 2-1 on
'git' did work for me. The 'log' argument has to be selected in its
entirety, but not the trailing new line, which would generate an
'invalid key error' message, if passed to 'git'. Alternatively, you
may just click with  button 1 on the argument being passed, and then
do the 2-1 chord on 'git'. This worked for me as well. Hope this
helps.

Do you get any output when you try doing the 2-1 mouse chord on git?

On Thu, Jul 16, 2015 at 8:15 PM, Brian Zwahr <echosa@icloud.com> wrote:
> I guess I should clarify that I’m not using win. I normally do everything in a +Errors window. So, for git, I run all the commands in /project/root/dir/+Errors.
>
> I just tried in a win window, and it does work. I’m assuming this is because win parses what’s passed in differently.
>
>> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
>>
>> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr <echosa@icloud.com> wrote:
>>> According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>>>
>>> 1.) Is there a way to do what I’m trying to do?
>>>
>>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>>>
>>>
>>
>> Have you tried typing git into the win tag and typing and selecting
>> the subsequent arguments in another window, passing them to git via
>> the 2-1 chord?
>>
>> I've just tried doing that with 'git pull', and 'ls -ld .', both
>> commands working as expected for me.
>>
>> Is this what you've been trying to do, or am I thinking wrong here?
>>
>
>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-16 17:39     ` Alexander Kapshuk
@ 2015-07-16 17:45       ` Brian Zwahr
  2015-07-16 18:06         ` Alexander Kapshuk
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Zwahr @ 2015-07-16 17:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Sorry, let me be more clear. The issue when I need to send multiple arguments. For instance using 2-1 to add “pull” or “checkout” to “git” works. However, using 2-1 to add “pull --prune” or “checkout .” does not work. At least, not in +Errors. It does work in win, though, apparently.

> On Jul 16, 2015, at 12:39 PM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> 
> I just tried typing 'git' into my '/project/root/dir/+Errors' with
> 'log' selected in a different Acme window. Executing chord 2-1 on
> 'git' did work for me. The 'log' argument has to be selected in its
> entirety, but not the trailing new line, which would generate an
> 'invalid key error' message, if passed to 'git'. Alternatively, you
> may just click with  button 1 on the argument being passed, and then
> do the 2-1 chord on 'git'. This worked for me as well. Hope this
> helps.
> 
> Do you get any output when you try doing the 2-1 mouse chord on git?
> 
> On Thu, Jul 16, 2015 at 8:15 PM, Brian Zwahr <echosa@icloud.com> wrote:
>> I guess I should clarify that I’m not using win. I normally do everything in a +Errors window. So, for git, I run all the commands in /project/root/dir/+Errors.
>> 
>> I just tried in a win window, and it does work. I’m assuming this is because win parses what’s passed in differently.
>> 
>>> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
>>> 
>>> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr <echosa@icloud.com> wrote:
>>>> According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>>>> 
>>>> 1.) Is there a way to do what I’m trying to do?
>>>> 
>>>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>>>> 
>>>> 
>>> 
>>> Have you tried typing git into the win tag and typing and selecting
>>> the subsequent arguments in another window, passing them to git via
>>> the 2-1 chord?
>>> 
>>> I've just tried doing that with 'git pull', and 'ls -ld .', both
>>> commands working as expected for me.
>>> 
>>> Is this what you've been trying to do, or am I thinking wrong here?
>>> 
>> 
>> 
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Acme 2-1 chord arguments
  2015-07-16 17:45       ` Brian Zwahr
@ 2015-07-16 18:06         ` Alexander Kapshuk
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Kapshuk @ 2015-07-16 18:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I see. Sorry. I don't have any other ideas for you to try at the moment.


On Thu, Jul 16, 2015 at 8:45 PM, Brian Zwahr <echosa@icloud.com> wrote:
> Sorry, let me be more clear. The issue when I need to send multiple arguments. For instance using 2-1 to add “pull” or “checkout” to “git” works. However, using 2-1 to add “pull --prune” or “checkout .” does not work. At least, not in +Errors. It does work in win, though, apparently.
>
>> On Jul 16, 2015, at 12:39 PM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
>>
>> I just tried typing 'git' into my '/project/root/dir/+Errors' with
>> 'log' selected in a different Acme window. Executing chord 2-1 on
>> 'git' did work for me. The 'log' argument has to be selected in its
>> entirety, but not the trailing new line, which would generate an
>> 'invalid key error' message, if passed to 'git'. Alternatively, you
>> may just click with  button 1 on the argument being passed, and then
>> do the 2-1 chord on 'git'. This worked for me as well. Hope this
>> helps.
>>
>> Do you get any output when you try doing the 2-1 mouse chord on git?
>>
>> On Thu, Jul 16, 2015 at 8:15 PM, Brian Zwahr <echosa@icloud.com> wrote:
>>> I guess I should clarify that I’m not using win. I normally do everything in a +Errors window. So, for git, I run all the commands in /project/root/dir/+Errors.
>>>
>>> I just tried in a win window, and it does work. I’m assuming this is because win parses what’s passed in differently.
>>>
>>>> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
>>>>
>>>> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr <echosa@icloud.com> wrote:
>>>>> According to the man page, using the 2-1 chord sends selected text as a *distinct* argument to the executed command. This is all well and good for Edit, Look, etc. However, it keeps me from being able to, for instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>>>>>
>>>>> 1.) Is there a way to do what I’m trying to do?
>>>>>
>>>>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>>>>>
>>>>>
>>>>
>>>> Have you tried typing git into the win tag and typing and selecting
>>>> the subsequent arguments in another window, passing them to git via
>>>> the 2-1 chord?
>>>>
>>>> I've just tried doing that with 'git pull', and 'ls -ld .', both
>>>> commands working as expected for me.
>>>>
>>>> Is this what you've been trying to do, or am I thinking wrong here?
>>>>
>>>
>>>
>>
>
>



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-16 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 14:06 [9fans] Acme 2-1 chord arguments Brian Zwahr
2015-07-15 15:41 ` dexen deVries
2015-07-16 15:44   ` Brian Zwahr
2015-07-16 16:54 ` Alexander Kapshuk
2015-07-16 17:15   ` Brian Zwahr
2015-07-16 17:39     ` Alexander Kapshuk
2015-07-16 17:45       ` Brian Zwahr
2015-07-16 18:06         ` Alexander Kapshuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).