Discussion:
[9fans] documentation suggestion
(too old to reply)
trebol
2013-04-01 01:45:33 UTC
Permalink
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.
Peter A. Cejchan
2013-04-01 06:08:18 UTC
Permalink
to save my time, could you, please, share that trick? Thanks,

++pac
Post by 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.
trebol
2013-04-01 07:11:20 UTC
Permalink
Post by Peter A. Cejchan
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.
Peter A. Cejchan
2013-04-01 08:24:11 UTC
Permalink
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
Post by trebol
Post by Peter A. Cejchan
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.
Rudolf Sykora
2013-04-01 10:51:00 UTC
Permalink
Hello,
Post by 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 :((( ]
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
Bence Fábián
2013-04-01 12:01:51 UTC
Permalink
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.
Post by 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
Peter A. Cejchan
2013-04-02 06:34:49 UTC
Permalink
Wow! That's it! I always wanted a 'command window', now I see why it is
needless. Thanks!
Post by 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.
however, in native Plan9, scrolling goes too fast for multi-line tagline
Post by Peter A. Cejchan
:-)
[yes, I know that I should keep commands short, but, e.g., Edit requires
newline between commands :((( ]
++pac
aram
2013-04-03 13:11:13 UTC
Permalink
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.
Post by 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.
however, in native Plan9, scrolling goes too fast for multi-line tagline
Post by Peter A. Cejchan
:-)
[yes, I know that I should keep commands short, but, e.g., Edit requires
newline between commands :((( ]
++pac
--
http://thewayofthecode.posterous.com/
Bence Fábián
2013-04-03 13:42:24 UTC
Permalink
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.
Post by 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.
Mark van Atten
2013-04-04 08:49:13 UTC
Permalink
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.
Rudolf Sykora
2013-04-04 15:24:47 UTC
Permalink
Post by 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?
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
erik quanstrom
2013-04-04 15:46:47 UTC
Permalink
Post by Rudolf Sykora
Post by 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?
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
Rudolf Sykora
2013-04-04 16:03:53 UTC
Permalink
Post by erik quanstrom
Post by Rudolf Sykora
Post by 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?
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
Mark van Atten
2013-04-04 16:05:28 UTC
Permalink
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.
Rudolf Sykora
2013-04-04 16:28:36 UTC
Permalink
Post by 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.
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
a***@9srv.net
2013-04-04 16:47:12 UTC
Permalink
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
Mark van Atten
2013-04-05 09:05:47 UTC
Permalink
Post by a***@9srv.net
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.
Mark van Atten
2013-04-05 09:05:56 UTC
Permalink
Post by a***@9srv.net
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.
Mark van Atten
2013-04-05 09:32:29 UTC
Permalink
Subject: Re: [9fans] documentation suggestion
Post by Mark van Atten
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.
Mark van Atten
2013-04-05 12:47:36 UTC
Permalink
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.
Mark van Atten
2013-04-08 08:56:18 UTC
Permalink
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.h Sat Jan 19 10:05:12 2013 +0100
+++ b/src/cmd/acme/dat.h Fri Apr 05 22:52:55 2013 +0200
@@ -548,6 +548,7 @@
int globalautoindent;
int dodollarsigns;
char* mtpt;
+int neverexpandtag;

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

Loading...