changeset 48:40caeb9e9b25

switched to new header macro; cleaned up CW
author meillo@marmaro.de
date Mon, 12 Apr 2010 14:45:29 +0200
parents b6ae4a8ab1d3
children 2f188a5dc0dc
files unix-phil.ms
diffstat 1 files changed, 59 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/unix-phil.ms	Mon Apr 12 14:11:39 2010 +0200
+++ b/unix-phil.ms	Mon Apr 12 14:45:29 2010 +0200
@@ -1,27 +1,46 @@
 .nr PS 11
 .nr VS 13
-.nr lu 0
 
 .de CW
 .nr PQ \\n(.f
-.if t .ft CW
-.ie ^\\$1^^ .if n .ul 999
-.el .if n .ul 1
-.if t .if !^\\$1^^ \&\\$1\f\\n(PQ\\$2
-.if n .if \\n(.$=1 \&\\$1
-.if n .if \\n(.$>1 \&\\$1\c
-.if n .if \\n(.$>1 \&\\$2
+.if t \{\
+.	ft CW
+.	if !^\\$1^^ \&\\$1\f\\n(PQ\\$2
+.\}
+.if n \{\
+.	ie ^\\$1^^ .ul 999
+.	el .ul 1
+.	if \\n(.$=1 \&\\$1
+.	if \\n(.$>1 \&\\$1\c
+.	if \\n(.$>1 \&\\$2
+.\}
 ..
 
 .ds [. \ [
 .ds .] ]
 
-.rn NH _N
-.de NH
-.if '\\$1'1' .sp 2v
-.if '\\$1'1' .nr PS +2
-._N \\$1
-.if '\\$1'1' .nr PS -2
+.de H
+.if '\\$1'1' \{\
+.	sp 2v
+.	nr PS +2
+.	NH \\$1
+\\$2
+.	nr PS -2
+.	LP
+.	XS
+.	sp .5v
+.	B
+\\*(SN \\$2
+.	XE
+.\}
+.if '\\$1'2' \{\
+.	NH \\$1
+\\$2
+.	LP
+.	XS
+	\\*(SN \\$2
+.	XE
+.\}
 ..
 
 .am QP
@@ -58,13 +77,7 @@
 .CW \s-1http://marmaro.de/docs \ .
 .FE
 
-.NH 1
-Introduction
-.XS
-.sp .5v
-.B
-\*(SN Introduction
-.XE
+.H 1 Introduction
 .LP
 The Unix Philosophy is the essence of how the Unix operating system,
 especially its toolchest, was designed.
@@ -135,13 +148,7 @@
 is a good book that covers this topic.
 Its point of view matches to the one of this paper.
 
-.NH 1
-Importance of software design in general
-.XS
-.sp .5v
-.B
-\*(SN Importance of software design in general
-.XE
+.H 1 "Importance of software design in general
 .LP
 Software design is the planning of how the internal structure
 and external interfaces of a software should look like.
@@ -251,23 +258,13 @@
 It offers guidelines to achieve good quality and high gain for the effort spent.
 
 
-.NH 1
-The Unix Philosophy
-.XS
-.sp .5v
-.B
-\*(SN The Unix Philosophy
-.XE
+.H 1 "The Unix Philosophy
 .LP
 The origins of the Unix Philosophy were already introduced.
 This chapter explains the philosophy, oriented on Gancarz,
 and shows concrete examples of its application.
 
-.NH 2
-Pipes
-.XS
-	\*(SN Pipes
-.XE
+.H 2 Pipes
 .LP
 Following are some examples to demonstrate how applied Unix Philosophy feels like.
 Knowledge of using the Unix shell is assumed.
@@ -333,11 +330,7 @@
 The other is the design of the programs that are used in the pipeline.
 They need interfaces that allow them to be used in such a way.
 
-.NH 2
-Interface design
-.XS
-	\*(SN Interface design
-.XE
+.H 2 "Interface design
 .LP
 Unix is, first of all, simple \(en Everything is a file.
 Files are sequences of bytes, without any special structure.
@@ -385,11 +378,7 @@
 Testing of interactive programs is much more complicated,
 than testing of non-interactive programs.
 
-.NH 2
-The toolchest approach
-.XS
-	\*(SN The toolchest approach
-.XE
+.H 2 "The toolchest approach
 .LP
 A toolchest is a set of tools.
 Instead of having one big tool for all tasks, one has many small tools,
@@ -466,11 +455,7 @@
 they will still relay on the external programs,
 which do the actual work.
 
-.NH 2
-A powerful shell
-.XS
-	\*(SN A powerful shell
-.XE
+.H 2 "A powerful shell
 .LP
 The Unix shell provides the possibility to combine small programs into large ones.
 But a powerful shell is a great feature in other ways, too.
@@ -531,11 +516,7 @@
 changing requirements.
 Software parts that are not written will not miss the requirements.
 
-.NH 2
-Worse is better
-.XS
-	\*(SN Worse is better
-.XE
+.H 2 "Worse is better
 .LP
 The Unix Philosophy aims for the 90% solution;
 others call it the ``Worse is better'' approach.
@@ -584,11 +565,7 @@
 then less effort was spent into the project, than it would have be
 when a different approach had been used.
 
-.NH 2
-Upgrowth and survival of software
-.XS
-	\*(SN Upgrowth and survival of software
-.XE
+.H 2 "Upgrowth and survival of software
 .LP
 So far it was talked about \fIwriting\fP or \fIbuilding\fP software.
 Although these are just verbs, they do imply a specific view on the work process
@@ -688,11 +665,7 @@
 Who cares if the large program is a failure,
 but parts of it become successful instead?
 
-.NH 2
-Summary
-.XS
-	\*(SN Summary
-.XE
+.H 2 "Summary
 .LP
 This chapter explained central ideas of the Unix Philosophy.
 For each of the ideas, the advantages they introduce were explained.
@@ -710,13 +683,7 @@
 
 
 
-.NH 1
-Case study: \s-1MH\s0
-.XS
-.sp .5v
-.B
-\*(SN Case study: \s-1MH\s0
-.XE
+.H 1 "Case study: \s-1MH\s0
 .LP
 The previous chapter introduced and explained the Unix Philosophy
 from a general point of view.
@@ -738,11 +705,7 @@
 \s-1MH\s0 and nmh are described.
 
 
-.NH 2
-Historical background
-.XS
-	\*(SN Historical background
-.XE
+.H 2 "Historical background
 .LP
 Electronic mail was available in Unix very early.
 The first \s-1MUA\s0 on Unix was \f(CWmail\fP,
@@ -805,11 +768,7 @@
 mh
 .]
 
-.NH 2
-Contrasts to monolithic mail systems
-.XS
-	\*(SN Contrasts to monolithic mail systems
-.XE
+.H 2 "Contrasts to monolithic mail systems
 .LP
 All \s-1MUA\s0s are monolithic, except \s-1MH\s0.
 Although there might actually exist further, very little known,
@@ -863,11 +822,7 @@
 alone or in combination with others, also from other toolchests,
 without leaving the shell.
 
-.NH 2
-Data storage
-.XS
-	\*(SN Data storage
-.XE
+.H 2 "Data storage
 .LP
 \s-1MH\s0's mail storage is a directory tree under the user's
 \s-1MH\s0 directory (usually \f(CW$HOME/Mail\fP),
@@ -928,11 +883,7 @@
 man page mh-profile mh-sequence
 .]
 
-.NH 2
-Discussion of the design
-.XS
-	\*(SN Discussion of the design
-.XE
+.H 2 "Discussion of the design
 .LP
 This section discusses \s-1MH\s0 in regard to the tenets
 of the Unix Philosophy that Gancarz identified.
@@ -1115,11 +1066,7 @@
 With these three, I was able to convince people that the structure was viable.
 This took about three weeks.
 
-.NH 2
-Problems
-.XS
-	\*(SN Problems
-.XE
+.H 2 "Problems
 .LP
 \s-1MH\s0 is not without problems.
 There are two main problems: one is technical, the other is about human behavior.
@@ -1149,11 +1096,7 @@
 are quite outdated and thus not very appealing, compared to the modern interfaces
 of many monolithic \s-1MUA\s0s.
 
-.NH 2
-Summary \s-1MH\s0
-.XS
-	\*(SN Summary \s-1MH\s0
-.XE
+NH 2 "Summary \s-1MH\s0
 .LP
 \s-1MH\s0 is an \s-1MUA\s0 that follows the Unix Philosophy in its design.
 It consists of a toolchest of small tools, each of them does one job well.
@@ -1176,13 +1119,7 @@
 
 
 
-.NH 1
-Case study: uzbl
-.XS
-.sp .5v
-.B
-\*(SN Case study: uzbl
-.XE
+.H 1 "Case study: uzbl
 .LP
 The last chapter took a look on the \s-1MUA\s0 \s-1MH\s0,
 which is an old and established software.
@@ -1191,11 +1128,7 @@
 Its name comes from the \fILolspeak\fP word for ``usable'';
 it is pronounced identical.
 
-.NH 2
-Historical background
-.XS
-	\*(SN Historical background
-.XE
+.H 2 "Historical background
 .LP
 Uzbl was started by Dieter Plaetinck in April 2009.
 The idea was born in a thread in the Arch Linux Forums.
@@ -1243,11 +1176,7 @@
 slashdot uzbl
 .]
 
-.NH 2
-Contrasts to other web browsers
-.XS
-	\*(SN Contrasts to other web browsers
-.XE
+.H 2 "Contrasts to other web browsers
 .LP
 Like most \s-1MUA\s0s are monolithic, but \s-1MH\s0 is a toolchest,
 most web browsers are monolithic, but uzbl is a frontend to a toolchest.
@@ -1287,11 +1216,7 @@
 But instead of using existing, external programs, modern web browsers
 include these functions.
 
-.NH 2
-Discussion of the design
-.XS
-	\*(SN Discussion of the design
-.XE
+.H 2 "Discussion of the design
 .LP
 This section discusses uzbl in regard of the Unix Philosophy,
 as identified by Gancarz.
@@ -1458,11 +1383,7 @@
 .]
 
 
-.NH 2
-Problems
-.XS
-	\*(SN Problems
-.XE
+.H 2 "Problems
 .LP
 Similar to \s-1MH\s0, uzbl, too suffers from being different.
 It is sad, but people use what they know.
@@ -1489,11 +1410,7 @@
 Now web browsers, and eventually the users, suffer from it.
 
 
-.NH 2
-Summary uzbl
-.XS
-	\*(SN Summary uzbl
-.XE
+.H 2 "Summary uzbl
 .LP
 ``Uzbl is a browser that adheres to the Unix Philosophy'',
 that is how uzbl is seen by its authors.
@@ -1517,19 +1434,9 @@
 Despite this bad situation, uzbl does a fairly good job.
 
 
-.NH 1
-Final thoughts
-.XS
-.sp .5v
-.B
-\*(SN Final thoughts
-.XE
+.H 1 "Final thoughts
 
-.NH 2
-Quick summary
-.XS
-	\*(SN Quick summary
-.XE
+.H 2 "Quick summary
 .LP
 good design
 .LP
@@ -1537,11 +1444,7 @@
 .LP
 case studies
 
-.NH 2
-Why people should choose
-.XS
-	\*(SN Why people should choose
-.XE
+.H 2 "Why people should choose
 .LP
 Make the right choice!