Update the .emacs example to display trailing whitespace (nice and red by
default). Americanize spelling while I'm at it: s/optimise/optimize/g && s/intepret/interpret/g PR: docs/48371 Approved by: ceri
This commit is contained in:
parent
c81c8f9f21
commit
563de07c7d
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=16037
1 changed files with 23 additions and 21 deletions
|
@ -253,11 +253,11 @@
|
||||||
<term>Python</term>
|
<term>Python</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Python is an Object-Oriented, intepreted language.
|
<para>Python is an Object-Oriented, interpreted language.
|
||||||
Its advocates argue that it is one of the best languages
|
Its advocates argue that it is one of the best languages
|
||||||
to start programming with, since it is relatively easy
|
to start programming with, since it is relatively easy
|
||||||
to start with, but is not limited in comparison to other
|
to start with, but is not limited in comparison to other
|
||||||
popular intepreted languages that are used for the
|
popular interpreted languages that are used for the
|
||||||
development of large, complex applications (Perl and
|
development of large, complex applications (Perl and
|
||||||
Tcl are two other languages that are popular for such tasks).</para>
|
Tcl are two other languages that are popular for such tasks).</para>
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@
|
||||||
<term>Tcl and Tk</term>
|
<term>Tcl and Tk</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Tcl is an embeddable, intepreted language, that has
|
<para>Tcl is an embeddable, interpreted language, that has
|
||||||
become widely used and became popular mostly because of its portability to many
|
become widely used and became popular mostly because of its portability to many
|
||||||
platforms. It can be used both for quickly writing
|
platforms. It can be used both for quickly writing
|
||||||
small, prototype applications, or (when combined with
|
small, prototype applications, or (when combined with
|
||||||
|
@ -309,7 +309,7 @@
|
||||||
interpreter, such as writing code which interacts closely with
|
interpreter, such as writing code which interacts closely with
|
||||||
the operating system—or even writing your own operating
|
the operating system—or even writing your own operating
|
||||||
system! It is also useful if you need to write very efficient
|
system! It is also useful if you need to write very efficient
|
||||||
code, as the compiler can take its time and optimise the code,
|
code, as the compiler can take its time and optimize the code,
|
||||||
which would not be acceptable in an interpreter. Moreover,
|
which would not be acceptable in an interpreter. Moreover,
|
||||||
distributing a program written for a compiler is usually more
|
distributing a program written for a compiler is usually more
|
||||||
straightforward than one written for an interpreter—you
|
straightforward than one written for an interpreter—you
|
||||||
|
@ -526,17 +526,17 @@
|
||||||
<term><option>-O</option></term>
|
<term><option>-O</option></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Create an optimised version of the executable. The
|
<para>Create an optimized version of the executable. The
|
||||||
compiler performs various clever tricks to try and produce
|
compiler performs various clever tricks to try and produce
|
||||||
an executable that runs faster than normal. You can add a
|
an executable that runs faster than normal. You can add a
|
||||||
number after the <option>-O</option> to specify a higher
|
number after the <option>-O</option> to specify a higher
|
||||||
level of optimisation, but this often exposes bugs in the
|
level of optimization, but this often exposes bugs in the
|
||||||
compiler's optimiser. For instance, the version of
|
compiler's optimizer. For instance, the version of
|
||||||
<command>cc</command> that comes with the 2.1.0 release of
|
<command>cc</command> that comes with the 2.1.0 release of
|
||||||
FreeBSD is known to produce bad code with the
|
FreeBSD is known to produce bad code with the
|
||||||
<option>-O2</option> option in some circumstances.</para>
|
<option>-O2</option> option in some circumstances.</para>
|
||||||
|
|
||||||
<para>Optimisation is usually only turned on when compiling
|
<para>Optimization is usually only turned on when compiling
|
||||||
a release version.</para>
|
a release version.</para>
|
||||||
|
|
||||||
<informalexample>
|
<informalexample>
|
||||||
|
@ -544,7 +544,7 @@
|
||||||
</screen>
|
</screen>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
|
||||||
<para>This will produce an optimised version of
|
<para>This will produce an optimized version of
|
||||||
<filename>foobar</filename>.</para>
|
<filename>foobar</filename>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -894,7 +894,7 @@ int main() {
|
||||||
</question>
|
</question>
|
||||||
|
|
||||||
<answer>
|
<answer>
|
||||||
<para>Use <command>gdb</command> to analyse the core (see
|
<para>Use <command>gdb</command> to analyze the core (see
|
||||||
<xref linkend="debugging">).</para>
|
<xref linkend="debugging">).</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
|
@ -925,7 +925,7 @@ strcpy(foo, "bang!");
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Using a pointer that has not been initialised,
|
<para>Using a pointer that has not been initialized,
|
||||||
eg</para>
|
eg</para>
|
||||||
|
|
||||||
<programlisting>char *foo;
|
<programlisting>char *foo;
|
||||||
|
@ -1430,7 +1430,7 @@ DISTFILES= scheme-microcode+dist-7.3-freebsd.tgz
|
||||||
collection.</para>
|
collection.</para>
|
||||||
|
|
||||||
<para>This section is intended to be an introduction to using
|
<para>This section is intended to be an introduction to using
|
||||||
<command>gdb</command> and does not cover specialised topics
|
<command>gdb</command> and does not cover specialized topics
|
||||||
such as debugging the kernel.</para>
|
such as debugging the kernel.</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -1530,7 +1530,7 @@ bazz (anint=4231) at temp.c:17 <lineannotation><command>gdb</command> displays
|
||||||
(gdb) <userinput>p i</userinput> <lineannotation>Show us the value of <symbol>i</symbol></lineannotation>
|
(gdb) <userinput>p i</userinput> <lineannotation>Show us the value of <symbol>i</symbol></lineannotation>
|
||||||
$1 = 4231 <lineannotation><command>gdb</command> displays <literal>4231</literal></lineannotation></screen>
|
$1 = 4231 <lineannotation><command>gdb</command> displays <literal>4231</literal></lineannotation></screen>
|
||||||
|
|
||||||
<para>Oh dear! Looking at the code, we forgot to initialise
|
<para>Oh dear! Looking at the code, we forgot to initialize
|
||||||
<symbol>i</symbol>. We meant to put</para>
|
<symbol>i</symbol>. We meant to put</para>
|
||||||
|
|
||||||
<programlisting><lineannotation>…</lineannotation>
|
<programlisting><lineannotation>…</lineannotation>
|
||||||
|
@ -1542,7 +1542,7 @@ main() {
|
||||||
<lineannotation>…</lineannotation></programlisting>
|
<lineannotation>…</lineannotation></programlisting>
|
||||||
|
|
||||||
<para>but we left the <literal>i=5;</literal> line out. As we
|
<para>but we left the <literal>i=5;</literal> line out. As we
|
||||||
did not initialise <symbol>i</symbol>, it had whatever number
|
did not initialize <symbol>i</symbol>, it had whatever number
|
||||||
happened to be in that area of memory when the program ran,
|
happened to be in that area of memory when the program ran,
|
||||||
which in this case happened to be
|
which in this case happened to be
|
||||||
<literal>4231</literal>.</para>
|
<literal>4231</literal>.</para>
|
||||||
|
@ -1691,14 +1691,14 @@ else if (pid == 0) { /* child */
|
||||||
recommend 8MB in text mode and 16MB in X as the bare minimum
|
recommend 8MB in text mode and 16MB in X as the bare minimum
|
||||||
to get reasonable performance.</para>
|
to get reasonable performance.</para>
|
||||||
|
|
||||||
<para>Emacs is basically a highly customisable
|
<para>Emacs is basically a highly customizable
|
||||||
editor—indeed, it has been customised to the point where
|
editor—indeed, it has been customized to the point where
|
||||||
it is more like an operating system than an editor! Many
|
it is more like an operating system than an editor! Many
|
||||||
developers and sysadmins do in fact spend practically all
|
developers and sysadmins do in fact spend practically all
|
||||||
their time working inside Emacs, leaving it only to log
|
their time working inside Emacs, leaving it only to log
|
||||||
out.</para>
|
out.</para>
|
||||||
|
|
||||||
<para>It is impossible even to summarise everything Emacs can do
|
<para>It is impossible even to summarize everything Emacs can do
|
||||||
here, but here are some of the features of interest to
|
here, but here are some of the features of interest to
|
||||||
developers:</para>
|
developers:</para>
|
||||||
|
|
||||||
|
@ -1719,7 +1719,7 @@ else if (pid == 0) { /* child */
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Completely customisable.</para>
|
<para>Completely customizable.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -2112,6 +2112,8 @@ in font-lock-auto-mode-list"
|
||||||
(put 'eval-expression 'disabled nil)
|
(put 'eval-expression 'disabled nil)
|
||||||
(put 'narrow-to-region 'disabled nil)
|
(put 'narrow-to-region 'disabled nil)
|
||||||
(put 'set-goal-column 'disabled nil)
|
(put 'set-goal-column 'disabled nil)
|
||||||
|
(if (>= emacs-major-version 21)
|
||||||
|
(setq show-trailing-whitespace t))
|
||||||
|
|
||||||
;; Elisp archive searching
|
;; Elisp archive searching
|
||||||
(autoload 'format-lisp-code-directory "lispdir" nil t)
|
(autoload 'format-lisp-code-directory "lispdir" nil t)
|
||||||
|
@ -2120,11 +2122,11 @@ in font-lock-auto-mode-list"
|
||||||
(autoload 'lisp-dir-verify "lispdir" nil t)
|
(autoload 'lisp-dir-verify "lispdir" nil t)
|
||||||
|
|
||||||
;; Font lock mode
|
;; Font lock mode
|
||||||
(defun my-make-face (face colour &optional bold)
|
(defun my-make-face (face color &optional bold)
|
||||||
"Create a face from a colour and optionally make it bold"
|
"Create a face from a color and optionally make it bold"
|
||||||
(make-face face)
|
(make-face face)
|
||||||
(copy-face 'default face)
|
(copy-face 'default face)
|
||||||
(set-face-foreground face colour)
|
(set-face-foreground face color)
|
||||||
(if bold (make-face-bold face))
|
(if bold (make-face-bold face))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue