9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] hack for acme
@ 2003-03-03 11:56 paurea
  0 siblings, 0 replies; 11+ messages in thread
From: paurea @ 2003-03-03 11:56 UTC (permalink / raw)
  To: 9fans

Following the suggestions made in the list, we made some changes for
acme in order to be able to navigate directories reusing windows.
First we used the exec button, but didn't work well (for example
inferno in /usr can be a directory or a program).  After that we tried
the chord 3-1 which seems to work well.  diff is attached.


          A mouse chord of buttons 3 and 1 (clicking 1 while holding
          down button 3) opens a new file/directory in the current window.
          This chord works only when the window tag corresponds to a
          directory. It is useful to navigate through deep file hier-
          archies without opening each directory in a different win-
          dow.


diff /n/dump/2003/0220/sys/src/cmd/acme/acme.c ./acme.c
424c424
< 	uint q0, q1;
---
> 	uint q0, q1, keepw;
431a432
> 
540,541c541,544
< 					if(textselect3(t, &q0, &q1))
< 						look3(t, q0, q1, FALSE);
---
> 					if(keepw=textselect3(t, &q0, &q1)){
> 						keepw=(keepw==3); // is it chord 31?
> 						look3(t, q0, q1, FALSE,keepw);
> 					}

203a206
> 	return;
diff /n/dump/2003/0220/sys/src/cmd/acme/fns.h ./fns.h
59c59,60
< void	look3(Text*, uint, uint, int);
---
> void	look3(Text*, uint, uint, int,uint);
diff /n/dump/2003/0220/sys/src/cmd/acme/look.c ./look.c
15c15
< Window*	openfile(Text*, Expand*);
---
> Window*	openfile(Text*, Expand*,uint islocal);
20c20
< look3(Text *t, uint q0, uint q1, int external)
---
> look3(Text *t, uint q0, uint q1, int external, uint keepw)
31a32
> 
136c137
< 		openfile(t, &e);
---
> 		openfile(t, &e,keepw);
170a172,175
> 
> 
> 
> 
196c201
< 	openfile(nil, &e);
---
> 	openfile(nil, &e,FALSE);
671c676
< openfile(Text *t, Expand *e)
---
> openfile(Text *t, Expand *e, uint keepw)
677a683
> 	Rectangle rect;
693c699,707
< 		w = makenewwindow(t);
---
> 		if(keepw){
> 			w=t->w;
> 			if(w == nil)
> 				return nil;	
> 		}
> 		else{
> 			w = makenewwindow(t);
> 		}
> 	
695c709,713
< 		winsetname(w, e->name, e->nname);
---
> 	
> 		winsetname(w, e->name, e->nname);		
> 	if(keepw){
> 			t->file->nc=0;
> 		}
696a715,722
> 
> 	if(keepw){
> 			rect=t->all;
> 			rect.min.x += Scrollwid+Scrollgap+Margin+Border;
> 			textredraw(t,rect,t->reffont->f,screen,-1);
> 			rowresize(&row, screen->clipr);
> 			flushimage(display, 1);
> 		}
763c789
< 		openfile(et, &e);
---
> 		openfile(et, &e,FALSE);
diff /n/dump/2003/0220/sys/src/cmd/acme/text.c ./text.c
13a14,15
> 
> 
189a192
> 
191a195
> 	
1047,1048c1051,1057
< 	h = (textselect23(t, q0, q1, but3col, 1|2) == 0);
< 	return h;
---
> 	h = textselect23(t, q0, q1, but3col, 2);
> 	if(h & 3)
> 		return 3; // chord31
> 	if(h==0)
> 		return 1;
> 	else
> 		return 0;
diff /n/dump/2003/0220/sys/src/cmd/acme/xfid.c ./xfid.c
809c809
< 			look3(t, q0, q1, TRUE);
---
> 			look3(t, q0, q1, TRUE, FALSE);



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

* Re: [9fans] Hack for acme
  2003-03-06 11:39 peter a. cejchan
@ 2003-03-07 12:39 ` paurea
  0 siblings, 0 replies; 11+ messages in thread
From: paurea @ 2003-03-07 12:39 UTC (permalink / raw)
  To: 9fans

>>  PS: I would vote for a history filke for acme windows, too ;-)
> oooops, no, no, NO! (I just didn't think for a moment).  there's a tag, of course...
> 
> I pulled 3-1 acme from sources/nemo and yes, it is convenient! I only miss the same functionality on files....


It should be easy to add, but I don't find it as useful.

						Gorka



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

* [9fans] Hack for acme
@ 2003-03-06 11:39 peter a. cejchan
  2003-03-07 12:39 ` paurea
  0 siblings, 1 reply; 11+ messages in thread
From: peter a. cejchan @ 2003-03-06 11:39 UTC (permalink / raw)
  To: 9fans

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

>  PS: I would vote for a history filke for acme windows, too ;-)
oooops, no, no, NO! (I just didn't think for a moment).  there's a tag, of course...

I pulled 3-1 acme from sources/nemo and yes, it is convenient! I only miss the same functionality on files....
++pac


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

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

* Re: [9fans] Hack for acme
  2003-03-05 17:52 ` Russ Cox
                     ` (2 preceding siblings ...)
  2003-03-05 19:18   ` Fco.J.Ballesteros
@ 2003-03-06  9:51   ` paurea
  3 siblings, 0 replies; 11+ messages in thread
From: paurea @ 2003-03-06  9:51 UTC (permalink / raw)
  To: 9fans

> We did not include the 3-1 change in our acme, mainly because 3-1
> cancels a 3 that you've started and want to back out.  In other
> words, as Rob pointed out before, 3-1 is already taken.

You can do that with 3-2. One of the two chords is expendable... Anyway
this is limited for dir tag windows.

> 
> It might be reasonable to use 2 to ``exec'' a directory by opening it
> in the same window, but then there is the inconsistency that 2 on a
> directory and 2 on a file behave differently.  

Yes, we already tried that and it was difficult to know what the user
wants.  For example with src on /usr or changing to the directory of
inferno.  My first choice was to execute and go into directories and it
had a very bad result. I then tried execute everywhere, go into directories
just on windows with dir tag and it was frustrating. If something is
a file you can execute (without path) and a local directory without path
I haven't found an easy way to decide what you want to do. I didn't try
the selected dot strategy though, which may be an alternative, because
I found it a little bit awkward.

> 
> I think that if I had the ability to open a directory in the same window,
> I might use it a fair amount.  I'm not sure how much I would use the
> open a file in the same window capability.  I'm still thinking about 2.
> But 3-1 won't happen.
> 
> Paurea and Nemo, how much do you use your 3-1 on files vs. directories?

I use it almost mainly on directories and almost always I open a dir buffer I
use it at least once. That is quite often.

									Gorka



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

* Re: [9fans] Hack for acme
  2003-03-05 19:18   ` Fco.J.Ballesteros
@ 2003-03-06  9:41     ` Douglas A. Gwyn
  0 siblings, 0 replies; 11+ messages in thread
From: Douglas A. Gwyn @ 2003-03-06  9:41 UTC (permalink / raw)
  To: 9fans

"Fco.J.Ballesteros" wrote:
> I just deleted the Ignore command I added time ago to acme because
> we found that we have seldom used it.

Or, you used it a lot, by default..


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

* [9fans] Hack for acme
@ 2003-03-06  6:32 peter a. cejchan
  0 siblings, 0 replies; 11+ messages in thread
From: peter a. cejchan @ 2003-03-06  6:32 UTC (permalink / raw)
  To: 9fans

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

>  Regarding 3-1, paurea is using it a lot on directories, I've used it
>  several times these days, but I still don't know if that's really useful
>  for me or not. If after some time we find that we seldom use it, we'll
[snip]
>  On files, I *never* used 3-1. Well, I used it once when I first tried

I missed it on both for a long time. Thanks 4 "hacme", folks!
PS: I would vote for a history filke for acme windows, too ;-)

++pac


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

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

* Re: [9fans] Hack for acme
  2003-03-05 17:52 ` Russ Cox
  2003-03-05 18:17   ` Sam
  2003-03-05 18:24   ` Skip Tavakkolian
@ 2003-03-05 19:18   ` Fco.J.Ballesteros
  2003-03-06  9:41     ` Douglas A. Gwyn
  2003-03-06  9:51   ` paurea
  3 siblings, 1 reply; 11+ messages in thread
From: Fco.J.Ballesteros @ 2003-03-05 19:18 UTC (permalink / raw)
  To: 9fans

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

What we do is to make our changes and after experience says if
we are using them or not, we keep them or delete them. I just deleted
the Ignore command I added time ago to acme because we found that we
have seldom used it.

Regarding 3-1, paurea is using it a lot on directories, I've used it
several times these days, but I still don't know if that's really useful
for me or not. If after some time we find that we seldom use it, we'll
delete that feature; but I think that we'll be using it a lot (at least
paurea is doing so, and I think I'm going the same way).

On files, I *never* used 3-1. Well, I used it once when I first tried
acme, just to play with undoing buttons. I don't know for sure, but I
think paurea never used it either.

Most times, I notice that I used 3 to open a wrong file (eg /dev/zero and
alike) after I released the button (which makes 3-1 no longer useful as
a cancel).

On the other hand, we had 2 on directories instead of 3-1 some time ago.
It was confusing because some directories correspond to program names in
/bin. That's why we decided to move to 3-1 instead of keep on using 2.

[-- Attachment #2: Type: message/rfc822, Size: 2070 bytes --]

From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Hack for acme
Date: Wed, 5 Mar 2003 12:52:21 -0500
Message-ID: <d2708caf4df164a10d01adbc3aa1cf1f@plan9.bell-labs.com>

We did not include the 3-1 change in our acme, mainly because 3-1
cancels a 3 that you've started and want to back out.  In other
words, as Rob pointed out before, 3-1 is already taken.

It might be reasonable to use 2 to ``exec'' a directory by opening it
in the same window, but then there is the inconsistency that 2 on a
directory and 2 on a file behave differently.  

I think that if I had the ability to open a directory in the same window,
I might use it a fair amount.  I'm not sure how much I would use the
open a file in the same window capability.  I'm still thinking about 2.
But 3-1 won't happen.

Paurea and Nemo, how much do you use your 3-1 on files vs. directories?

Russ

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

* Re: [9fans] Hack for acme
  2003-03-05 17:52 ` Russ Cox
  2003-03-05 18:17   ` Sam
@ 2003-03-05 18:24   ` Skip Tavakkolian
  2003-03-05 19:18   ` Fco.J.Ballesteros
  2003-03-06  9:51   ` paurea
  3 siblings, 0 replies; 11+ messages in thread
From: Skip Tavakkolian @ 2003-03-05 18:24 UTC (permalink / raw)
  To: 9fans

> I think that if I had the ability to open a directory in the same window,
> I might use it a fair amount.  I'm not sure how much I would use the
> open a file in the same window capability.  I'm still thinking about 2.
> But 3-1 won't happen.

I'd like to see this to be an option that modifies the nav behavior
for directories (like -b is for selecting windows).  3 is more
natural.  If window is a directory, and you click-3 on a directory
inside of it, reuse the window.  If the window is some random buffer
and I type in the directory name and click-3 on it, that should open a
new window. my 2¢



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

* Re: [9fans] Hack for acme
  2003-03-05 17:52 ` Russ Cox
@ 2003-03-05 18:17   ` Sam
  2003-03-05 18:24   ` Skip Tavakkolian
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Sam @ 2003-03-05 18:17 UTC (permalink / raw)
  To: 9fans


> We did not include the 3-1 change in our acme, mainly because 3-1
> cancels a 3 that you've started and want to back out.  In other
> words, as Rob pointed out before, 3-1 is already taken.

Not to be argumentative, but so does 3-2.  Not including a seemingly
useful feature because you don't want to change the behaviour of your
fingers under a seldom used mechanism seems foolish.  If you want
1 to cancel a 3 click then it should be across the board and cancel
a 2 click as well.  Regularity shouldn't be an option.

Since 1 is useful for X with args, it can be useful for open with args.
Suppose the concept whereby the user highlights a string
representative of the window he/she wants the open to occur in.
If you highlight, say, `.' you mean ``open here.''  Otherwise,
you could open all docs in one particular window.  Perhaps there
are other uses.

I'm not certain of acme's internal window naming organisation,
but this seems doable.

Sam



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

* Re: [9fans] Hack for acme
  2003-03-05 17:23 [9fans] Hack " paurea
@ 2003-03-05 17:52 ` Russ Cox
  2003-03-05 18:17   ` Sam
                     ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Russ Cox @ 2003-03-05 17:52 UTC (permalink / raw)
  To: 9fans

We did not include the 3-1 change in our acme, mainly because 3-1
cancels a 3 that you've started and want to back out.  In other
words, as Rob pointed out before, 3-1 is already taken.

It might be reasonable to use 2 to ``exec'' a directory by opening it
in the same window, but then there is the inconsistency that 2 on a
directory and 2 on a file behave differently.  

I think that if I had the ability to open a directory in the same window,
I might use it a fair amount.  I'm not sure how much I would use the
open a file in the same window capability.  I'm still thinking about 2.
But 3-1 won't happen.

Paurea and Nemo, how much do you use your 3-1 on files vs. directories?

Russ



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

* [9fans] Hack for acme
@ 2003-03-05 17:23 paurea
  2003-03-05 17:52 ` Russ Cox
  0 siblings, 1 reply; 11+ messages in thread
From: paurea @ 2003-03-05 17:23 UTC (permalink / raw)
  To: 9fans

Nemo included the changed files on sources.  You can pull them from
nemos directory.  

Enjoy

									Gorka



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

end of thread, other threads:[~2003-03-07 12:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-03 11:56 [9fans] hack for acme paurea
2003-03-05 17:23 [9fans] Hack " paurea
2003-03-05 17:52 ` Russ Cox
2003-03-05 18:17   ` Sam
2003-03-05 18:24   ` Skip Tavakkolian
2003-03-05 19:18   ` Fco.J.Ballesteros
2003-03-06  9:41     ` Douglas A. Gwyn
2003-03-06  9:51   ` paurea
2003-03-06  6:32 peter a. cejchan
2003-03-06 11:39 peter a. cejchan
2003-03-07 12:39 ` paurea

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