Browse Source

Plan 9 from Bell Labs 2006-01-30

David du Colombier 18 years ago
parent
commit
d7878eb43e

+ 7 - 7
dist/replica/_plan9.db

@@ -5444,7 +5444,7 @@ rc/bin/leak - 775 sys sys 1032057948 1005
 rc/bin/lookman - 775 sys sys 1017679344 686
 rc/bin/lp - 775 sys sys 962679927 5357
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1040698721 2088
+rc/bin/man - 775 sys sys 1138555265 2520
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -5742,7 +5742,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000664 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000664 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1138129633 257147
+sys/games/lib/fortunes - 664 sys sys 1138566736 257323
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6608,7 +6608,7 @@ sys/lib/man/trademarks - 664 sys sys 958527089 1838
 sys/lib/mimetype - 664 sys sys 1120564829 6236
 sys/lib/newuser - 775 sys sys 1112362340 1226
 sys/lib/plumb - 20000000775 sys sys 944957365 0
-sys/lib/plumb/basic - 664 sys sys 1118196423 2946
+sys/lib/plumb/basic - 664 sys sys 1138555264 2877
 sys/lib/plumb/fileaddr - 664 sys sys 944957365 88
 sys/lib/postscript - 20000000775 sys sys 950322802 0
 sys/lib/postscript/afm - 20000000775 sys sys 950322802 0
@@ -7313,7 +7313,7 @@ sys/man/1/look - 664 sys sys 1113743326 1357
 sys/man/1/lp - 664 sys sys 1113743326 3329
 sys/man/1/ls - 664 sys sys 1113743327 2890
 sys/man/1/mail - 664 sys sys 1050078464 2158
-sys/man/1/man - 664 sys sys 1113743328 1736
+sys/man/1/man - 664 sys sys 1138555093 2006
 sys/man/1/marshal - 664 sys sys 1079970326 3150
 sys/man/1/mc - 664 sys sys 1113743326 552
 sys/man/1/mk - 664 sys sys 1113743328 13198
@@ -12505,9 +12505,9 @@ sys/src/cmd/lex/header.c - 664 sys sys 1032060383 3368
 sys/src/cmd/lex/ldefs.h - 664 sys sys 1135487942 4101
 sys/src/cmd/lex/lmain.c - 664 sys sys 1135921540 6076
 sys/src/cmd/lex/mkfile - 664 sys sys 1032060382 328
-sys/src/cmd/lex/ncform - 664 sys sys 944961017 4060
+sys/src/cmd/lex/ncform - 664 sys sys 1138551483 4074
 sys/src/cmd/lex/parser.y - 664 sys sys 1136219175 14263
-sys/src/cmd/lex/sub1.c - 664 sys sys 1135921541 10121
+sys/src/cmd/lex/sub1.c - 664 sys sys 1138551488 10162
 sys/src/cmd/lex/sub2.c - 664 sys sys 1135921541 17089
 sys/src/cmd/lnfs.c - 664 sys sys 1094156765 13332
 sys/src/cmd/look.c - 664 sys sys 944961619 5994
@@ -13314,7 +13314,7 @@ sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987
 sys/src/cmd/tbl/t0.c - 664 sys sys 944961244 1009
-sys/src/cmd/tbl/t1.c - 664 sys sys 1114967760 1604
+sys/src/cmd/tbl/t1.c - 664 sys sys 1138551479 1554
 sys/src/cmd/tbl/t2.c - 664 sys sys 944961244 298
 sys/src/cmd/tbl/t3.c - 664 sys sys 944961244 1836
 sys/src/cmd/tbl/t4.c - 664 sys sys 944961244 8360

+ 7 - 7
dist/replica/plan9.db

@@ -5444,7 +5444,7 @@ rc/bin/leak - 775 sys sys 1032057948 1005
 rc/bin/lookman - 775 sys sys 1017679344 686
 rc/bin/lp - 775 sys sys 962679927 5357
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1040698721 2088
+rc/bin/man - 775 sys sys 1138555265 2520
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -5742,7 +5742,7 @@ sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
 sys/games/lib/4scores - 10000000664 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000664 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1138129633 257147
+sys/games/lib/fortunes - 664 sys sys 1138566736 257323
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6608,7 +6608,7 @@ sys/lib/man/trademarks - 664 sys sys 958527089 1838
 sys/lib/mimetype - 664 sys sys 1120564829 6236
 sys/lib/newuser - 775 sys sys 1112362340 1226
 sys/lib/plumb - 20000000775 sys sys 944957365 0
-sys/lib/plumb/basic - 664 sys sys 1118196423 2946
+sys/lib/plumb/basic - 664 sys sys 1138555264 2877
 sys/lib/plumb/fileaddr - 664 sys sys 944957365 88
 sys/lib/postscript - 20000000775 sys sys 950322802 0
 sys/lib/postscript/afm - 20000000775 sys sys 950322802 0
@@ -7313,7 +7313,7 @@ sys/man/1/look - 664 sys sys 1113743326 1357
 sys/man/1/lp - 664 sys sys 1113743326 3329
 sys/man/1/ls - 664 sys sys 1113743327 2890
 sys/man/1/mail - 664 sys sys 1050078464 2158
-sys/man/1/man - 664 sys sys 1113743328 1736
+sys/man/1/man - 664 sys sys 1138555093 2006
 sys/man/1/marshal - 664 sys sys 1079970326 3150
 sys/man/1/mc - 664 sys sys 1113743326 552
 sys/man/1/mk - 664 sys sys 1113743328 13198
@@ -12505,9 +12505,9 @@ sys/src/cmd/lex/header.c - 664 sys sys 1032060383 3368
 sys/src/cmd/lex/ldefs.h - 664 sys sys 1135487942 4101
 sys/src/cmd/lex/lmain.c - 664 sys sys 1135921540 6076
 sys/src/cmd/lex/mkfile - 664 sys sys 1032060382 328
-sys/src/cmd/lex/ncform - 664 sys sys 944961017 4060
+sys/src/cmd/lex/ncform - 664 sys sys 1138551483 4074
 sys/src/cmd/lex/parser.y - 664 sys sys 1136219175 14263
-sys/src/cmd/lex/sub1.c - 664 sys sys 1135921541 10121
+sys/src/cmd/lex/sub1.c - 664 sys sys 1138551488 10162
 sys/src/cmd/lex/sub2.c - 664 sys sys 1135921541 17089
 sys/src/cmd/lnfs.c - 664 sys sys 1094156765 13332
 sys/src/cmd/look.c - 664 sys sys 944961619 5994
@@ -13314,7 +13314,7 @@ sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987
 sys/src/cmd/tbl/t0.c - 664 sys sys 944961244 1009
-sys/src/cmd/tbl/t1.c - 664 sys sys 1114967760 1604
+sys/src/cmd/tbl/t1.c - 664 sys sys 1138551479 1554
 sys/src/cmd/tbl/t2.c - 664 sys sys 944961244 298
 sys/src/cmd/tbl/t3.c - 664 sys sys 944961244 1836
 sys/src/cmd/tbl/t4.c - 664 sys sys 944961244 8360

+ 7 - 0
dist/replica/plan9.log

@@ -27504,3 +27504,10 @@
 1138501903 71 c acme/bin/386/win - 775 sys sys 1138500797 185035
 1138501903 72 c sys/src/9/bitsy/dat.h - 664 sys sys 1138500731 5941
 1138501903 73 c sys/src/9/bitsy/devflash.c - 664 sys sys 1138500612 16830
+1138552316 0 c sys/src/cmd/lex/ncform - 664 sys sys 1138551483 4074
+1138552316 1 c sys/src/cmd/lex/sub1.c - 664 sys sys 1138551488 10162
+1138552316 2 c sys/src/cmd/tbl/t1.c - 664 sys sys 1138551479 1554
+1138555917 0 c rc/bin/man - 775 sys sys 1138555265 2520
+1138555917 1 c sys/lib/plumb/basic - 664 sys sys 1138555264 2877
+1138555917 2 c sys/man/1/man - 664 sys sys 1138555093 2006
+1138566722 0 c sys/games/lib/fortunes - 664 sys sys 1138566736 257323

+ 23 - 3
rc/bin/man

@@ -48,9 +48,10 @@ fn page {
 }
 
 
+search=yes
 while(~ $d 0) {
 	if(~ $#* 0) {
-		echo 'Usage: man [-ntp] [-s sec] [0-9] [0-9] ... name1 name2 ...' >[1=2]
+		echo 'Usage: man [-bntpPSw] [0-9] [0-9] ... name1 name2 ...' >[1=2]
 		exit
 	}
 	if(test -d $S/$1){
@@ -62,6 +63,9 @@ while(~ $d 0) {
 		case -n ; cmd=n ; shift
 		case -p ; cmd=p ; shift
 		case -P ; cmd=P ; shift
+		case -w ; cmd=w ; shift
+		case -b ; cmd=b ; shift
+		case -S ; search=no ; shift
 		case * ; d=1
 	}
 }
@@ -72,9 +76,10 @@ ix=$S/$sec/INDEX
 if(~ $#* 1) pat='^'^$1^' '
 if not pat='^('^`{echo $* | sed 's/ /|/g'}^') '
 fils=()
+if(~ $search yes)
 for(i in $S/$sec){
 	if(/bin/test -f $i/INDEX){
-		try=`{grep $pat $i/INDEX | sed 's/^[^ ]* //'}
+		try=`{grep -i $pat $i/INDEX | sed 's/^[^ ]* //'}
 		if(! ~ $#try 0)
 			fils=($fils $i/$try)
 	}
@@ -83,8 +88,9 @@ for(i in $S/$sec){
 if(~ $#fils 0) {
 	# nothing in INDEX. try for file of given name
 	for(i) {
+		if(~ $i intro) i=0intro
 		for(n in $sec) {
-			try=$S/$n/$i
+			try=`{echo $S/$n/$i | tr A-Z a-z}
 			if (/bin/test -f $try)
 				fils=($fils $try)
 		}
@@ -99,6 +105,9 @@ for(i in $fils) {
 		echo need $i >[1=2]
 	if not {
 		switch($cmd) {
+		case w
+			echo $i
+
 		case t
 			roff t $i
 
@@ -115,6 +124,17 @@ for(i in $fils) {
 				}
 				//N
 				/^\n$/D'
+
+		case b
+			x=`{echo $i | sed 's;/sys/man/(.*)/(.*);\1 \2;'}
+			if(~ $x(2) 0intro) x=($x(1) intro)
+			roff n $i | sed '
+				${
+        			       /^$/p
+				}
+				//N
+				/^\n$/D' |
+			plumb -i -d edit -a 'action=showdata filename=/man/'$x(2)^'('$x(1)^')'
 		}
 	}
 }

+ 1 - 0
sys/games/lib/fortunes

@@ -4101,3 +4101,4 @@ Google does not appear to be in the kludge-making business ...  - Ashlee Vance,
 		  ** the "time" argument is mandatory! (try "now") **
 Revision control is like any other form of accountancy -- worthy but dull. -forsyth
 There are but 10 types of people in the world. Those who understand the binary numbering system and those who don't.
+we live in a world of dogmas, probably trying to fight it with a stronger dogma is a bad idea, but trying to fight it with preumpted objectivism clearly doesn't work.  - uriel

+ 1 - 1
sys/lib/plumb/basic

@@ -86,7 +86,7 @@ plumb	start	window -r 4 120 750 600 upas/nedmail -s $0
 # man index entries are synthesized
 type is text
 data matches '([a-zA-Z¡-￿0-9_\-./]+)\(([1-8])\)'
-plumb start rc -c 'man '$2' '$1' >[2=1] | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''
+plumb start rc -c 'man -S -b '$2' '$1'
 
 # start rule for images without known suffixes
 dst is image

+ 15 - 1
sys/man/1/man

@@ -4,7 +4,7 @@ man, lookman, sig \- print or find pages of this manual
 .SH SYNOPSIS
 .B man
 [
-.B -ntpP
+.B -bnpPStw
 ]
 [
 .I section ...
@@ -45,6 +45,13 @@ The options are:
 Print the pages on the standard output using
 .IR nroff .
 .TP
+.B -b
+Print the pages using
+.I nroff
+and send them to 
+.IR plumber (1)
+for display in the editor.
+.TP
 .B -p
 Run
 .IR proof (1)
@@ -55,11 +62,18 @@ Run
 .IR page (1)
 on the specified man pages.
 .TP
+.B -S
+Do not search the manual indices for the names.
+Only print pages whose file names match the names.
+.TP
 .B -t
 Run
 .IR troff (1)
 and send its output
 to standard output.
+.TP
+.B -w
+Print the names of the man page source files.
 .PD
 .PP
 .B Lookman

+ 2 - 2
sys/src/cmd/lex/ncform

@@ -9,7 +9,7 @@ int *yyfnd;
 extern struct yysvf *yyestate;
 int yyprevious = YYNEWLINE;
 # ifdef LEXDEBUG
-extern void allprint(char);
+extern void allprint(int);
 # endif
 yylook(void){
 	struct yysvf *yystate, **lsp;
@@ -113,7 +113,7 @@ yylook(void){
 			}
 # ifdef LEXDEBUG
 		if(debug){
-			fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
+			fprintf(yyout,"stopped at %d with ",lsp>yylstate?*(lsp-1)-yysvec-1:0);
 			allprint(yych);
 			putchar('\n');
 			}

+ 2 - 0
sys/src/cmd/lex/sub1.c

@@ -462,6 +462,8 @@ dupl(int n)
 void
 allprint(int c)
 {
+	if(c < 0)
+		c += 256;	/* signed char */
 	switch(c){
 		case 014:
 			print("\\f");

+ 1 - 4
sys/src/cmd/tbl/t1.c

@@ -43,10 +43,7 @@ setinp(int argc, char **argv)
 	sargv = argv;
 	sargc--; 
 	sargv++;
-	if (sargc > 0) {
-		if(swapin() == 0)
-			error("flags but no input files");
-	} else {
+	if (sargc == 0 || swapin() == 0) {
 		tabin = (Biobuf*)getcore(sizeof(Biobuf), 1);
 		Binit(tabin, 0, OREAD);
 	}