9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Mark van Atten <vanattenmark@gmail.com>
To: 9fans@9fans.net
Subject: Re: [9fans] documentation suggestion
Date: Mon,  8 Apr 2013 08:56:18 +0000	[thread overview]
Message-ID: <48159f25-cdab-41b8-9399-43772cd1bd4e@googlegroups.com> (raw)
In-Reply-To: <CAM6ozu5EL6J4q7ks5NoAus5nTazNvo6Uw3PsbU=ahNzEfETYog@mail.gmail.com>

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



      parent reply	other threads:[~2013-04-08  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01  1:45 trebol
2013-04-01  6:08 ` Peter A. Cejchan
2013-04-01  7:11   ` trebol
2013-04-01  8:24     ` Peter A. Cejchan
2013-04-01 10:51       ` Rudolf Sykora
2013-04-01 12:01       ` Bence Fábián
2013-04-02  6:34         ` Peter A. Cejchan
2013-04-03 13:11         ` aram
2013-04-03 13:42           ` Bence Fábián
2013-04-04  8:49   ` Mark van Atten
2013-04-04 15:24     ` Rudolf Sykora
2013-04-04 15:46       ` erik quanstrom
2013-04-04 16:03         ` Rudolf Sykora
2013-04-04 16:05   ` Mark van Atten
2013-04-04 16:28     ` Rudolf Sykora
2013-04-04 16:47       ` a
2013-04-05  9:05   ` Mark van Atten
2013-04-05  9:05   ` Mark van Atten
2013-04-05  9:32   ` Mark van Atten
2013-04-05 12:47   ` Mark van Atten
2013-04-08  8:56   ` Mark van Atten [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48159f25-cdab-41b8-9399-43772cd1bd4e@googlegroups.com \
    --to=vanattenmark@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).