Re: [9fans] documentation suggestion

2013-04-08 Thread Mark van Atten
Here is the patch, which I have submitted to codereview.

It adds an option -t to p9p acme, which restores the Plan 9 tag style.

Mark.

 
diff -r ff3404f79037 src/cmd/acme/acme.c
--- a/src/cmd/acme/acme.c   Sat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/acme.c   Fri Apr 05 22:52:55 2013 +0200
@@ -113,6 +113,9 @@
case 'r':
swapscrollbuttons = TRUE;
break;
+   case 't':
+   neverexpandtag = TRUE;
+   break;
case 'W':
winsize = ARGF();
if(winsize == nil)
diff -r ff3404f79037 src/cmd/acme/dat.h
--- a/src/cmd/acme/dat.hSat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/dat.hFri Apr 05 22:52:55 2013 +0200
@@ -548,6 +548,7 @@
 intglobalautoindent;
 intdodollarsigns;
 char*  mtpt;
+intneverexpandtag;
 
 enum
 {
diff -r ff3404f79037 src/cmd/acme/rows.c
--- a/src/cmd/acme/rows.c   Sat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/rows.c   Fri Apr 05 22:52:55 2013 +0200
@@ -289,9 +289,9 @@
/* Expand tag if necessary */
if(t-what == Tag){
t-w-tagsafe = FALSE;
-   if(r == '\n')
-   t-w-tagexpand = TRUE;
-   winresize(w, w-r, TRUE, TRUE);
+   if(r == '\n'  neverexpandtag == FALSE)
+   t-w-tagexpand = TRUE; 
+   winresize(w, w-r, TRUE, TRUE);
}
winunlock(w);
}
diff -r ff3404f79037 src/cmd/acme/text.c
--- a/src/cmd/acme/text.c   Sat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/text.c   Fri Apr 05 22:52:55 2013 +0200
@@ -662,8 +662,12 @@
Rune *rp;
Text *u;
 
-   if(t-what!=Body  t-what!=Tag  r=='\n')
-   return;
+   if(t-what!=Body   r=='\n'){
+   if(t-what!=Tag) 
+   return;
+   if(neverexpandtag == TRUE)
+   return;
+   }   
if(t-what == Tag)
t-w-tagsafe = FALSE;
 
@@ -756,9 +760,9 @@
 
Tagdown:
/* expand tag to show all text */
-   if(!t-w-tagexpand){
+   if(neverexpandtag == FALSE){
t-w-tagexpand = TRUE;
-   winresize(t-w, t-w-r, FALSE, TRUE);
+   winresize(t-w, t-w-r, FALSE, TRUE); 
}
return;

diff -r ff3404f79037 src/cmd/acme/wind.c
--- a/src/cmd/acme/wind.c   Sat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/wind.c   Fri Apr 05 22:52:55 2013 +0200
@@ -24,7 +24,8 @@
 
w-tag.w = w;
w-taglines = 1;
-   w-tagexpand = TRUE;
+   if(neverexpandtag == FALSE)
+   w-tagexpand = TRUE;
w-body.w = w;
w-id = ++winid;
incref(w-ref);



Re: [9fans] documentation suggestion

2013-04-05 Thread Mark van Atten
On Thursday, 4 April 2013 18:47:12 UTC+2, a...@9srv.net  wrote:
 I have not tried this, but I suspect that if you change
 
 w-tagexpand to FALSE in /src/cmd/acme/wind.c:/^wininit
 
 and recompile, you'll get the Plan 9 behavior. The code
 
 paths are still a bit different, but on cursory examination it
 
 looks like that'll give you what you want.

Thanks for the suggestion! 

I just tried it. Indeed, it puts the tag of a new window in Plan
9 mode. But it does not yet suffice for a full restore, because
hitting return makes the tag multiline again.

I'll look further into it when I have some time.

Mark.



Re: [9fans] documentation suggestion

2013-04-05 Thread Mark van Atten
On Thursday, 4 April 2013 18:47:12 UTC+2, a...@9srv.net  wrote:
 I have not tried this, but I suspect that if you change
 
 w-tagexpand to FALSE in /src/cmd/acme/wind.c:/^wininit
 
 and recompile, you'll get the Plan 9 behavior. The code
 
 paths are still a bit different, but on cursory examination it
 
 looks like that'll give you what you want.
 
 
 
 Anthony

I've now set w-tagexpand or t-w-tagepand to FALSE, and commented
out subsequent statements, in three files: rows.c, text.c, and
wind.c, and now it works as desired.

I should add an option to acme and submit a patch: the multiline tag
is clearly something that pleases some and annoys others.

Mark.



Re: [9fans] documentation suggestion

2013-04-05 Thread Mark van Atten
Subject: Re: [9fans] documentation suggestion

On Friday, 5 April 2013 11:05:56 UTC+2, Mark van Atten  wrote:

 I've now set w-tagexpand or t-w-tagepand to FALSE, and commented
 
 out subsequent statements, in three files: rows.c, text.c, and
 
 wind.c, and now it works as desired.

Not quite; but I should try to come up with something more robust
before addressing this in further messages.

Mark.



Re: [9fans] documentation suggestion

2013-04-05 Thread Mark van Atten
The only further thing needed is to replace in the function texttype, at 
text.c:665,

if(t-what!=Body  t-what!=Tag  r=='\n') 

by

if(t-what!=Body  r=='\n')

Sorry for the noise.

Mark.



Re: [9fans] documentation suggestion

2013-04-04 Thread Mark van Atten
Would it be possible to add an option to p9p acme so that its tags
will always remain one line, i.e., show Plan 9's acme behaviour?

Mark.



Re: [9fans] documentation suggestion

2013-04-04 Thread Rudolf Sykora
On 4 April 2013 10:49, Mark van Atten vanattenm...@gmail.com wrote:
 Would it be possible to add an option to p9p acme so that its tags
 will always remain one line, i.e., show Plan 9's acme behaviour?

I don't understand this question.
In p9p you have an option to use multiline tag,
if you press ENTER somewhere on the tag-line,
but if you don't do that, the behaviour is the same
as in p9, afaik.

Ruda



Re: [9fans] documentation suggestion

2013-04-04 Thread erik quanstrom
On Thu Apr  4 11:25:12 EDT 2013, rudolf.syk...@gmail.com wrote:
 On 4 April 2013 10:49, Mark van Atten vanattenm...@gmail.com wrote:
  Would it be possible to add an option to p9p acme so that its tags
  will always remain one line, i.e., show Plan 9's acme behaviour?
 
 I don't understand this question.
 In p9p you have an option to use multiline tag,
 if you press ENTER somewhere on the tag-line,
 but if you don't do that, the behaviour is the same
 as in p9, afaik.

that's incorrect.  window tags will take up multiple lines
if they wrap in the p9p version.  this is not true for the
plan 9 version.

- erik



Re: [9fans] documentation suggestion

2013-04-04 Thread Rudolf Sykora
On 4 April 2013 17:46, erik quanstrom quans...@labs.coraid.com wrote:
 On Thu Apr  4 11:25:12 EDT 2013, rudolf.syk...@gmail.com wrote:
 On 4 April 2013 10:49, Mark van Atten vanattenm...@gmail.com wrote:
  Would it be possible to add an option to p9p acme so that its tags
  will always remain one line, i.e., show Plan 9's acme behaviour?

 I don't understand this question.
 In p9p you have an option to use multiline tag,
 if you press ENTER somewhere on the tag-line,
 but if you don't do that, the behaviour is the same
 as in p9, afaik.

 that's incorrect.  window tags will take up multiple lines
 if they wrap in the p9p version.  this is not true for the
 plan 9 version.

Well. Before posting I tried it.
And before replying now I again tried it (I use p9p acme).
And the behaviour is kind of more complicated.
I had two windows, each behaved differently (the two mentioned attempts).
One did not wrap, the other did wrap. So I am a bit surprised. :)
Anyway, you may toggle between multiline and singleline mode
with the mouse-wheel.
(Thus only what is a default for a window is now somehow missing knowledge
to me.)

Ruda



Re: [9fans] documentation suggestion

2013-04-04 Thread Mark van Atten
If I click 'New' to open a window in a column, go into its tag, and
start typing after `Look', the tag becomes multiline and wraps my
text when I hit the border.

Mark.



Re: [9fans] documentation suggestion

2013-04-04 Thread Rudolf Sykora
On 4 April 2013 18:05, Mark van Atten vanattenm...@gmail.com wrote:
 If I click 'New' to open a window in a column, go into its tag, and
 start typing after `Look', the tag becomes multiline and wraps my
 text when I hit the border.

Yes. The wrapping mode seems to be the default.
However:
If you, even before typing anything, position the cursor
in the tag line and use your wheel (of course only if you
have one) and try to sroll up (one 'click' is enough),
and then you start to type your text, there will be no wrap-up.
Scrolling changed the mode to a p9-like one.
(Down-scrolling then undoes it.)

If you ask to have a p9-like behaviour a default, there definitely
will be a way, but I do not have a good (simple) suggestion.


Ruda



Re: [9fans] documentation suggestion

2013-04-04 Thread a
I have not tried this, but I suspect that if you change
w-tagexpand to FALSE in /src/cmd/acme/wind.c:/^wininit
and recompile, you'll get the Plan 9 behavior. The code
paths are still a bit different, but on cursory examination it
looks like that'll give you what you want.

Anthony




Re: [9fans] documentation suggestion

2013-04-03 Thread aram
Awesome, Bence.

I was so much frustrated with the multi-line tag.
Actually when you maximizing with 2 a window, all tags become one-liners
 in that column, hiding
all the additional lines at tags. So you must individually scroll down
every multi-line tag.

With your approach it seems there is no much need to have mult-line tags
anyway, since the
additional lines are for Edit commands in the most cases.


On Mon, Apr 1, 2013 at 1:01 PM, Bence Fábián beg...@gmail.com wrote:

 Do what i do. I have only Edit on the tagline and write the commands in a
 new window. And just highlight them and 2-1 click on the Edit on the
 window i want the changes to happen. Easier and reusable.


 2013/4/1 Peter A. Cejchan tyap...@gmail.com

 however, in native Plan9, scrolling goes too fast for multi-line tagline
 :-)
 [yes, I know that I should keep commands short, but, e.g., Edit requires
 newline between commands :(((]

 ++pac




-- 
http://thewayofthecode.posterous.com/


Re: [9fans] documentation suggestion

2013-04-03 Thread Bence Fábián
Well it can be anything. I usually have |awk too. Works with a lot of
things.
The 'Look' in the tag is really good for this also. Say I have a variable in
one file and want to look for it in another window. Just highlight it and
2-1
click on the 'Look' on the other window. You don't even have to touch the
keyboard. It is really fast.


2013/4/3 aram gnubun...@gmail.com

 Awesome, Bence.

 I was so much frustrated with the multi-line tag.
 Actually when you maximizing with 2 a window, all tags become one-liners
  in that column, hiding
 all the additional lines at tags. So you must individually scroll down
 every multi-line tag.

 With your approach it seems there is no much need to have mult-line tags
 anyway, since the
 additional lines are for Edit commands in the most cases.



Re: [9fans] documentation suggestion

2013-04-02 Thread Peter A. Cejchan
Wow! That's it! I always wanted a 'command window', now I see why it is
needless. Thanks!


On Mon, Apr 1, 2013 at 2:01 PM, Bence Fábián beg...@gmail.com wrote:

 Do what i do. I have only Edit on the tagline and write the commands in a
 new window. And just highlight them and 2-1 click on the Edit on the
 window i want the changes to happen. Easier and reusable.


 2013/4/1 Peter A. Cejchan tyap...@gmail.com

 however, in native Plan9, scrolling goes too fast for multi-line tagline
 :-)
 [yes, I know that I should keep commands short, but, e.g., Edit requires
 newline between commands :(((]

 ++pac




Re: [9fans] documentation suggestion

2013-04-01 Thread Peter A. Cejchan
to save my time, could you, please, share that trick? Thanks,

++pac


On Mon, Apr 1, 2013 at 3:45 AM, trebol trebol55...@yahoo.es wrote:

 Hello everyone,
 I've had problems discovering the feature of dragging button 1 to scroll
 the tag line.  I have used first the p9p's acme, which has a more natural
 way to manage the tag line, so I thought I was missing something.
 I have been looking in the 9fans archives and I found the trick.
 Then in abaco, when a text box was full and a strange picture appeared
 (again) on the left, I said Why not? and voilà! this works here too,
 and the picture turned out to be a scroll bar.

 Yes, for you this could be a silly question, but for a newbie like me is
 not.  IMHO, those things must be in the man pages.

 Regards,
 trebol.




[9fans] documentation suggestion

2013-04-01 Thread trebol
On Mon, Apr 01, 2013 at 08:08:18AM +0200, Peter A. Cejchan wrote:
 to save my time, could you, please, share that trick? Thanks,
 
 ++pac

Hello Peter, I suppose my English is too bad.  The trick I was talking
about is the dragging feature itself, sorry.



Re: [9fans] documentation suggestion

2013-04-01 Thread Peter A. Cejchan
however, in native Plan9, scrolling goes too fast for multi-line tagline :-)
[yes, I know that I should keep commands short, but, e.g., Edit requires
newline between commands :(((]

++pac


On Mon, Apr 1, 2013 at 9:11 AM, trebol trebol55...@yahoo.es wrote:

 On Mon, Apr 01, 2013 at 08:08:18AM +0200, Peter A. Cejchan wrote:
  to save my time, could you, please, share that trick? Thanks,
 
  ++pac

 Hello Peter, I suppose my English is too bad.  The trick I was talking
 about is the dragging feature itself, sorry.




Re: [9fans] documentation suggestion

2013-04-01 Thread Rudolf Sykora
Hello,

On 1 April 2013 10:24, Peter A. Cejchan tyap...@gmail.com wrote:
 however, in native Plan9, scrolling goes too fast for multi-line tagline :-)
 [yes, I know that I should keep commands short, but, e.g., Edit requires
 newline between commands :(((]

I found the way how it is in p9p acme better (allowing multiple lines).
However, as far as I remember, some people here
(for some reason; what?) prefer to have a single tag line
with the scrolling mechanism described in this thread.

Ruda



Re: [9fans] documentation suggestion

2013-04-01 Thread Bence Fábián
Do what i do. I have only Edit on the tagline and write the commands in a
new window. And just highlight them and 2-1 click on the Edit on the
window i want the changes to happen. Easier and reusable.


2013/4/1 Peter A. Cejchan tyap...@gmail.com

 however, in native Plan9, scrolling goes too fast for multi-line tagline
 :-)
 [yes, I know that I should keep commands short, but, e.g., Edit requires
 newline between commands :(((]

 ++pac



[9fans] documentation suggestion

2013-03-31 Thread trebol
Hello everyone, 
I've had problems discovering the feature of dragging button 1 to scroll
the tag line.  I have used first the p9p's acme, which has a more natural
way to manage the tag line, so I thought I was missing something.
I have been looking in the 9fans archives and I found the trick.
Then in abaco, when a text box was full and a strange picture appeared
(again) on the left, I said Why not? and voilà! this works here too,
and the picture turned out to be a scroll bar.

Yes, for you this could be a silly question, but for a newbie like me is
not.  IMHO, those things must be in the man pages.

Regards,
trebol.