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
* [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
* [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
* [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

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