Fix some extra spacing in screen entries.

While there, replace some with programlisting when more suited.

Sponsored by:	Absolight
This commit is contained in:
Mathieu Arnold 2017-09-07 11:56:16 +00:00
parent 36ed4c972f
commit e1a974cfd5
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=50805
7 changed files with 59 additions and 99 deletions

View file

@ -440,8 +440,7 @@
<informalexample>
<screen>&prompt.user; <userinput>cc foobar.c</userinput> <lineannotation>executable is a.out</lineannotation>
&prompt.user; <userinput>cc -o foobar foobar.c</userinput> <lineannotation>executable is foobar</lineannotation>
</screen>
&prompt.user; <userinput>cc -o foobar foobar.c</userinput> <lineannotation>executable is foobar</lineannotation></screen>
</informalexample>
</listitem>
</varlistentry>
@ -455,8 +454,7 @@
you are using a <filename>Makefile</filename>.</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -c foobar.c</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -c foobar.c</userinput></screen>
</informalexample>
<para>This will produce an <firstterm>object file</firstterm> (not an
@ -483,8 +481,7 @@
satisfied it works properly.</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -g foobar.c</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -g foobar.c</userinput></screen>
</informalexample>
<para>This will produce a debug version of the
@ -513,8 +510,7 @@
compiler's optimizer.</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -O -o foobar foobar.c</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -O -o foobar foobar.c</userinput></screen>
</informalexample>
<para>This will produce an optimized version of
@ -610,8 +606,7 @@
line.</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput></screen>
</informalexample>
<para>This will link the math library functions into
@ -643,8 +638,7 @@
like this. What does it mean?</para>
<informalexample>
<screen>/var/tmp/cc0143941.o: Undefined symbol `_sin' referenced from text segment
</screen>
<screen>/var/tmp/cc0143941.o: Undefined symbol `_sin' referenced from text segment</screen>
</informalexample>
</question>
@ -655,8 +649,7 @@
so:</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c -lm</userinput></screen>
</informalexample>
</answer>
</qandaentry>
@ -683,8 +676,7 @@ int main() {
<para>and I compiled it as:</para>
<informalexample>
<screen>&prompt.user; <userinput>cc temp.c -lm</userinput>
</screen>
<screen>&prompt.user; <userinput>cc temp.c -lm</userinput></screen>
</informalexample>
<para>like you said I should, but I get this when I run
@ -692,8 +684,7 @@ int main() {
<informalexample>
<screen>&prompt.user; <userinput>./a.out</userinput>
2.1 ^ 6 = 1023.000000
</screen>
2.1 ^ 6 = 1023.000000</screen>
</informalexample>
<para>This is <emphasis>not</emphasis> the right answer!
@ -735,8 +726,7 @@ int main() {
<informalexample>
<screen>&prompt.user; <userinput>./a.out</userinput>
2.1 ^ 6 = 85.766121
</screen>
2.1 ^ 6 = 85.766121</screen>
</informalexample>
<para>If you are using any of the mathematical functions,
@ -762,8 +752,7 @@ int main() {
option:</para>
<informalexample>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c</userinput>
</screen>
<screen>&prompt.user; <userinput>cc -o foobar foobar.c</userinput></screen>
</informalexample>
</answer>
</qandaentry>
@ -803,8 +792,7 @@ int main() {
checking the current directory. Either type:</para>
<informalexample>
<screen>&prompt.user; <userinput>./test</userinput>
</screen>
<screen>&prompt.user; <userinput>./test</userinput></screen>
</informalexample>
<para>or choose a better name for your program!</para>
@ -960,14 +948,12 @@ free(foo);
<answer>
<para>Yes, just go to another console or xterm, do</para>
<screen>&prompt.user; <userinput>ps</userinput>
</screen>
<screen>&prompt.user; <userinput>ps</userinput></screen>
<para>to find out the process ID of your program, and
do</para>
<screen>&prompt.user; <userinput>kill -ABRT <replaceable>pid</replaceable></userinput>
</screen>
<screen>&prompt.user; <userinput>kill -ABRT <replaceable>pid</replaceable></userinput></screen>
<para>where
<parameter><replaceable>pid</replaceable></parameter> is
@ -1589,7 +1575,7 @@ Cannot access memory at address 0x7020796d.
not, gentle reader, here is how to do it (courtesy of the
<command>gdb</command> info pages):</para>
<screen><lineannotation>&hellip;</lineannotation>
<programlisting><lineannotation>&hellip;</lineannotation>
if ((pid = fork()) &lt; 0) /* _Always_ check this */
error();
else if (pid == 0) { /* child */
@ -1599,7 +1585,7 @@ else if (pid == 0) { /* child */
sleep(10); /* Wait until someone attaches to us */
<lineannotation>&hellip;</lineannotation>
} else { /* parent */
<lineannotation>&hellip;</lineannotation></screen>
<lineannotation>&hellip;</lineannotation></programlisting>
<para>Now all you have to do is attach to the child, set
<symbol>PauseMode</symbol> to <literal>0</literal>, and wait
@ -1821,8 +1807,7 @@ else if (pid == 0) { /* child */
if you are doing something outside Emacs and you want to
edit a file, you can just type in</para>
<screen>&prompt.user; <userinput>emacsclient <replaceable>filename</replaceable></userinput>
</screen>
<screen>&prompt.user; <userinput>emacsclient <replaceable>filename</replaceable></userinput></screen>
<para>and then you can edit the file in your
Emacs!