Browse Source

Plan 9 from Bell Labs 2010-12-03

David du Colombier 13 years ago
parent
commit
eb13e36f4b
3 changed files with 45 additions and 24 deletions
  1. 3 2
      sys/lib/newuser
  2. 34 19
      sys/man/4/upasfs
  3. 8 3
      sys/man/6/style

+ 3 - 2
sys/lib/newuser

@@ -24,7 +24,7 @@ font = /lib/font/bit/pelm/euro.9.font
 switch($x^service){
 case terminal
 	plumber
-	upas/fs
+	startupasfs
 	echo -n accelerated > '#m/mousectl'
 	echo -n 'res 3' > '#m/mousectl'
 	prompt=('term% ' '	')
@@ -42,7 +42,7 @@ case cpu
 	bind -a /mnt/term/dev /dev
 	prompt=('cpu% ' '	')
 	fn cpu%{ $x^* }
-	upas/fs
+	startupasfs
 	news
 	if (! test -e /mnt/term/mnt/wsys) {
 		# cpu call from drawterm
@@ -53,6 +53,7 @@ case cpu
 	}
 case con
 	prompt=('cpu% ' '	')
+	startupasfs
 	news
 }
 !

+ 34 - 19
sys/man/4/upasfs

@@ -1,22 +1,20 @@
 .TH UPASFS 4
 .SH NAME
-upasfs \- mail file server
+upasfs, startupasfs \- mail file server
 .SH SYNOPSIS
 .B upas/fs
 [
 .B -f
 .I mailbox
-][
-.B -bnp
-][
-.B -s
-.I srvname
-][
+] [
+.B -bnps
+] [
 .B -m
 .I mntpoint
 ]
-.SH DESCRIPTION
 .PP
+.B startupasfs
+.SH DESCRIPTION
 .I Fs
 is a user level file system that reads mailboxes and presents them as a file
 system.
@@ -41,6 +39,16 @@ and
 .IR faces (1)
 to provide mail announcements.
 .PP
+.I Startupasfs
+is a shell script suitable for use in one's profile.
+It runs
+.B "fs -s"
+for the invoking user if none is already running,
+and always mounts the user's posted
+.I fs
+on
+.BR /mail/fs .
+.PP
 The mailbox itself becomes a directory under
 .BR /mail/fs .
 Each message in the mailbox becomes a numbered directory in the
@@ -117,11 +125,13 @@ the envelope header from the mailbox
 The
 .B info
 file contains the following information, one item per line.  Lists
-of addresses are single space separated.
-.IP
+of addresses are single-space separated.
+.LP
+.2C
+.PD 0
+.LP
 .TP 2i
 .I "sender address
-.PD 0
 .TP
 .I "recipient addresses
 .TP
@@ -152,6 +162,8 @@ of addresses are single space separated.
 .I "message id
 .TP
 .I "number of lines in body
+.LP
+.1C
 .PD
 .PP
 Deleting message directories causes the message to be removed from
@@ -190,7 +202,7 @@ Delete the messages with the given numbers from
 .PD
 .PP
 The options are:
-.TF "-f file
+.TF "-f\fI file
 .TP
 .BI -f file
 use
@@ -218,21 +230,21 @@ from source
 .B mailfs
 for each message received or deleted.
 The message contains the attributes
-.IR sender = "<contents of from file>" ,
-.IR filetype =mail,
-.IR mailtype = "deleted or new" ,
+.BI sender= "<contents of " from " file>,"
+.BR filetype=mail ,
+.BR "mailtype=deleted\fI or \fPnew" ,
 and
-.IR length = "<message length in bytes>" .
+.BI length= "<message length in bytes>."
 The contents of the message is the full path
 name of the directory representing the message.
 .TP
 .B -s
 causes
 .I fs
-to put itself in
+to post itself in
 .B /srv
 with a name of the form
-.BR /srv/upasfs.\fIuser\fP .
+.BI /srv/upasfs. user.
 .TP
 .B -m
 specifies a mount point other than
@@ -319,9 +331,12 @@ mutual exclusion lock for multiple mbox readers
 .TP
 .B /mail/box/*/L.mbox
 mutual exclusion lock for altering mbox
+.br
+.ne 3
 .SH SOURCE
-.TP
 .B /sys/src/cmd/upas/fs
+.br
+.B /rc/bin/startupasfs
 .SH "SEE ALSO"
 .IR aliasmail (8),
 .IR faces (1),

+ 8 - 3
sys/man/6/style

@@ -22,6 +22,9 @@ surround a binary operator (particular a low precedence one) with spaces;
 don't try to write the most compact code possible
 but rather the most readable.
 .IP •
+parenthesize expressions involving arithmetic and bit-wise operators;
+otherwise don't parenthesize heavily (e.g., as in Pascal).
+.IP •
 no white space before opening braces.
 .IP •
 no white space after the keywords
@@ -66,9 +69,11 @@ don't write
 .L !strcmp
 (nor
 .LR !memcmp ,
-etc.);
-always explicitly compare the result of string comparison with zero using
-a relational operator.
+etc.)
+nor
+.LR "if(memcmp(a, b, c))" ;
+always explicitly compare the result of string or memory
+comparison with zero using a relational operator.
 .PP
 Ultimately, the goal is to write code that fits in with the other code
 around it and the system as a whole.  If the file you are editing