@c ---------
@c <<<< For hard copy printing, this file is now
@c set for smallbook, which works for all sizes
-@c of paper, and with Postscript figures >>>>
+@c of paper, and with PostScript figures >>>>
@set smallbook
@ifset smallbook
@smallbook
@sp 1
Edition @value{edition-number}, @value{update-date}
@sp 1
-Copyright @copyright{} 1990-1995, 1997, 2001-2011 Free Software Foundation, Inc.
+Copyright @copyright{} 1990-1995, 1997, 2001-2012 Free Software Foundation, Inc.
@sp 1
@iftex
Published by the:@*
-GNU Press, @hfill @uref{http://www.gnupress.org}@*
-a division of the @hfill General: @email{press@@gnu.org}@*
-Free Software Foundation, Inc. @hfill Orders:@w{ } @email{sales@@gnu.org}@*
-51 Franklin Street, Fifth Floor @hfill Tel: +1 (617) 542-5942@*
-Boston, MA 02110-1301 USA @hfill Fax: +1 (617) 542-2652@*
+GNU Press, @hfill @uref{http://www.fsf.org/campaigns/gnu-press/}@*
+a division of the @hfill email: @email{sales@@fsf.org}@*
+Free Software Foundation, Inc. @hfill Tel: +1 (617) 542-5942@*
+51 Franklin Street, Fifth Floor @hfill Fax: +1 (617) 542-2652@*
+Boston, MA 02110-1301 USA
@end iftex
@ifnottex
Published by the:
@example
-GNU Press, Website: http://www.gnupress.org
-a division of the General: press@@gnu.org
-Free Software Foundation, Inc. Orders: sales@@gnu.org
-51 Franklin Street, Fifth Floor Tel: +1 (617) 542-5942
-Boston, MA 02110-1301 USA Fax: +1 (617) 542-2652
+GNU Press, http://www.fsf.org/campaigns/gnu-press/
+a division of the email: sales@@fsf.org
+Free Software Foundation, Inc. Tel: +1 (617) 542-5942
+51 Franklin Street, Fifth Floor Fax: +1 (617) 542-2652
+Boston, MA 02110-1301 USA
@end example
@end ifnottex
@sp 1
-@c Printed copies are available for $30 each.@*
+@c Printed copies are available from @uref{http://shop.fsf.org/} for $35 each.@*
ISBN 1-882114-43-4
Permission is granted to copy, distribute and/or modify this document
@contents
@ifnottex
-@node Top, Preface, (dir), (dir)
+@node Top
@top An Introduction to Programming in Emacs Lisp
@insertcopying
@c global@pageno = -11
@c end iftex
+@set COUNT-WORDS count-words-example
+@c Length of variable name chosen so that things still line up when expanded.
+
@menu
* Preface:: What to look for.
* List Processing:: What is Lisp?
* Conclusion:: Now you have the basics.
* the-the:: An appendix: how to find reduplicated words.
* Kill Ring:: An appendix: how the kill ring works.
-* Full Graph:: How to create a graph with labelled axes.
+* Full Graph:: How to create a graph with labeled axes.
* Free Software and Free Manuals::
* GNU Free Documentation License::
* Index::
* fwd-para while:: The forward motion @code{while} loop.
Counting: Repetition and Regexps
-@set COUNT-WORDS count-words-example
-@c Length of variable name chosen so that things still line up when expanded.
* Why Count Words::
* @value{COUNT-WORDS}:: Use a regexp, but find a problem.
* Digression concerning error:: How to mislead humans, but not computers.
* Determining the Element::
-A Graph with Labelled Axes
+A Graph with Labeled Axes
-* Labelled Example::
+* Labeled Example::
* print-graph Varlist:: @code{let} expression in @code{print-graph}.
* print-Y-axis:: Print a label for the vertical axis.
* print-X-axis:: Print a horizontal label.
@end detailmenu
@end menu
-@node Preface, List Processing, Top, Top
-@comment node-name, next, previous, up
+@node Preface
@unnumbered Preface
Most of the GNU Emacs integrated environment is written in the programming
* Thank You::
@end menu
-@node Why, On Reading this Text, Preface, Preface
@ifnottex
+@node Why
@unnumberedsec Why Study Emacs Lisp?
@end ifnottex
fundamentals of programming, and more importantly, to show you how you
can teach yourself to go further.
-@node On Reading this Text, Who You Are, Why, Preface
-@comment node-name, next, previous, up
+@node On Reading this Text
@unnumberedsec On Reading this Text
All through this document, you will see little sample programs you can
to a country not yet visited: interesting, but not the same as being
there.
-Much of this introduction is dedicated to walk-throughs or guided tours
+Much of this introduction is dedicated to walkthroughs or guided tours
of code used in GNU Emacs. These tours are designed for two purposes:
first, to give you familiarity with real, working code (code you use
every day); and, second, to give you familiarity with the way Emacs
something new. This self-reliance is not only a pleasure, but an
advantage.
-@node Who You Are, Lisp History, On Reading this Text, Preface
-@comment node-name, next, previous, up
+@node Who You Are
@unnumberedsec For Whom This is Written
This text is written as an elementary introduction for people who are
@cite{Introduction}, you will find the @cite{Reference Manual} useful
when you are writing your own programs.
-@node Lisp History, Note for Novices, Who You Are, Preface
+@node Lisp History
@unnumberedsec Lisp History
@cindex Lisp history
Lisp. (The standard Emacs distribution contains an optional extensions
file, @file{cl.el}, that adds many Common Lisp features to Emacs Lisp.)
-@node Note for Novices, Thank You, Lisp History, Preface
-@comment node-name, next, previous, up
+@node Note for Novices
@unnumberedsec A Note for Novices
If you don't know GNU Emacs, you can still read this document
means you press and release the @key{CTRL} key and the @kbd{h} at the
same time, and then press and release @kbd{t}.)
-Also, I often refer to one of Emacs' standard commands by listing the
+Also, I often refer to one of Emacs's standard commands by listing the
keys which you press to invoke the command and then giving the name of
the command in parentheses, like this: @kbd{M-C-\}
(@code{indent-region}). What this means is that the
invoke the command; this is called @dfn{rebinding}. @xref{Keymaps, ,
Keymaps}.) The abbreviation @kbd{M-C-\} means that you type your
@key{META} key, @key{CTRL} key and @key{\} key all at the same time.
-(On many modern keyboards the @key{META} key is labelled
+(On many modern keyboards the @key{META} key is labeled
@key{ALT}.)
Sometimes a combination like this is called a keychord, since it is
similar to the way you play a chord on a piano. If your keyboard does
of it. In this case, @kbd{M-C-\} means that you press and release your
@key{ESC} key and then type the @key{CTRL} key and the @key{\} key at
the same time. But usually @kbd{M-C-\} means press the @key{CTRL} key
-along with the key that is labelled @key{ALT} and, at the same time,
+along with the key that is labeled @key{ALT} and, at the same time,
press the @key{\} key.
In addition to typing a lone keychord, you can prefix what you type
referring to the various dialects of Lisp in general, but when I speak
of Emacs Lisp, I am referring to GNU Emacs Lisp in particular.
-@node Thank You, , Note for Novices, Preface
-@comment node-name, next, previous, up
+@node Thank You
@unnumberedsec Thank You
My thanks to all who helped me with this book. My especial thanks to
\fi
@end tex
+@c Note: this resetting of the page number back to 1 causes TeX to gripe
+@c about already having seen page numbers 1-4 before (in the preface):
+@c pdfTeX warning (ext4): destination with the same identifier (name{1})
+@c has been already used, duplicate ignored
+@c I guess that is harmless (what happens if a later part of the text
+@c makes a link to something in the first 4 pages though?).
+@c Note that eg the Emacs manual has a preface, but does not bother
+@c resetting the page numbers back to 1 after that.
@iftex
@headings off
@evenheading @thispage @| @| @thischapter
@global@pageno = 1
@end iftex
-@node List Processing, Practicing Evaluation, Preface, Top
-@comment node-name, next, previous, up
+@node List Processing
@chapter List Processing
To the untutored eye, Lisp is a strange programming language. In Lisp
* Error Message Exercises::
@end menu
-@node Lisp Lists, Run a Program, List Processing, List Processing
-@comment node-name, next, previous, up
+@node Lisp Lists
@section Lisp Lists
@cindex Lisp Lists
* Typing Lists:: How GNU Emacs helps you type lists.
@end menu
-@node Numbers Lists, Lisp Atoms, Lisp Lists, Lisp Lists
@ifnottex
+@node Numbers Lists
@unnumberedsubsec Numbers, Lists inside of Lists
@end ifnottex
list is made up of the words @samp{a}, @samp{list}, @samp{inside},
@samp{of}, @samp{it}.
-@node Lisp Atoms, Whitespace in Lists, Numbers Lists, Lisp Lists
-@comment node-name, next, previous, up
+@node Lisp Atoms
@subsection Lisp Atoms
@cindex Lisp Atoms
Strings are a different kind of atom than numbers or symbols and are
used differently.
-@node Whitespace in Lists, Typing Lists, Lisp Atoms, Lisp Lists
-@comment node-name, next, previous, up
+@node Whitespace in Lists
@subsection Whitespace in Lists
@cindex Whitespace in lists
(For certain situations, square brackets, dots and a few other special
characters may be used; however, we will go quite far without them.)
-@node Typing Lists, , Whitespace in Lists, Lisp Lists
-@comment node-name, next, previous, up
+@node Typing Lists
@subsection GNU Emacs Helps You Type Lists
@cindex Help typing lists
@cindex Formatting help
see which one it is. This is very useful, since every list you type
in Lisp must have its closing parenthesis match its opening
parenthesis. (@xref{Major Modes, , Major Modes, emacs, The GNU Emacs
-Manual}, for more information about Emacs' modes.)
+Manual}, for more information about Emacs's modes.)
-@node Run a Program, Making Errors, Lisp Lists, List Processing
-@comment node-name, next, previous, up
+@node Run a Program
@section Run a Program
@cindex Run a program
@cindex Program, running one
But before discussing this (@pxref{Variables}), we will discuss what the
Lisp interpreter does when you make an error.
-@node Making Errors, Names & Definitions, Run a Program, List Processing
-@comment node-name, next, previous, up
+@node Making Errors
@section Generate an Error Message
@cindex Generate an error message
@cindex Error message generation
error messages intentionally. Once you understand the jargon, error
messages can be informative. Instead of being called ``error''
messages, they should be called ``help'' messages. They are like
-signposts to a traveller in a strange country; deciphering them can be
+signposts to a traveler in a strange country; deciphering them can be
hard, but once understood, they can point the way.
The error message is generated by a built-in GNU Emacs debugger. We
(this is an unquoted list)
@end smallexample
+@ignore
@noindent
What you see depends on which version of Emacs you are running. GNU
Emacs version 22 provides more information than version 20 and before.
@noindent
In GNU Emacs version 22, a @file{*Backtrace*} window will open up and
you will see the following in it:
+@end ignore
+
+A @file{*Backtrace*} window will open up and you should see the
+following in it:
@smallexample
@group
have a set of instructions for the computer to obey and those
instructions must be to add the numbers that follow the @code{+}.
-@need 1250
-In GNU Emacs version 20, and in earlier versions, you will see only
-one line of error message; it will appear in the echo area and look
-like this:
+It is possible to prevent Emacs entering the debugger in cases like
+this. We do not explain how to do that here, but we will mention what
+the result looks like, because you may encounter a similar situation
+if there is a bug in some Emacs code that you are using. In such
+cases, you will see only one line of error message; it will appear in
+the echo area and look like this:
@smallexample
Symbol's function definition is void:@: this
@end smallexample
@noindent
+@ignore
(Also, your terminal may beep at you---some do, some don't; and others
-blink. This is just a device to get your attention.) The message goes
-away as soon as you type another key, even just to move the cursor.
+blink. This is just a device to get your attention.)
+@end ignore
+The message goes away as soon as you type a key, even just to
+move the cursor.
We know the meaning of the word @samp{Symbol}. It refers to the first
atom of the list, the word @samp{this}. The word @samp{function}
definition is void:@: this}. The symbol (that is, the word
@samp{this}) lacks instructions for the computer to carry out.
-@node Names & Definitions, Lisp Interpreter, Making Errors, List Processing
-@comment node-name, next, previous, up
+@node Names & Definitions
@section Symbol Names and Function Definitions
@cindex Symbol names
@samp{texinfo-} and those for functions that deal with reading mail
start with @samp{rmail-}.
-@node Lisp Interpreter, Evaluation, Names & Definitions, List Processing
-@comment node-name, next, previous, up
+@node Lisp Interpreter
@section The Lisp Interpreter
@cindex Lisp interpreter, what it does
@cindex Interpreter, what it does
* Byte Compiling:: Specially processing code for speed.
@end menu
-@node Complications, Byte Compiling, Lisp Interpreter, Lisp Interpreter
@ifnottex
+@node Complications
@unnumberedsubsec Complications
@end ifnottex
Otherwise, the interpreter works left to right, from one expression to
the next.
-@node Byte Compiling, , Complications, Lisp Interpreter
+@node Byte Compiling
@subsection Byte Compiling
@cindex Byte compiling
The GNU Emacs Lisp Reference Manual}, for a full description of byte
compilation.
-@node Evaluation, Variables, Lisp Interpreter, List Processing
-@comment node-name, next, previous, up
+@node Evaluation
@section Evaluation
@cindex Evaluation
* Evaluating Inner Lists:: Lists within lists...
@end menu
-@node How the Interpreter Acts, Evaluating Inner Lists, Evaluation, Evaluation
@ifnottex
+@node How the Interpreter Acts
@unnumberedsubsec How the Lisp Interpreter Acts
@end ifnottex
Lisp interpreter to return a value and perhaps carry out a side effect;
or else produce an error.
-@node Evaluating Inner Lists, , How the Interpreter Acts, Evaluation
-@comment node-name, next, previous, up
+@node Evaluating Inner Lists
@subsection Evaluating Inner Lists
@cindex Inner list evaluation
@cindex Evaluating inner lists
symbol by itself is evaluated, something different happens, as we will
see in the next section.
-@node Variables, Arguments, Evaluation, List Processing
-@comment node-name, next, previous, up
+@node Variables
@section Variables
@cindex Variables
* Void Variable:: The error message for a symbol without a value.
@end menu
-@node fill-column Example, Void Function, Variables, Variables
@ifnottex
+@node fill-column Example
@unnumberedsubsec @code{fill-column}, an Example Variable
@end ifnottex
Setting the Value of a Variable}, for information about one way to do
this.
-@node Void Function, Void Variable, fill-column Example, Variables
-@comment node-name, next, previous, up
+@node Void Function
@subsection Error Message for a Symbol Without a Function
@cindex Symbol without function error
@cindex Error for symbol without function
@need 1250
@noindent
-In GNU Emacs version 22, you will create a @file{*Backtrace*} buffer
-that says:
+You will create a @file{*Backtrace*} buffer that says:
@smallexample
@group
another key.)
@end ignore
-@node Void Variable, , Void Function, Variables
-@comment node-name, next, previous, up
+@node Void Variable
@subsection Error Message for a Symbol Without a Value
@cindex Symbol without value error
@cindex Error for symbol without value
@end smallexample
@noindent
-(As with the other times we entered the debugger, you can quit by
+(Again, you can quit the debugger by
typing @kbd{q} in the @file{*Backtrace*} buffer.)
This backtrace is different from the very first error message we saw,
variable instead of the function definition. We did this by placing the
cursor right after the symbol rather than after the parenthesis of the
enclosing list as we did before. As a consequence, the Lisp interpreter
-evaluated the preceding s-expression, which in this case was the
+evaluated the preceding s-expression, which in this case was
@code{+} by itself.
Since @code{+} does not have a value bound to it, just the function
The meaning is the same as in GNU Emacs 22.
@end ignore
-@node Arguments, set & setq, Variables, List Processing
-@comment node-name, next, previous, up
+@node Arguments
@section Arguments
@cindex Arguments
@cindex Passing information to functions
* message:: A useful function for sending messages.
@end menu
-@node Data types, Args as Variable or List, Arguments, Arguments
-@comment node-name, next, previous, up
+@node Data types
@subsection Arguments' Data Types
@cindex Data types
@cindex Types of data
argument is the string of characters, the second and third arguments are
numbers that indicate the beginning and end of the substring. The
numbers are a count of the number of characters (including spaces and
-punctuations) from the beginning of the string.
+punctuation) from the beginning of the string.
@need 800
For example, if you evaluate the following:
a substring from an argument that is a string, not from another type of
atom such as a number or symbol.
-@node Args as Variable or List, Variable Number of Arguments, Data types, Arguments
-@comment node-name, next, previous, up
+@node Args as Variable or List
@subsection An Argument as the Value of a Variable or List
An argument can be a symbol that returns a value when it is evaluated.
integer that the addition function returns to a string.
@code{number-to-string} is also known as @code{int-to-string}.)
-@node Variable Number of Arguments, Wrong Type of Argument, Args as Variable or List, Arguments
-@comment node-name, next, previous, up
+@node Variable Number of Arguments
@subsection Variable Number of Arguments
@cindex Variable number of arguments
@cindex Arguments, variable number of
@end group
@end smallexample
-@node Wrong Type of Argument, message, Variable Number of Arguments, Arguments
-@comment node-name, next, previous, up
+@node Wrong Type of Argument
@subsection Using the Wrong Type Object as an Argument
@cindex Wrong type of argument
@cindex Argument, wrong type of
could not carry out its addition.
@need 1250
-In GNU Emacs version 22, you will create and enter a
-@file{*Backtrace*} buffer that says:
+You will create and enter a @file{*Backtrace*} buffer that says:
@noindent
@smallexample
@file{*Backtrace*} buffer.
@end ignore
-@node message, , Wrong Type of Argument, Arguments
-@comment node-name, next, previous, up
+@node message
@subsection The @code{message} Function
@findex message
message @code{"He saw 38 red foxes leaping."} appears in your echo
area.
-@node set & setq, Summary, Arguments, List Processing
-@comment node-name, next, previous, up
+@node set & setq
@section Setting the Value of a Variable
@cindex Variable, setting value
@cindex Setting value of variable
* Counting:: Using @code{setq} to count.
@end menu
-@node Using set, Using setq, set & setq, set & setq
-@comment node-name, next, previous, up
+@node Using set
@subsection Using @code{set}
@findex set
the value that was returned. There are situations where this is the
right thing for the function to do; but such situations are rare.)
-@node Using setq, Counting, Using set, set & setq
-@comment node-name, next, previous, up
+@node Using setq
@subsection Using @code{setq}
@findex setq
specifically a list, attached to it; or, expressed another way,
the symbol is set to ``point'' to the list.
-@node Counting, , Using setq, set & setq
-@comment node-name, next, previous, up
+@node Counting
@subsection Counting
@cindex Counting
@code{setq} which sets the variable @code{counter} to this new value.
Thus, the value of the variable, @code{counter}, is changed.
-@node Summary, Error Message Exercises, set & setq, List Processing
-@comment node-name, next, previous, up
+@node Summary
@section Summary
Learning Lisp is like climbing a hill in which the first part is the
create a side effect.
@end itemize
-@node Error Message Exercises, , Summary, List Processing
-@comment node-name, next, previous, up
+@node Error Message Exercises
@section Exercises
A few simple exercises:
evaluated.
@end itemize
-@node Practicing Evaluation, Writing Defuns, List Processing, Top
-@comment node-name, next, previous, up
+@node Practicing Evaluation
@chapter Practicing Evaluation
@cindex Practicing evaluation
@cindex Evaluation practice
* Evaluation Exercise::
@end menu
-@node How to Evaluate, Buffer Names, Practicing Evaluation, Practicing Evaluation
@ifnottex
+@node How to Evaluate
@unnumberedsec How to Evaluate
@end ifnottex
functions makes clear the distinction between buffers and files, how to
switch to a buffer, and how to determine a location within it.
-@node Buffer Names, Getting Buffers, How to Evaluate, Practicing Evaluation
-@comment node-name, next, previous, up
+@node Buffer Names
@section Buffer Names
@findex buffer-name
@findex buffer-file-name
buffer you can edit; and when you write code or documentation (such as
this book), this feature is very useful.
-@node Getting Buffers, Switching Buffers, Buffer Names, Practicing Evaluation
-@comment node-name, next, previous, up
+@node Getting Buffers
@section Getting Buffers
@findex current-buffer
@findex other-buffer
will choose the most recent buffer that you cannot see; this is a
subtlety that I often forget.}.
-@node Switching Buffers, Buffer Size & Locations, Getting Buffers, Practicing Evaluation
-@comment node-name, next, previous, up
+@node Switching Buffers
@section Switching Buffers
@findex switch-to-buffer
@findex set-buffer
default buffer was @file{*scratch*}, or if it was different, then you
typed just part of the name, such as @code{*sc}, pressed your
@kbd{TAB} key to cause it to expand to the full name, and then typed
-your @kbd{RET} key.} when prompted in the minibuffer for the name of
+@kbd{RET}.} when prompted in the minibuffer for the name of
the buffer to which you wanted to switch. The keystrokes, @kbd{C-x
b}, cause the Lisp interpreter to evaluate the interactive function
@code{switch-to-buffer}. As we said before, this is how Emacs works:
By writing @code{switch-to-buffer} in an expression, and giving it a
buffer to switch to, we can switch buffers just the way @kbd{C-x b}
-does.
-
-@need 1000
-Here is the Lisp expression:
+does:
@smallexample
(switch-to-buffer (other-buffer))
not need to be visible on the screen.
@code{switch-to-buffer} is designed for humans and does two different
-things: it switches the buffer to which Emacs' attention is directed; and
+things: it switches the buffer to which Emacs's attention is directed; and
it switches the buffer displayed in the window to the new buffer.
@code{set-buffer}, on the other hand, does only one thing: it switches
the attention of the computer program to a different buffer. The buffer
it---just as a plumber is an entity who can fix a leak if you call him
or her.
-@node Buffer Size & Locations, Evaluation Exercise, Switching Buffers, Practicing Evaluation
-@comment node-name, next, previous, up
+@node Buffer Size & Locations
@section Buffer Size and the Location of Point
@cindex Size of buffer
@cindex Buffer size
function @code{point-max} returns the value of the maximum permissible
value of point in the current buffer.
-@node Evaluation Exercise, , Buffer Size & Locations, Practicing Evaluation
+@node Evaluation Exercise
@section Exercise
Find a file with which you are working and move towards its middle.
Find its buffer name, file name, length, and your position in the file.
-@node Writing Defuns, Buffer Walk Through, Practicing Evaluation, Top
-@comment node-name, next, previous, up
+@node Writing Defuns
@chapter How To Write Function Definitions
@cindex Definition writing
@cindex Function definition writing
* defun Exercises::
@end menu
-@node Primitive Functions, defun, Writing Defuns, Writing Defuns
@ifnottex
+@node Primitive Functions
@unnumberedsec An Aside about Primitive Functions
@end ifnottex
@cindex Primitive functions
unless you investigate, you won't know whether an already-written
function is written in Emacs Lisp or C.
-@node defun, Install, Primitive Functions, Writing Defuns
-@comment node-name, next, previous, up
+@node defun
@section The @code{defun} Special Form
@findex defun
@cindex Special form of @code{defun}
definition of the function. Installation is described in the next
section.
-@node Install, Interactive, defun, Writing Defuns
-@comment node-name, next, previous, up
+@node Install
@section Install a Function Definition
@cindex Install a Function Definition
@cindex Definition installation
* Change a defun:: How to change a function definition.
@end menu
-@node Effect of installation, Change a defun, Install, Install
@ifnottex
+@node Effect of installation
@unnumberedsubsec The effect of installation
@end ifnottex
@noindent
(To return to a single window on your screen, type @kbd{C-x 1}.)
-@node Change a defun, , Effect of installation, Install
-@comment node-name, next, previous, up
+@node Change a defun
@subsection Change a Function Definition
@cindex Changing a function definition
@cindex Function definition, how to change
function; install it; test it; and then make fixes or enhancements and
install it again.
-@node Interactive, Interactive Options, Install, Writing Defuns
-@comment node-name, next, previous, up
+@node Interactive
@section Make a Function Interactive
@cindex Interactive functions
@findex interactive
* multiply-by-seven in detail:: The interactive version.
@end menu
-@node Interactive multiply-by-seven, multiply-by-seven in detail, Interactive, Interactive
@ifnottex
+@node Interactive multiply-by-seven
@unnumberedsubsec An Interactive @code{multiply-by-seven}, An Overview
@end ifnottex
typing @kbd{C-u} and then a number, for example, @kbd{C-u 3 M-e} (if you
type @kbd{C-u} without a number, it defaults to 4).
-@node multiply-by-seven in detail, , Interactive multiply-by-seven, Interactive
-@comment node-name, next, previous, up
+@node multiply-by-seven in detail
@subsection An Interactive @code{multiply-by-seven}
Let's look at the use of the special form @code{interactive} and then at
function, @code{message} prints the text as a side effect without
quotes.)
-@node Interactive Options, Permanent Installation, Interactive, Writing Defuns
-@comment node-name, next, previous, up
+@node Interactive Options
@section Different Options for @code{interactive}
@cindex Options for @code{interactive}
@cindex Interactive options
elisp, The GNU Emacs Lisp Reference Manual}, for a more complete
explanation about this technique.
-@node Permanent Installation, let, Interactive Options, Writing Defuns
-@comment node-name, next, previous, up
+@node Permanent Installation
@section Install Code Permanently
@cindex Install code permanently
@cindex Permanent code installation
others, it may be included in the next release of Emacs. In large
part, this is how Emacs has grown over the past years, by donations.
-@node let, if, Permanent Installation, Writing Defuns
-@comment node-name, next, previous, up
+@node let
@section @code{let}
@findex let
* Uninitialized let Variables::
@end menu
-@node Prevent confusion, Parts of let Expression, let, let
@ifnottex
+@node Prevent confusion
@unnumberedsubsec @code{let} Prevents Confusion
@end ifnottex
Dictionary}). Since you evaluate an expression to perform an action,
`execute' has evolved as a synonym to `evaluate'.)
-@node Parts of let Expression, Sample let Expression, Prevent confusion, let
-@comment node-name, next, previous, up
+@node Parts of let Expression
@subsection The Parts of a @code{let} Expression
@cindex @code{let} expression, parts of
@cindex Parts of @code{let} expression
@end group
@end smallexample
-@node Sample let Expression, Uninitialized let Variables, Parts of let Expression, let
-@comment node-name, next, previous, up
+@node Sample let Expression
@subsection Sample @code{let} Expression
@cindex Sample @code{let} expression
@cindex @code{let} expression sample
value of the variable @code{tiger} is printed at the location of the
second @samp{%s}.
-@node Uninitialized let Variables, , Sample let Expression, let
-@comment node-name, next, previous, up
+@node Uninitialized let Variables
@subsection Uninitialized Variables in a @code{let} Statement
@cindex Uninitialized @code{let} variables
@cindex @code{let} variables uninitialized
@samp{%s}.) The four variables as a group are put into a list to
delimit them from the body of the @code{let}.
-@node if, else, let, Writing Defuns
-@comment node-name, next, previous, up
+@node if
@section The @code{if} Special Form
@findex if
@cindex Conditional with @code{if}
* type-of-animal in detail:: An example of an @code{if} expression.
@end menu
-@node if in more detail, type-of-animal in detail, if, if
@ifnottex
+@node if in more detail
@unnumberedsubsec @code{if} in more detail
@end ifnottex
when you evaluate @code{(type-of-animal 'zebra)} you will see @code{nil}
printed in the echo area.
-@node type-of-animal in detail, , if in more detail, if
-@comment node-name, next, previous, up
+@node type-of-animal in detail
@subsection The @code{type-of-animal} Function in Detail
Let's look at the @code{type-of-animal} function in detail.
is not equal to @code{fierce}, so the then-part is not evaluated and
@code{nil} is returned by the @code{if} expression.
-@node else, Truth & Falsehood, if, Writing Defuns
-@comment node-name, next, previous, up
+@node else
@section If--then--else Expressions
@cindex Else
possibility that some such argument will be tested by the @code{if}
and write your program accordingly.)
-@node Truth & Falsehood, save-excursion, else, Writing Defuns
-@comment node-name, next, previous, up
+@node Truth & Falsehood
@section Truth and Falsehood in Emacs Lisp
@cindex Truth and falsehood in Emacs Lisp
@cindex Falsehood and truth in Emacs Lisp
* nil explained:: @code{nil} has two meanings.
@end menu
-@node nil explained, , Truth & Falsehood, Truth & Falsehood
@ifnottex
+@node nil explained
@unnumberedsubsec An explanation of @code{nil}
@end ifnottex
(> 4 5)
@end smallexample
-@node save-excursion, Review, Truth & Falsehood, Writing Defuns
-@comment node-name, next, previous, up
+@node save-excursion
@section @code{save-excursion}
@findex save-excursion
@cindex Region, what it is
* Template for save-excursion::
@end menu
-@node Point and mark, Template for save-excursion, save-excursion, save-excursion
@ifnottex
+@node Point and mark
@unnumberedsubsec Point and Mark
@end ifnottex
This is how @code{save-excursion} is used in @code{append-to-buffer}.
(@xref{append-to-buffer, , The Definition of @code{append-to-buffer}}.)
-@node Template for save-excursion, , Point and mark, save-excursion
-@comment node-name, next, previous, up
+@node Template for save-excursion
@subsection Template for a @code{save-excursion} Expression
@need 800
@end group
@end smallexample
-@node Review, defun Exercises, save-excursion, Writing Defuns
-@comment node-name, next, previous, up
+@node Review
@section Review
In the last few chapters we have introduced a fair number of functions
window so users can look at it. Usually bound to @kbd{C-x b}.
@item set-buffer
-Switch Emacs' attention to a buffer on which programs will run. Don't
+Switch Emacs's attention to a buffer on which programs will run. Don't
alter what the window is showing.
@item buffer-size
@end table
@need 1500
-@node defun Exercises, , Review, Writing Defuns
+@node defun Exercises
@section Exercises
@itemize @bullet
and if so, prints an appropriate message.
@end itemize
-@node Buffer Walk Through, More Complex, Writing Defuns, Top
-@comment node-name, next, previous, up
+@node Buffer Walk Through
@chapter A Few Buffer--Related Functions
In this chapter we study in detail several of the functions used in GNU
* Buffer Exercises::
@end menu
-@node Finding More, simplified-beginning-of-buffer, Buffer Walk Through, Buffer Walk Through
+@node Finding More
@section Finding More Information
@findex describe-function, @r{introduced}
such as @code{mark-whole-buffer}, and then type @key{RET}. Emacs will
switch buffers and display the source code for the function on your
screen. To switch back to your current buffer, type @kbd{C-x b
-@key{RET}}. (On some keyboards, the @key{META} key is labelled
+@key{RET}}. (On some keyboards, the @key{META} key is labeled
@key{ALT}.)
@c !!! 22.1.1 tags table location in this paragraph
@kbd{C-h p} command lets you search the standard Emacs Lisp libraries
by topic keywords.''
-@node simplified-beginning-of-buffer, mark-whole-buffer, Finding More, Buffer Walk Through
-@comment node-name, next, previous, up
+@node simplified-beginning-of-buffer
@section A Simplified @code{beginning-of-buffer} Definition
@findex simplified-beginning-of-buffer
function contains the expression @code{(goto-char (point-max))} in place
of @code{(goto-char (point-min))}.
-@node mark-whole-buffer, append-to-buffer, simplified-beginning-of-buffer, Buffer Walk Through
-@comment node-name, next, previous, up
+@node mark-whole-buffer
@section The Definition of @code{mark-whole-buffer}
@findex mark-whole-buffer
* Body of mark-whole-buffer:: Only three lines of code.
@end menu
-@node mark-whole-buffer overview, Body of mark-whole-buffer, mark-whole-buffer, mark-whole-buffer
@ifnottex
+@node mark-whole-buffer overview
@unnumberedsubsec An overview of @code{mark-whole-buffer}
@end ifnottex
previous section.
@need 1250
-@node Body of mark-whole-buffer, , mark-whole-buffer overview, mark-whole-buffer
-@comment node-name, next, previous, up
+@node Body of mark-whole-buffer
@subsection Body of @code{mark-whole-buffer}
The body of the @code{mark-whole-buffer} function consists of three
is set at the end of the buffer. The whole buffer is, therefore, the
region.
-@node append-to-buffer, Buffer Related Review, mark-whole-buffer, Buffer Walk Through
-@comment node-name, next, previous, up
+@node append-to-buffer
@section The Definition of @code{append-to-buffer}
@findex append-to-buffer
* append save-excursion:: How the @code{save-excursion} works.
@end menu
-@node append-to-buffer overview, append interactive, append-to-buffer, append-to-buffer
@ifnottex
+@node append-to-buffer overview
@unnumberedsubsec An Overview of @code{append-to-buffer}
@end ifnottex
Note that the documentation distinguishes between a buffer and its
name. (The function can handle either.)
-@node append interactive, append-to-buffer body, append-to-buffer overview, append-to-buffer
-@comment node-name, next, previous, up
+@node append interactive
@subsection The @code{append-to-buffer} Interactive Expression
Since the @code{append-to-buffer} function will be used interactively,
argument list (that is, @code{start} and @code{end}) to the values of
point and mark. That argument worked fine.)
-@node append-to-buffer body, append save-excursion, append interactive, append-to-buffer
-@comment node-name, next, previous, up
+@node append-to-buffer body
@subsection The Body of @code{append-to-buffer}
@ignore
boundary of the varlist and the second parenthesis marks the beginning
of the two-element list, @code{(oldbuf (current-buffer))}.
-@node append save-excursion, , append-to-buffer body, append-to-buffer
-@comment node-name, next, previous, up
+@node append save-excursion
@subsection @code{save-excursion} in @code{append-to-buffer}
The body of the @code{let} expression in @code{append-to-buffer}
In summary, @code{append-to-buffer} works as follows: it saves the
value of the current buffer in the variable called @code{oldbuf}. It
-gets the new buffer (creating one if need be) and switches Emacs'
+gets the new buffer (creating one if need be) and switches Emacs's
attention to it. Using the value of @code{oldbuf}, it inserts the
region of text from the old buffer into the new buffer; and then using
@code{save-excursion}, it brings you back to your original buffer.
buffer. Many function definitions use @code{let},
@code{save-excursion}, and @code{set-buffer} this way.
-@node Buffer Related Review, Buffer Exercises, append-to-buffer, Buffer Walk Through
-@comment node-name, next, previous, up
+@node Buffer Related Review
@section Review
Here is a brief summary of the various functions discussed in this chapter.
@end table
@need 1500
-@node Buffer Exercises, , Buffer Related Review, Buffer Walk Through
+@node Buffer Exercises
@section Exercises
@itemize @bullet
function.
@end itemize
-@node More Complex, Narrowing & Widening, Buffer Walk Through, Top
-@comment node-name, next, previous, up
+@node More Complex
@chapter A Few More Complex Functions
In this chapter, we build on what we have learned in previous chapters
* optional Exercise::
@end menu
-@node copy-to-buffer, insert-buffer, More Complex, More Complex
-@comment node-name, next, previous, up
+@node copy-to-buffer
@section The Definition of @code{copy-to-buffer}
@findex copy-to-buffer
@end group
@end smallexample
-@node insert-buffer, beginning-of-buffer, copy-to-buffer, More Complex
-@comment node-name, next, previous, up
+@node insert-buffer
@section The Definition of @code{insert-buffer}
@findex insert-buffer
* New insert-buffer::
@end menu
-@node insert-buffer code, insert-buffer interactive, insert-buffer, insert-buffer
@ifnottex
+@node insert-buffer code
@unnumberedsubsec The Code for @code{insert-buffer}
@end ifnottex
@end group
@end smallexample
-@node insert-buffer interactive, insert-buffer body, insert-buffer code, insert-buffer
-@comment node-name, next, previous, up
+@node insert-buffer interactive
@subsection The Interactive Expression in @code{insert-buffer}
@findex interactive, @r{example use of}
* b for interactive:: An existing buffer or else its name.
@end menu
-@node Read-only buffer, b for interactive, insert-buffer interactive, insert-buffer interactive
-@comment node-name, next, previous, up
+@node Read-only buffer
@unnumberedsubsubsec A Read-only Buffer
@cindex Read-only buffer
@cindex Asterisk for read-only buffer
into current buffer. The asterisk does not need to be followed by a
newline to separate it from the next argument.
-@node b for interactive, , Read-only buffer, insert-buffer interactive
-@comment node-name, next, previous, up
+@node b for interactive
@unnumberedsubsubsec @samp{b} in an Interactive Expression
The next argument in the interactive expression starts with a lower
functions with which we are already familiar and the @code{progn}
special form with which we are not. (It will be described later.)
-@node insert-buffer body, if & or, insert-buffer interactive, insert-buffer
-@comment node-name, next, previous, up
+@node insert-buffer body
@subsection The Body of the @code{insert-buffer} Function
The body of the @code{insert-buffer} function has two major parts: an
Before doing this, let me rewrite this part of the function using
@code{if} so that you can see what is done in a manner that will be familiar.
-@node if & or, Insert or, insert-buffer body, insert-buffer
-@comment node-name, next, previous, up
+@node if & or
@subsection @code{insert-buffer} With an @code{if} Instead of an @code{or}
The job to be done is to make sure the value of @code{buffer} is a
@code{buffer} to the value of the buffer itself, replacing its previous
value (which was the name of the buffer).
-@node Insert or, Insert let, if & or, insert-buffer
-@comment node-name, next, previous, up
+@node Insert or
@subsection The @code{or} in the Body
The purpose of the @code{or} expression in the @code{insert-buffer}
(or (holding-on-to-guest) (find-and-take-arm-of-guest))
@end smallexample
-@node Insert let, New insert-buffer, Insert or, insert-buffer
-@comment node-name, next, previous, up
+@node Insert let
@subsection The @code{let} Expression in @code{insert-buffer}
After ensuring that the variable @code{buffer} refers to a buffer itself
@end smallexample
@noindent
-The expression @code{(set-buffer buffer)} changes Emacs' attention
+The expression @code{(set-buffer buffer)} changes Emacs's attention
from the current buffer to the one from which the text will copied.
In that buffer, the variables @code{start} and @code{end} are set to
the beginning and end of the buffer, using the commands
use @code{or}. All these functions are building blocks that we will
find and use again and again.
-@node New insert-buffer, , Insert let, insert-buffer
-@comment node-name, next, previous, up
+@node New insert-buffer
@subsection New Body for @code{insert-buffer}
@findex insert-buffer, new version body
@findex new version body for insert-buffer
exists only to produce a side effect, inserting another buffer, not to
return any value.
-@node beginning-of-buffer, Second Buffer Related Review, insert-buffer, More Complex
-@comment node-name, next, previous, up
+@node beginning-of-buffer
@section Complete Definition of @code{beginning-of-buffer}
@findex beginning-of-buffer
* beginning-of-buffer complete::
@end menu
-@node Optional Arguments, beginning-of-buffer opt arg, beginning-of-buffer, beginning-of-buffer
+@node Optional Arguments
@subsection Optional Arguments
Unless told otherwise, Lisp expects that a function with an argument in
is how we saw the @code{beginning-of-buffer} function in its
simplified form.
-@node beginning-of-buffer opt arg, beginning-of-buffer complete, Optional Arguments, beginning-of-buffer
+@node beginning-of-buffer opt arg
@subsection @code{beginning-of-buffer} with an Argument
When @code{beginning-of-buffer} is called with an argument, an
* Small buffer case::
@end menu
-@node Disentangle beginning-of-buffer, Large buffer case, beginning-of-buffer opt arg, beginning-of-buffer opt arg
@ifnottex
+@node Disentangle beginning-of-buffer
@unnumberedsubsubsec Disentangle @code{beginning-of-buffer}
@end ifnottex
There are two cases: if the buffer is large and if it is not.
-@node Large buffer case, Small buffer case, Disentangle beginning-of-buffer, beginning-of-buffer opt arg
-@comment node-name, next, previous, up
+@node Large buffer case
@unnumberedsubsubsec What happens in a large buffer
In @code{beginning-of-buffer}, the inner @code{if} expression tests
This puts the cursor where we want it.
-@node Small buffer case, , Large buffer case, beginning-of-buffer opt arg
-@comment node-name, next, previous, up
+@node Small buffer case
@unnumberedsubsubsec What happens in a small buffer
If the buffer contains fewer than 10,000 characters, a slightly
the cursor is moved to that point.
@need 1500
-@node beginning-of-buffer complete, , beginning-of-buffer opt arg, beginning-of-buffer
-@comment node-name, next, previous, up
+@node beginning-of-buffer complete
@subsection The Complete @code{beginning-of-buffer}
@need 1000
intended or whether no one has dealt with the code to avoid this
happening.
-@node Second Buffer Related Review, optional Exercise, beginning-of-buffer, More Complex
-@comment node-name, next, previous, up
+@node Second Buffer Related Review
@section Review
Here is a brief summary of some of the topics covered in this chapter.
Return @code{t} if its argument is a buffer; otherwise return @code{nil}.
@end table
-@node optional Exercise, , Second Buffer Related Review, More Complex
+@node optional Exercise
@section @code{optional} Argument Exercise
Write an interactive function with an optional argument that tests
message. However, if you do not pass an argument to the function, use
56 as a default value.
-@node Narrowing & Widening, car cdr & cons, More Complex, Top
-@comment node-name, next, previous, up
+@node Narrowing & Widening
@chapter Narrowing and Widening
@cindex Focusing attention (narrowing)
@cindex Narrowing
* narrow Exercise::
@end menu
-@node Narrowing advantages, save-restriction, Narrowing & Widening, Narrowing & Widening
@ifnottex
+@node Narrowing advantages
@unnumberedsec The Advantages of Narrowing
@end ifnottex
of the buffer in which it is interested and then restores the previous
situation.
-@node save-restriction, what-line, Narrowing advantages, Narrowing & Widening
-@comment node-name, next, previous, up
+@node save-restriction
@section The @code{save-restriction} Special Form
@findex save-restriction
(- (buffer-size) (forward-line (buffer-size)))))))
@end ignore
-@node what-line, narrow Exercise, save-restriction, Narrowing & Widening
-@comment node-name, next, previous, up
+@node what-line
@section @code{what-line}
@findex what-line
@cindex Widening, example of
mark to their original positions; and @code{save-restriction} restores
the original narrowing, if any.
-@node narrow Exercise, , what-line, Narrowing & Widening
+@node narrow Exercise
@section Exercise with Narrowing
Write a function that will display the first 60 characters of the
Additionally, do you really need @code{goto-char} or @code{point-min}?
Or can you write the function without them?
-@node car cdr & cons, Cutting & Storing Text, Narrowing & Widening, Top
-@comment node-name, next, previous, up
+@node car cdr & cons
@chapter @code{car}, @code{cdr}, @code{cons}: Fundamental Functions
@findex car, @r{introduced}
@findex cdr, @r{introduced}
* cons Exercise::
@end menu
-@node Strange Names, car & cdr, car cdr & cons, car cdr & cons
@ifnottex
+@node Strange Names
@unnumberedsec Strange Names
@end ifnottex
terms are used in the Emacs Lisp source code, we will use them in this
introduction.
-@node car & cdr, cons, Strange Names, car cdr & cons
-@comment node-name, next, previous, up
+@node car & cdr
@section @code{car} and @code{cdr}
The @sc{car} of a list is, quite simply, the first item in the list.
by array-specific functions. @xref{Arrays, , Arrays, elisp, The GNU
Emacs Lisp Reference Manual}.)
-@node cons, nthcdr, car & cdr, car cdr & cons
-@comment node-name, next, previous, up
+@node cons
@section @code{cons}
@findex cons, @r{introduced}
* length:: How to find the length of a list.
@end menu
-@node Build a list, length, cons, cons
@ifnottex
+@node Build a list
@unnumberedsubsec Build a list
@end ifnottex
and the third example constructs a three element list by putting
@code{violet} in front of @code{daisy} and @code{buttercup}.
-@node length, , Build a list, cons
-@comment node-name, next, previous, up
+@node length
@subsection Find the Length of a List: @code{length}
@findex length
about subroutines.
@end ignore
-@node nthcdr, nth, cons, car cdr & cons
-@comment node-name, next, previous, up
+@node nthcdr
@section @code{nthcdr}
@findex nthcdr
@end group
@end smallexample
-@node nth, setcar, nthcdr, car cdr & cons
-@comment node-name, next, previous, up
+@node nth
@section @code{nth}
@findex nth
non-destructive. This is in sharp contrast to the @code{setcar} and
@code{setcdr} functions.
-@node setcar, setcdr, nth, car cdr & cons
-@comment node-name, next, previous, up
+@node setcar
@section @code{setcar}
@findex setcar
as @code{cons} would have; it replaced @code{antelope} with
@code{hippopotamus}; it @emph{changed} the list.
-@node setcdr, cons Exercise, setcar, car cdr & cons
-@comment node-name, next, previous, up
+@node setcdr
@section @code{setcdr}
@findex setcdr
@code{(horse cat dog)}. The @sc{cdr} of the list is changed from
@code{(cow sheep goat)} to @code{(cat dog)}.
-@node cons Exercise, , setcdr, car cdr & cons
+@node cons Exercise
@section Exercise
Construct a list of four birds by evaluating several expressions with
itself. Replace the first element of the list of four birds with a
fish. Replace the rest of that list with a list of other fish.
-@node Cutting & Storing Text, List Implementation, car cdr & cons, Top
-@comment node-name, next, previous, up
+@node Cutting & Storing Text
@chapter Cutting and Storing Text
@cindex Cutting and storing text
@cindex Storing and cutting text
* search Exercises::
@end menu
-@node Storing Text, zap-to-char, Cutting & Storing Text, Cutting & Storing Text
@ifnottex
+@node Storing Text
@unnumberedsec Storing Text in a List
@end ifnottex
A subsequent chapter describes how text that is cut from the buffer is
retrieved. @xref{Yanking, , Yanking Text Back}.
-@node zap-to-char, kill-region, Storing Text, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node zap-to-char
@section @code{zap-to-char}
@findex zap-to-char
+@c FIXME remove obsolete stuff
The @code{zap-to-char} function changed little between GNU Emacs
version 19 and GNU Emacs version 22. However, @code{zap-to-char}
calls another function, @code{kill-region}, which enjoyed a major
* Summing up zap-to-char:: Using @code{point} and @code{search-forward}.
@end menu
-@node Complete zap-to-char, zap-to-char interactive, zap-to-char, zap-to-char
@ifnottex
+@node Complete zap-to-char
@unnumberedsubsec The Complete @code{zap-to-char} Implementation
@end ifnottex
The documentation is thorough. You do need to know the jargon meaning
of the word `kill'.
-@node zap-to-char interactive, zap-to-char body, Complete zap-to-char, zap-to-char
-@comment node-name, next, previous, up
+@node zap-to-char interactive
@subsection The @code{interactive} Expression
@need 800
message saying that the buffer is read-only. Also, the terminal may
beep or blink at you.
-@node zap-to-char body, search-forward, zap-to-char interactive, zap-to-char
-@comment node-name, next, previous, up
+@node zap-to-char body
@subsection The Body of @code{zap-to-char}
The body of the @code{zap-to-char} function contains the code that
@code{search-forward}, so we will look at @code{search-forward} and
then at @code{progn}.
-@node search-forward, progn, zap-to-char body, zap-to-char
-@comment node-name, next, previous, up
+@node search-forward
@subsection The @code{search-forward} Function
@findex search-forward
We will look at @code{progn} next.
-@node progn, Summing up zap-to-char, search-forward, zap-to-char
-@comment node-name, next, previous, up
+@node progn
@subsection The @code{progn} Special Form
@findex progn
returned by the @code{progn} expression and is passed to
@code{kill-region} as @code{kill-region}'s second argument.
-@node Summing up zap-to-char, , progn, zap-to-char
-@comment node-name, next, previous, up
+@node Summing up zap-to-char
@subsection Summing up @code{zap-to-char}
Now that we have seen how @code{search-forward} and @code{progn} work,
a single argument to @code{kill-region} and returns the one value that
@code{kill-region} needs for its second argument.
-@node kill-region, copy-region-as-kill, zap-to-char, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node kill-region
@section @code{kill-region}
@findex kill-region
* Lisp macro::
@end menu
-@node Complete kill-region, condition-case, kill-region, kill-region
@ifnottex
+@node Complete kill-region
@unnumberedsubsec The Complete @code{kill-region} Definition
@end ifnottex
;; it will be set in an error
(setq this-command 'kill-region)
;; Finally, in the then-part, send a message if you may copy
- ;; the text to the kill ring without signally an error, but
+ ;; the text to the kill ring without signaling an error, but
;; don't if you may not.
@end group
@group
@end smallexample
@end ignore
-@node condition-case, Lisp macro, Complete kill-region, kill-region
-@comment node-name, next, previous, up
+@node condition-case
@subsection @code{condition-case}
@findex condition-case
Initializing a Variable with @code{defvar} includes line 8350
@end ignore
-@node Lisp macro, , condition-case, kill-region
-@comment node-name, next, previous, up
+@node Lisp macro
@subsection Lisp macro
@cindex Macro, lisp
@cindex Lisp macro
concatenates a copy of the newly clipped text to the just previously
clipped text in the kill ring.
-@node copy-region-as-kill, Digression into C, kill-region, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node copy-region-as-kill
@section @code{copy-region-as-kill}
@findex copy-region-as-kill
@findex nthcdr
* copy-region-as-kill body:: The body of @code{copy-region-as-kill}.
@end menu
-@node Complete copy-region-as-kill, copy-region-as-kill body, copy-region-as-kill, copy-region-as-kill
@ifnottex
+@node Complete copy-region-as-kill
@unnumberedsubsec The complete @code{copy-region-as-kill} function definition
@end ifnottex
The body of @code{copy-region-as-kill} merits discussion in detail.
-@node copy-region-as-kill body, , Complete copy-region-as-kill, copy-region-as-kill
-@comment node-name, next, previous, up
+@node copy-region-as-kill body
@subsection The Body of @code{copy-region-as-kill}
The @code{copy-region-as-kill} function works in much the same way as
* kill-new function::
@end menu
-@node last-command & this-command, kill-append function, copy-region-as-kill body, copy-region-as-kill body
@ifnottex
+@node last-command & this-command
@unnumberedsubsubsec @code{last-command} and @code{this-command}
@end ifnottex
If the previous command was @code{kill-region}, then the Emacs Lisp
interpreter calls the @code{kill-append} function
-@node kill-append function, kill-new function, last-command & this-command, copy-region-as-kill body
+@node kill-append function
@unnumberedsubsubsec The @code{kill-append} function
@findex kill-append
saved text. The @code{kill-append} function uses the @code{kill-new}
function which in turn uses the @code{setcar} function.
-@node kill-new function, , kill-append function, copy-region-as-kill body
+@node kill-new function
@unnumberedsubsubsec The @code{kill-new} function
@findex kill-new
see Initializing a Variable with @code{defvar}
@end ignore
-@node Digression into C, defvar, copy-region-as-kill, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node Digression into C
@section Digression into C
@findex delete-and-extract-region
@cindex C, a digression into
simple; but hidden underneath is a great deal of complexity to make it
all work.
-@node defvar, cons & search-fwd Review, Digression into C, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node defvar
@section Initializing a Variable with @code{defvar}
@findex defvar
@cindex Initializing a variable
* defvar and asterisk::
@end menu
-@node See variable current value, defvar and asterisk, defvar, defvar
@ifnottex
+@node See variable current value
@unnumberedsubsec Seeing the Current Value of a Variable
@end ifnottex
Succeeding lines should not be indented; otherwise they look odd when
you use @kbd{C-h v} (@code{describe-variable}).
-@node defvar and asterisk, , See variable current value, defvar
+@node defvar and asterisk
@subsection @code{defvar} and an asterisk
@findex defvar @r{for a user customizable variable}
@findex defvar @r{with an asterisk}
The GNU Emacs Manual}.)
@need 1250
-@node cons & search-fwd Review, search Exercises, defvar, Cutting & Storing Text
-@comment node-name, next, previous, up
+@node cons & search-fwd Review
@section Review
Here is a brief summary of some recently introduced functions.
(This is not an interactive command.)
@need 1500
-@node search Exercises, , cons & search-fwd Review, Cutting & Storing Text
+@node search Exercises
@section Searching Exercises
@itemize @bullet
print an appropriate message.
@end itemize
-@node List Implementation, Yanking, Cutting & Storing Text, Top
-@comment node-name, next, previous, up
+@node List Implementation
@chapter How Lists are Implemented
@cindex Lists in a computer
* List Exercise::
@end menu
-@node Lists diagrammed, Symbols as Chest, List Implementation, List Implementation
@ifnottex
+@node Lists diagrammed
@unnumberedsec Lists diagrammed
@end ifnottex
In summary, when a Lisp variable is set to a value, it is provided with
the address of the list to which the variable refers.
-@node Symbols as Chest, List Exercise, Lists diagrammed, List Implementation
+@node Symbols as Chest
@section Symbols as a Chest of Drawers
@cindex Symbols as a Chest of Drawers
@cindex Chest of Drawers, metaphor for a symbol
@end iftex
@end ifclear
-@node List Exercise, , Symbols as Chest, List Implementation
+@node List Exercise
@section Exercise
Set @code{flowers} to @code{violet} and @code{buttercup}. Cons two
@code{more-flowers}. Set the @sc{car} of @code{flowers} to a fish.
What does the @code{more-flowers} list now contain?
-@node Yanking, Loops & Recursion, List Implementation, Top
-@comment node-name, next, previous, up
+@node Yanking
@chapter Yanking Text Back
@findex yank
@cindex Text retrieval
* yank nthcdr Exercises:: The @code{kill-ring-yank-pointer} variable.
@end menu
-@node Kill Ring Overview, kill-ring-yank-pointer, Yanking, Yanking
-@comment node-name, next, previous, up
+@node Kill Ring Overview
@section Kill Ring Overview
@cindex Kill ring overview
To begin to understand how @code{yank} and @code{yank-pop} work, it is
first necessary to look at the @code{kill-ring-yank-pointer} variable.
-@node kill-ring-yank-pointer, yank nthcdr Exercises, Kill Ring Overview, Yanking
-@comment node-name, next, previous, up
+@node kill-ring-yank-pointer
@section The @code{kill-ring-yank-pointer} Variable
@code{kill-ring-yank-pointer} is a variable, just as @code{kill-ring} is
@end ignore
@need 1500
-@node yank nthcdr Exercises, , kill-ring-yank-pointer, Yanking
+@node yank nthcdr Exercises
@section Exercises with @code{yank} and @code{nthcdr}
@itemize @bullet
to return the first, second, third, and fourth elements of a list.
@end itemize
-@node Loops & Recursion, Regexp Search, Yanking, Top
-@comment node-name, next, previous, up
+@node Loops & Recursion
@chapter Loops and Recursion
@cindex Loops and recursion
@cindex Recursion and loops
* Looping exercise::
@end menu
-@node while, dolist dotimes, Loops & Recursion, Loops & Recursion
-@comment node-name, next, previous, up
+@node while
@section @code{while}
@cindex Loops
@findex while
* Decrementing Loop:: A loop with a decrementing counter.
@end menu
-@node Looping with while, Loop Example, while, while
@ifnottex
+@node Looping with while
@unnumberedsubsec Looping with @code{while}
@end ifnottex
but the consequences of what happens when the expressions in the loop
are repeatedly evaluated.
-@node Loop Example, print-elements-of-list, Looping with while, while
-@comment node-name, next, previous, up
+@node Loop Example
@subsection A @code{while} Loop and a List
A common way to control a @code{while} loop is to test whether a list
goes through a list and prints each element of the list on a line of its
own.
-@node print-elements-of-list, Incrementing Loop, Loop Example, while
+@node print-elements-of-list
@subsection An Example: @code{print-elements-of-list}
@findex print-elements-of-list
@code{while} loop, and since @code{while} loops always return
@code{nil}, a @code{nil} is printed after the last element of the list.
-@node Incrementing Loop, Incrementing Loop Details, print-elements-of-list, while
-@comment node-name, next, previous, up
+@node Incrementing Loop
@subsection A Loop with an Incrementing Counter
A loop is not useful unless it stops when it ought. Besides
have a counter---an expression that counts how many times the loop
repeats itself.
-@node Incrementing Loop Details, Decrementing Loop, Incrementing Loop, while
@ifnottex
+@node Incrementing Loop Details
@unnumberedsubsec Details of an Incrementing Loop
@end ifnottex
* Inc Example altogether:: Putting the function definition together.
@end menu
-@node Incrementing Example, Inc Example parts, Incrementing Loop Details, Incrementing Loop Details
+@node Incrementing Example
@unnumberedsubsubsec Example with incrementing counter
Suppose you are playing on the beach and decide to make a triangle of
complex loop the repetitive action might not be so simple, but it will
be simpler than doing everything all at once.
-@node Inc Example parts, Inc Example altogether, Incrementing Example, Incrementing Loop Details
+@node Inc Example parts
@unnumberedsubsubsec The parts of the function definition
The preceding analysis gives us the bones of our function definition:
(setq row-number (1+ row-number))
@end smallexample
-@node Inc Example altogether, , Inc Example parts, Incrementing Loop Details
+@node Inc Example altogether
@unnumberedsubsubsec Putting the function definition together
We have created the parts for the function definition; now we need to
The sum of the first four numbers is 10 and the sum of the first seven
numbers is 28.
-@node Decrementing Loop, , Incrementing Loop Details, while
-@comment node-name, next, previous, up
+@node Decrementing Loop
@subsection Loop with a Decrementing Counter
Another common way to write a @code{while} loop is to write the test
* Dec Example altogether:: Putting the function definition together.
@end menu
-@node Decrementing Example, Dec Example parts, Decrementing Loop, Decrementing Loop
+@node Decrementing Example
@unnumberedsubsubsec Example with decrementing counter
To illustrate a loop with a decrementing counter, we will rewrite the
many pebbles are in the preceding row: it is one less than the number in
the row.
-@node Dec Example parts, Dec Example altogether, Decrementing Example, Decrementing Loop
+@node Dec Example parts
@unnumberedsubsubsec The parts of the function definition
We start with three variables: the total number of rows in the
(while (> number-of-pebbles-in-row 0)
@end smallexample
-@node Dec Example altogether, , Dec Example parts, Decrementing Loop
+@node Dec Example altogether
@unnumberedsubsubsec Putting the function definition together
We can put these expressions together to create a function definition
number of times.
@end enumerate
-@node dolist dotimes, Recursion, while, Loops & Recursion
-@comment node-name, next, previous, up
+@node dolist dotimes
@section Save your time: @code{dolist} and @code{dotimes}
In addition to @code{while}, both @code{dolist} and @code{dotimes}
* dotimes::
@end menu
-@node dolist, dotimes, dolist dotimes, dolist dotimes
-@unnumberedsubsubsec The @code{dolist} Macro
+@node dolist
+@unnumberedsubsec The @code{dolist} Macro
@findex dolist
Suppose, for example, you want to reverse a list, so that
the expression; and repeats the loop. The result is returned in
@code{value}.
-@node dotimes, , dolist, dolist dotimes
-@unnumberedsubsubsec The @code{dotimes} Macro
+@node dotimes
+@unnumberedsubsec The @code{dotimes} Macro
@findex dotimes
The @code{dotimes} macro is similar to @code{dolist}, except that it
@end group
@end smallexample
-@node Recursion, Looping exercise, dolist dotimes, Loops & Recursion
-@comment node-name, next, previous, up
+@node Recursion
@section Recursion
@cindex Recursion
* No deferment solution::
@end menu
-@node Building Robots, Recursive Definition Parts, Recursion, Recursion
-@comment node-name, next, previous, up
+@node Building Robots
@subsection Building Robots: Extending the Metaphor
@cindex Building robots
@cindex Robots, building
It is important that the arguments differ from one instance to the
next; otherwise, the process will never stop.
-@node Recursive Definition Parts, Recursion with list, Building Robots, Recursion
-@comment node-name, next, previous, up
+@node Recursive Definition Parts
@subsection The Parts of a Recursive Definition
@cindex Parts of a Recursive Definition
@cindex Recursive Definition Parts
The do-again-test is sometimes called the @dfn{stop condition},
since it stops the repetitions when it tests false.
-@node Recursion with list, Recursive triangle function, Recursive Definition Parts, Recursion
-@comment node-name, next, previous, up
+@node Recursion with list
@subsection Recursion with a List
The example of a @code{while} loop that printed the elements of a list
of numbers can be written recursively. Here is the code, including
an expression to set the value of the variable @code{animals} to a list.
-If you are using GNU Emacs 20 or before, this example must be copied
-to the @file{*scratch*} buffer and each expression must be evaluated
-there. Use @kbd{C-u C-x C-e} to evaluate the
+If you are reading this in Info in Emacs, you can evaluate this
+expression directly in Info. Otherwise, you must copy the example
+to the @file{*scratch*} buffer and evaluate each expression there.
+Use @kbd{C-u C-x C-e} to evaluate the
@code{(print-elements-recursively animals)} expression so that the
results are printed in the buffer; otherwise the Lisp interpreter will
try to squeeze the results into the one line of the echo area.
of the @code{print-elements-recursively} function, before the comment.
Otherwise, the Lisp interpreter will try to evaluate the comment.
-If you are using a more recent version of Emacs, you can evaluate this
-expression directly in Info.
-
@findex print-elements-recursively
@smallexample
@group
@end smallexample
@need 2000
-@node Recursive triangle function, Recursion with cond, Recursion with list, Recursion
-@comment node-name, next, previous, up
+@node Recursive triangle function
@subsection Recursion in Place of a Counter
@findex triangle-recursively
* Recursive Example arg of 3 or 4::
@end menu
-@node Recursive Example arg of 1 or 2, Recursive Example arg of 3 or 4, Recursive triangle function, Recursive triangle function
@ifnottex
+@node Recursive Example arg of 1 or 2
@unnumberedsubsubsec An argument of 1 or 2
@end ifnottex
pebbles in it.
@end table
-@node Recursive Example arg of 3 or 4, , Recursive Example arg of 1 or 2, Recursive triangle function
+@node Recursive Example arg of 3 or 4
@unnumberedsubsubsec An argument of 3 or 4
Suppose that @code{triangle-recursively} is called with an argument of
There is a way around this kind of waiting, which we will discuss in
@ref{No Deferment, , Recursion without Deferments}.
-@node Recursion with cond, Recursive Patterns, Recursive triangle function, Recursion
-@comment node-name, next, previous, up
+@node Recursion with cond
@subsection Recursion Example Using @code{cond}
@findex cond
number (triangle-using-cond (1- number)))} if the number is greater than
1.
-@node Recursive Patterns, No Deferment, Recursion with cond, Recursion
-@comment node-name, next, previous, up
+@node Recursive Patterns
@subsection Recursive Patterns
@cindex Recursive Patterns
* Keep::
@end menu
-@node Every, Accumulate, Recursive Patterns, Recursive Patterns
-@comment node-name, next, previous, up
+@node Every
@unnumberedsubsubsec Recursive Pattern: @emph{every}
@cindex Every, type of recursive pattern
@cindex Recursive pattern: every
@end itemize
@end itemize
-@node Accumulate, Keep, Every, Recursive Patterns
-@comment node-name, next, previous, up
+@node Accumulate
@unnumberedsubsubsec Recursive Pattern: @emph{accumulate}
@cindex Accumulate, type of recursive pattern
@cindex Recursive pattern: accumulate
@xref{Files List, , Making a List of Files}, for an example of the
accumulate pattern.
-@node Keep, , Accumulate, Recursive Patterns
-@comment node-name, next, previous, up
+@node Keep
@unnumberedsubsubsec Recursive Pattern: @emph{keep}
@cindex Keep, type of recursive pattern
@cindex Recursive pattern: keep
It goes without saying that you need not use @code{nil} as the test for
when to stop; and you can, of course, combine these patterns.
-@node No Deferment, No deferment solution, Recursive Patterns, Recursion
+@node No Deferment
@subsection Recursion without Deferments
@cindex Deferment in recursion
@cindex Recursion without Deferments
steps, as in this example. But it can be a problem when there are
more steps.
-@node No deferment solution, , No Deferment, Recursion
+@node No deferment solution
@subsection No Deferment Solution
@cindex No deferment solution
@cindex Defermentless solution
many resources in a computer.
@need 1500
-@node Looping exercise, , Recursion, Loops & Recursion
+@node Looping exercise
@section Looping Exercise
@itemize @bullet
@end iftex
@end itemize
-@node Regexp Search, Counting Words, Loops & Recursion, Top
-@comment node-name, next, previous, up
+@node Regexp Search
@chapter Regular Expression Searches
@cindex Searches, illustrating
@cindex Regular expression searches
* re-search Exercises::
@end menu
-@node sentence-end, re-search-forward, Regexp Search, Regexp Search
-@comment node-name, next, previous, up
+@node sentence-end
@section The Regular Expression for @code{sentence-end}
@findex sentence-end
@end table
@end ignore
-@node re-search-forward, forward-sentence, sentence-end, Regexp Search
-@comment node-name, next, previous, up
+@node re-search-forward
@section The @code{re-search-forward} Function
@findex re-search-forward
@enumerate
@item
The first argument is the regular expression that the function searches
-for. The regular expression will be a string between quotations marks.
+for. The regular expression will be a string between quotation marks.
@item
The optional second argument limits how far the function will search; it is a
function will return @code{nil}; and the repeat count will be provided
by the argument to the @code{forward-sentence} function.
-@node forward-sentence, forward-paragraph, re-search-forward, Regexp Search
-@comment node-name, next, previous, up
+@node forward-sentence
@section @code{forward-sentence}
@findex forward-sentence
* fwd-sentence re-search:: A regular expression search.
@end menu
-@node Complete forward-sentence, fwd-sentence while loops, forward-sentence, forward-sentence
@ifnottex
+@node Complete forward-sentence
@unnumberedsubsec Complete @code{forward-sentence} function definition
@end ifnottex
equivalents. The @code{sentence-end} variable is set by the
@code{sentence-end} function.
-@node fwd-sentence while loops, fwd-sentence re-search, Complete forward-sentence, forward-sentence
+@node fwd-sentence while loops
@unnumberedsubsec The @code{while} loops
Two @code{while} loops follow. The first @code{while} has a
the @code{forward-sentence} function buried here, but this is a common
way this kind of operation is carried out in Lisp.
-@node fwd-sentence re-search, , fwd-sentence while loops, forward-sentence
+@node fwd-sentence re-search
@unnumberedsubsec The regular expression search
The @code{re-search-forward} function searches for the end of the
test of an @code{if} expression, is handy. You will see or write code
incorporating this pattern often.
-@node forward-paragraph, etags, forward-sentence, Regexp Search
-@comment node-name, next, previous, up
+@node forward-paragraph
@section @code{forward-paragraph}: a Goldmine of Functions
@findex forward-paragraph
* fwd-para while:: The forward motion @code{while} loop.
@end menu
-@node forward-paragraph in brief, fwd-para let, forward-paragraph, forward-paragraph
@ifnottex
+@node forward-paragraph in brief
@unnumberedsubsec Shortened @code{forward-paragraph} function definition
@end ifnottex
@code{forward-sentence} function}.) Now we reach the end of the
familiar part of this function.
-@node fwd-para let, fwd-para while, forward-paragraph in brief, forward-paragraph
+@node fwd-para let
@unnumberedsubsec The @code{let*} expression
The next line of the @code{forward-paragraph} function begins a
negative argument and is therefore moving backwards. We will skip this
section.
-@node fwd-para while, , fwd-para let, forward-paragraph
+@node fwd-para while
@unnumberedsubsec The forward motion @code{while} loop
The second part of the body of the @code{let*} deals with forward
your sources! Without them, you are like a person who tries to drive
a car with his eyes shut!)
-@node etags, Regexp Review, forward-paragraph, Regexp Search
+@node etags
@section Create Your Own @file{TAGS} File
@findex etags
@cindex @file{TAGS} file, create own
The @code{etags} program handles more than 20 languages, including
Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, HTML, Java,
-LaTeX, Pascal, Perl, Postscript, Python, TeX, Texinfo, makefiles, and
+LaTeX, Pascal, Perl, PostScript, Python, TeX, Texinfo, makefiles, and
most assemblers. The program has no switches for specifying the
language; it recognizes the language in an input file according to its
file name and contents.
For more information, see @ref{Tags, , Tag Tables, emacs, The GNU Emacs
Manual}.
-@node Regexp Review, re-search Exercises, etags, Regexp Search
-@comment node-name, next, previous, up
+@node Regexp Review
@section Review
Here is a brief summary of some recently introduced functions.
@end table
@need 1500
-@node re-search Exercises, , Regexp Review, Regexp Search
+@node re-search Exercises
@section Exercises with @code{re-search-forward}
@itemize @bullet
regexps. @xref{the-the, , @code{the-the} Duplicated Words Function}.
@end itemize
-@node Counting Words, Words in a defun, Regexp Search, Top
+@node Counting Words
@chapter Counting: Repetition and Regexps
@cindex Repetition for word counting
@cindex Regular expressions for word counting
* Counting Exercise::
@end menu
-@node Why Count Words, @value{COUNT-WORDS}, Counting Words, Counting Words
@ifnottex
+@node Why Count Words
@unnumberedsec Counting words
@end ifnottex
some examples, which you may wish to compare with the standard Emacs
command, @code{count-words-region}.
-@node @value{COUNT-WORDS}, recursive-count-words, Why Count Words, Counting Words
-@comment node-name, next, previous, up
+@node @value{COUNT-WORDS}
@section The @code{@value{COUNT-WORDS}} Function
@findex @value{COUNT-WORDS}
* Whitespace Bug:: The Whitespace Bug in @code{@value{COUNT-WORDS}}.
@end menu
-@node Design @value{COUNT-WORDS}, Whitespace Bug, @value{COUNT-WORDS}, @value{COUNT-WORDS}
@ifnottex
+@node Design @value{COUNT-WORDS}
@unnumberedsubsec Designing @code{@value{COUNT-WORDS}}
@end ifnottex
@noindent
The buffer's syntax table determines which characters are and are not
-word constituents. (@xref{Syntax, , What Constitutes a Word or
-Symbol?}, for more about syntax. Also, see @ref{Syntax, Syntax, The
-Syntax Table, emacs, The GNU Emacs Manual}, and @ref{Syntax Tables, ,
-Syntax Tables, elisp, The GNU Emacs Lisp Reference Manual}.)
+word constituents. For more information about syntax,
+@pxref{Syntax Tables, , Syntax Tables, elisp, The GNU Emacs Lisp
+Reference Manual}.
@need 800
The search expression looks like this:
@noindent
As written, the function works, but not in all circumstances.
-@node Whitespace Bug, , Design @value{COUNT-WORDS}, @value{COUNT-WORDS}
-@comment node-name, next, previous, up
+@node Whitespace Bug
@subsection The Whitespace Bug in @code{@value{COUNT-WORDS}}
The @code{@value{COUNT-WORDS}} command described in the preceding
@end group
@end smallexample
-@node recursive-count-words, Counting Exercise, @value{COUNT-WORDS}, Counting Words
-@comment node-name, next, previous, up
+@node recursive-count-words
@section Count Words Recursively
@cindex Count words recursively
@cindex Recursively counting words
@end group
@end smallexample
-@node Counting Exercise, , recursive-count-words, Counting Words
+@node Counting Exercise
@section Exercise: Counting Punctuation
Using a @code{while} loop, write a function to count the number of
punctuation marks in a region---period, comma, semicolon, colon,
exclamation mark, and question mark. Do the same using recursion.
-@node Words in a defun, Readying a Graph, Counting Words, Top
+@node Words in a defun
@chapter Counting Words in a @code{defun}
@cindex Counting words in a @code{defun}
@cindex Word counting in a @code{defun}
* Prepare the data:: Prepare the data for display in a graph.
@end menu
-@node Divide and Conquer, Words and Symbols, Words in a defun, Words in a defun
@ifnottex
+@node Divide and Conquer
@unnumberedsec Divide and Conquer
@end ifnottex
This is quite a project! But if we take each step slowly, it will not
be difficult.
-@node Words and Symbols, Syntax, Divide and Conquer, Words in a defun
+@node Words and Symbols
@section What to Count?
@cindex Words and symbols in defun
characters' brings us to the issue of syntax, which is worth a section
of its own.
-@node Syntax, count-words-in-defun, Words and Symbols, Words in a defun
+@node Syntax
@section What Constitutes a Word or Symbol?
@cindex Syntax categories and tables
one syntax category. Other syntax categories include the class of
punctuation characters, such as the period and the comma, and the
class of whitespace characters, such as the blank space and the tab
-character. (For more information, see @ref{Syntax, Syntax, The Syntax
-Table, emacs, The GNU Emacs Manual}, and @ref{Syntax Tables, , Syntax
+character. (For more information, @pxref{Syntax Tables, , Syntax
Tables, elisp, The GNU Emacs Lisp Reference Manual}.)
Syntax tables specify which characters belong to which categories.
most common character within symbols that is not typically a word
constituent character; there are others, too.
-Alternatively, we can redefine the regular expression used in the
+Alternatively, we can redefine the regexp used in the
@code{@value{COUNT-WORDS}} definition so as to include symbols. This
procedure has the merit of clarity, but the task is a little tricky.
"\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*"
@end smallexample
-@node count-words-in-defun, Several defuns, Syntax, Words in a defun
+@node count-words-in-defun
@section The @code{count-words-in-defun} Function
@cindex Counting words in a @code{defun}
jumps. The true-or-false-test for the @code{while} loop should test
true so long as point should jump forward, and false when point is at
the end of the definition. We have already redefined the regular
-expression for this (@pxref{Syntax}), so the loop is straightforward:
+expression for this, so the loop is straightforward:
@smallexample
@group
(while (and (< (point) end)
(re-search-forward
- "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" end t)
+ "\\(\\w\\|\\s_\\)+[^ \t\n]*[ \t\n]*" end t))
(setq count (1+ count)))
@end group
@end smallexample
The next problem is to count the numbers of words and symbols in
several definitions within a single file.
-@node Several defuns, Find a File, count-words-in-defun, Words in a defun
+@node Several defuns
@section Count Several @code{defuns} Within a File
A file such as @file{simple.el} may have a hundred or more function
Finding a file is a new process that we have not yet discussed.
-@node Find a File, lengths-list-file, Several defuns, Words in a defun
-@comment node-name, next, previous, up
+@node Find a File
@section Find a File
@cindex Find a File
The task is easy: use @code{find-file-noselect} and @code{set-buffer}.
-@node lengths-list-file, Several files, Find a File, Words in a defun
+@node lengths-list-file
@section @code{lengths-list-file} in Detail
The core of the @code{lengths-list-file} function is a @code{while}
don't see anything going on, the first line of the body is a
message.
-The next line contains a @code{save-excursion} that returns Emacs'
+The next line contains a @code{save-excursion} that returns Emacs's
attention to the current buffer when the function completes. This is
useful in case you embed this function in another function that
presumes point is restored to the original buffer.
Note that the length of the last definition in the file is first in
the list.
-@node Several files, Several files recursively, lengths-list-file, Words in a defun
+@node Several files
@section Count Words in @code{defuns} in Different Files
In the previous section, we created a function that returns a list of
* append:: Attach one list to another.
@end menu
-@node lengths-list-many-files, append, Several files, Several files
@ifnottex
+@node lengths-list-many-files
@unnumberedsubsec Determine the lengths of @code{defuns}
@end ifnottex
unstudied function @code{append}, which merits a short section for
itself.
-@node append, , lengths-list-many-files, Several files
+@node append
@subsection The @code{append} Function
@need 800
((1 2 3 4) 5 6 7 8)
@end smallexample
-@node Several files recursively, Prepare the data, Several files, Words in a defun
+@node Several files recursively
@section Recursively Count Words in Different Files
Besides a @code{while} loop, you can work on each of a list of files
The next step is to prepare the data in the list for display in a graph.
-@node Prepare the data, , Several files recursively, Words in a defun
+@node Prepare the data
@section Prepare the Data for Display in a Graph
The @code{recursive-lengths-list-many-files} function returns a list
* Counting function definitions::
@end menu
-@node Data for Display in Detail, Sorting, Prepare the data, Prepare the data
@ifnottex
+@node Data for Display in Detail
@unnumberedsubsec The Data for Display in Detail
@end ifnottex
number, and thereby determine the largest and smallest length range
that we will need.
-@node Sorting, Files List, Data for Display in Detail, Prepare the data
+@node Sorting
@subsection Sorting Lists
@findex sort
quoted, since the expression must be evaluated so as to produce the
list that is passed to @code{sort}.)
-@node Files List, Counting function definitions, Sorting, Prepare the data
+@node Files List
@subsection Making a List of Files
The @code{recursive-lengths-list-many-files} function requires a list
(insert (format "%s" (current-time-string))))
@end ignore
-@node Counting function definitions, , Files List, Prepare the data
+@node Counting function definitions
@subsection Counting function definitions
Our immediate goal is to generate a list that tells us how many
of 200 or larger.
@c The next step is to turn this numbers' list into a graph.
-@node Readying a Graph, Emacs Initialization, Words in a defun, Top
+@node Readying a Graph
@chapter Readying a Graph
@cindex Readying a graph
@cindex Graph prototype
* Line Graph Exercise::
@end menu
-@node Columns of a graph, graph-body-print, Readying a Graph, Readying a Graph
@ifnottex
+@node Columns of a graph
@unnumberedsec Printing the Columns of a Graph
@end ifnottex
This prints the body of a graph, not the labels for the vertical and
horizontal axes, so we can call this @code{graph-body-print}.
-@node graph-body-print, recursive-graph-body-print, Columns of a graph, Readying a Graph
+@node graph-body-print
@section The @code{graph-body-print} Function
@findex graph-body-print
@end group
@end smallexample
-@node recursive-graph-body-print, Printed Axes, graph-body-print, Readying a Graph
+@node recursive-graph-body-print
@section The @code{recursive-graph-body-print} Function
@findex recursive-graph-body-print
Either of these two functions, @code{graph-body-print} or
@code{recursive-graph-body-print}, create the body of a graph.
-@node Printed Axes, Line Graph Exercise, recursive-graph-body-print, Readying a Graph
+@node Printed Axes
@section Need for Printed Axes
A graph needs printed axes, so you can orient yourself. For a do-once
-project, it may be reasonable to draw the axes by hand using Emacs'
+project, it may be reasonable to draw the axes by hand using Emacs's
Picture mode; but a graph drawing function may be used more than once.
For this reason, I have written enhancements to the basic
@code{print-graph-body} function that automatically print labels for
the horizontal and vertical axes. Since the label printing functions
do not contain much new material, I have placed their description in
-an appendix. @xref{Full Graph, , A Graph with Labelled Axes}.
+an appendix. @xref{Full Graph, , A Graph with Labeled Axes}.
-@node Line Graph Exercise, , Printed Axes, Readying a Graph
+@node Line Graph Exercise
@section Exercise
Write a line graph version of the graph printing functions.
-@node Emacs Initialization, Debugging, Readying a Graph, Top
+@node Emacs Initialization
@chapter Your @file{.emacs} File
@cindex @file{.emacs} file
@cindex Customizing your @file{.emacs} file
* Mode Line:: How to customize your mode line.
@end menu
-@node Default Configuration, Site-wide Init, Emacs Initialization, Emacs Initialization
@ifnottex
-@unnumberedsec Emacs' Default Configuration
+@node Default Configuration
+@unnumberedsec Emacs's Default Configuration
@end ifnottex
-There are those who appreciate Emacs' default configuration. After
+There are those who appreciate Emacs's default configuration. After
all, Emacs starts you in C mode when you edit a C file, starts you in
Fortran mode when you edit a Fortran file, and starts you in
Fundamental mode when you edit an unadorned file. This all makes
naming conventions; the old format saves typing.}
A @file{~/.emacs} file contains Emacs Lisp code. You can write this
-code yourself; or you can use Emacs' @code{customize} feature to write
+code yourself; or you can use Emacs's @code{customize} feature to write
the code for you. You can combine your own expressions and
auto-written Customize expressions in your @file{.emacs} file.
@ref{Init File, , The Init File, elisp, The GNU Emacs Lisp Reference
Manual}.
-@node Site-wide Init, defcustom, Default Configuration, Emacs Initialization
+@node Site-wide Init
@section Site-wide Initialization Files
@cindex @file{default.el} init file
what to put into your own @file{.emacs} file, or into a site-wide
initialization file.
-@node defcustom, Beginning a .emacs File, Site-wide Init, Emacs Initialization
+@node defcustom
@section Specifying Variables using @code{defcustom}
@findex defcustom
You can specify variables using @code{defcustom} so that you and
-others can then use Emacs' @code{customize} feature to set their
+others can then use Emacs's @code{customize} feature to set their
values. (You cannot use @code{customize} to write function
definitions; but you can write @code{defuns} in your @file{.emacs}
file. Indeed, you can write any Lisp expression in your @file{.emacs}
set by @code{defconst}. (You can change it; the value set is a
variable; but please do not.)
-@node Beginning a .emacs File, Text and Auto-fill, defcustom, Emacs Initialization
+@node Beginning a .emacs File
@section Beginning a @file{.emacs} File
@cindex @file{.emacs} file, beginning of
about Mode help or the conventions for comments---but I was able to
remember to look here to remind myself.
-@node Text and Auto-fill, Mail Aliases, Beginning a .emacs File, Emacs Initialization
+@node Text and Auto-fill
@section Text and Auto Fill Mode
Now we come to the part that `turns on' Text mode and
(setq colon-double-space t)
@end smallexample
-@node Mail Aliases, Indent Tabs Mode, Text and Auto-fill, Emacs Initialization
+@node Mail Aliases
@section Mail Aliases
Here is a @code{setq} that `turns on' mail aliases, along with more
When you write a message to George, address it to @samp{geo}; the
mailer will automatically expand @samp{geo} to the full address.
-@node Indent Tabs Mode, Keybindings, Mail Aliases, Emacs Initialization
+@node Indent Tabs Mode
@section Indent Tabs Mode
@cindex Tabs, preventing
@findex indent-tabs-mode
@end iftex
@need 1700
-@node Keybindings, Keymaps, Indent Tabs Mode, Emacs Initialization
+@node Keybindings
@section Some Keybindings
Now for some personal keybindings:
command, which not only lists the buffers,
but moves point into that window.
-@node Keymaps, Loading Files, Keybindings, Emacs Initialization
+@node Keymaps
@section Keymaps
@cindex Keymaps
@cindex Rebinding keys
Manual}, and @ref{Keymaps, , Keymaps, elisp, The GNU Emacs Lisp
Reference Manual}, for more information about keymaps.
-@node Loading Files, Autoload, Keymaps, Emacs Initialization
+@node Loading Files
@section Loading Files
@cindex Loading files
@c findex load
@vindex load-path
If you load many extensions, as I do, then instead of specifying the
exact location of the extension file, as shown above, you can specify
-that directory as part of Emacs' @code{load-path}. Then, when Emacs
+that directory as part of Emacs's @code{load-path}. Then, when Emacs
loads a file, it will search that directory as well as its default
list of directories. (The default list is specified in @file{paths.h}
when Emacs is built.)
Emacs, emacs, The GNU Emacs Manual}, for information on the
distinction between @code{load-library} and this command.
-@node Autoload, Simple Extension, Loading Files, Emacs Initialization
+@node Autoload
@section Autoloading
@findex autoload
@xref{Autoload, , Autoload, elisp, The GNU Emacs Lisp Reference
Manual}, for more information.
-@node Simple Extension, X11 Colors, Autoload, Emacs Initialization
+@node Simple Extension
@section A Simple Extension: @code{line-to-top-of-window}
@findex line-to-top-of-window
@cindex Simple extension in @file{.emacs} file
@end group
@end smallexample
-For example, in contrast to version 20, more recent versions blink
+For example, recent versions blink
their cursors by default. I hate such blinking, as well as other
features, so I placed the following in my @file{.emacs}
file@footnote{When I start instances of Emacs that do not load my
@end group
@end smallexample
-@node X11 Colors, Miscellaneous, Simple Extension, Emacs Initialization
+@node X11 Colors
@section X11 Colors
You can specify colors when you use Emacs with the MIT X Windowing
@end smallexample
@need 1700
-@node Miscellaneous, Mode Line, X11 Colors, Emacs Initialization
+@node Miscellaneous
@section Miscellaneous Settings for a @file{.emacs} File
@need 1250
@end smallexample
@need 1700
-@node Mode Line, , Miscellaneous, Emacs Initialization
+@node Mode Line
@section A Modified Mode Line
@vindex mode-line-format
@cindex Mode line format
@file{~/.emacs} initialization file. A plain, default Emacs. Nothing
more.
-@node Debugging, Conclusion, Emacs Initialization, Top
+@node Debugging
@chapter Debugging
@cindex debugging
* Debugging Exercises::
@end menu
-@node debug, debug-on-entry, Debugging, Debugging
+@node debug
@section @code{debug}
@findex debug
You can correct the mistake, re-evaluate the function definition, and
then run your test again.
-@node debug-on-entry, debug-on-quit, debug, Debugging
+@node debug-on-entry
@section @code{debug-on-entry}
@findex debug-on-entry
@noindent
(If you are reading this in Info, cancel @code{debug-on-entry} now.)
-@node debug-on-quit, edebug, debug-on-entry, Debugging
+@node debug-on-quit
@section @code{debug-on-quit} and @code{(debug)}
In addition to setting @code{debug-on-error} or calling @code{debug-on-entry},
The @code{debug} function is described in detail in @ref{Debugger, ,
The Lisp Debugger, elisp, The GNU Emacs Lisp Reference Manual}.
-@node edebug, Debugging Exercises, debug-on-quit, Debugging
+@node edebug
@section The @code{edebug} Source Level Debugger
@cindex Source level debugger
@findex edebug
Lisp Reference Manual}.
@need 1500
-@node Debugging Exercises, , edebug, Debugging
+@node Debugging Exercises
@section Debugging Exercises
@itemize @bullet
stopping point.
@end itemize
-@node Conclusion, the-the, Debugging, Top
+@node Conclusion
@chapter Conclusion
We have now reached the end of this Introduction. You have now
@c ================ Appendix ================
-@node the-the, Kill Ring, Conclusion, Top
+@node the-the
@appendix The @code{the-the} Function
@findex the-the
@cindex Duplicated words function
You can substitute the other regular expressions shown above in the
function definition and try each of them on this list.
-@node Kill Ring, Full Graph, the-the, Top
+@node Kill Ring
@appendix Handling the Kill Ring
@cindex Kill ring handling
@cindex Handling the kill ring
* ring file::
@end menu
-@node What the Kill Ring Does, current-kill, Kill Ring, Kill Ring
@ifnottex
+@node What the Kill Ring Does
@unnumberedsec What the Kill Ring Does
@end ifnottex
(setq kill-ring-max old-kill-ring-max)
@end smallexample
-@node current-kill, yank, What the Kill Ring Does, Kill Ring
-@comment node-name, next, previous, up
+@node current-kill
@appendixsec The @code{current-kill} Function
@findex current-kill
* Understanding current-kill::
@end menu
-@node Code for current-kill, Understanding current-kill, current-kill, current-kill
@ifnottex
+@node Code for current-kill
@unnumberedsubsec The code for @code{current-kill}
@end ifnottex
(setq kill-ring-yank-pointer kill-ring)
@end smallexample
-@node Understanding current-kill, , Code for current-kill, current-kill
@ifnottex
+@node Understanding current-kill
@unnumberedsubsec @code{current-kill} in Outline
@end ifnottex
* Determining the Element::
@end menu
-@node Body of current-kill, Digression concerning error, Understanding current-kill, Understanding current-kill
@ifnottex
+@node Body of current-kill
@unnumberedsubsubsec The Body of @code{current-kill}
@end ifnottex
list. Finally, another expression returns the first element of the
list even if the @code{do-not-move} argument is true.
-@node Digression concerning error, Determining the Element, Body of current-kill, Understanding current-kill
@ifnottex
+@node Digression concerning error
@unnumberedsubsubsec Digression about the word `error'
@end ifnottex
exploration.
From the human point of view, the act of exploration and discovery is
-not necessarily an error, and therefore should not be labelled as one,
+not necessarily an error, and therefore should not be labeled as one,
even in the bowels of a computer. As it is, the code in Emacs implies
that a human who is acting virtuously, by exploring his or her
environment, is making an error. This is bad. Even though the computer
takes the same steps as it does when there is an `error', a term such as
`cancel' would have a clearer connotation.
-@node Determining the Element, , Digression concerning error, Understanding current-kill
@ifnottex
+@node Determining the Element
@unnumberedsubsubsec Determining the Element
@end ifnottex
@ref{defun, , The @code{defun} Special Form}.)
@end ignore
-@node yank, yank-pop, current-kill, Kill Ring
-@comment node-name, next, previous, up
+@node yank
@appendixsec @code{yank}
@findex yank
The last part of the function tells what to do when it succeeds.
-@node yank-pop, ring file, yank, Kill Ring
-@comment node-name, next, previous, up
+@node yank-pop
@appendixsec @code{yank-pop}
@findex yank-pop
There is more, but that is the hardest part.
-@node ring file, , yank-pop, Kill Ring
-@comment node-name, next, previous, up
+@node ring file
@appendixsec The @file{ring.el} File
@cindex @file{ring.el} file
as @code{kill-ring-yank-pointer} do not use this library, possibly
because they were written earlier.
-@node Full Graph, Free Software and Free Manuals, Kill Ring, Top
-@appendix A Graph with Labelled Axes
+@node Full Graph
+@appendix A Graph with Labeled Axes
Printed axes help you understand a graph. They convey scale. In an
earlier chapter (@pxref{Readying a Graph, , Readying a Graph}), we
wrote the code to print the body of a graph. Here we write the code
-for printing and labelling vertical and horizontal axes, along with the
+for printing and labeling vertical and horizontal axes, along with the
body itself.
@menu
-* Labelled Example::
+* Labeled Example::
* print-graph Varlist:: @code{let} expression in @code{print-graph}.
* print-Y-axis:: Print a label for the vertical axis.
* print-X-axis:: Print a horizontal label.
* Print Whole Graph:: The function to print a complete graph.
@end menu
-@node Labelled Example, print-graph Varlist, Full Graph, Full Graph
@ifnottex
-@unnumberedsec Labelled Example Graph
+@node Labeled Example
+@unnumberedsec Labeled Example Graph
@end ifnottex
Since insertions fill a buffer to the right and below point, the new
@end smallexample
@noindent
-In this graph, both the vertical and the horizontal axes are labelled
+In this graph, both the vertical and the horizontal axes are labeled
with numbers. However, in some graphs, the horizontal axis is time
-and would be better labelled with months, like this:
+and would be better labeled with months, like this:
@smallexample
@group
@end smallexample
Indeed, with a little thought, we can easily come up with a variety of
-vertical and horizontal labelling schemes. Our task could become
+vertical and horizontal labeling schemes. Our task could become
complicated. But complications breed confusion. Rather than permit
-this, it is better choose a simple labelling scheme for our first
+this, it is better choose a simple labeling scheme for our first
effort, and to modify or replace it later.
@need 1200
We can work on each part of the @code{print-graph} function definition
in turn.
-@node print-graph Varlist, print-Y-axis, Labelled Example, Full Graph
-@comment node-name, next, previous, up
+@node print-graph Varlist
@appendixsec The @code{print-graph} Varlist
@cindex @code{print-graph} varlist
As we shall see, this expression is not quite right.
@need 2000
-@node print-Y-axis, print-X-axis, print-graph Varlist, Full Graph
-@comment node-name, next, previous, up
+@node print-Y-axis
@appendixsec The @code{print-Y-axis} Function
@cindex Axis, print vertical
@cindex Y axis printing
* print-Y-axis Penultimate:: A not quite final version.
@end menu
-@node print-Y-axis in Detail, Height of label, print-Y-axis, print-Y-axis
@ifnottex
+@node print-Y-axis in Detail
@unnumberedsubsec The @code{print-Y-axis} Function in Detail
@end ifnottex
the fifth line from the bottom and on every line that is a multiple of
five.
-@node Height of label, Compute a Remainder, print-Y-axis in Detail, print-Y-axis
@ifnottex
+@node Height of label
@unnumberedsubsec What height should the label be?
@end ifnottex
once, with a remainder of two. However, five goes into ten twice,
with no remainder: ten is an integral multiple of five.
-@node Compute a Remainder, Y Axis Element, Height of label, print-Y-axis
+@node Compute a Remainder
@appendixsubsec Side Trip: Compute a Remainder
@findex % @r{(remainder function)}
final value. @xref{fwd-para let, , The @code{let*} expression}, for
more about @code{let*}.)
-@node Y Axis Element, Y-axis-column, Compute a Remainder, print-Y-axis
+@node Y Axis Element
@appendixsubsec Construct a Y Axis Element
When we print the vertical axis, we want to insert strings such as
expression, to convert the number to a string that is concatenated
with the leading spaces and the tic mark.
-@node Y-axis-column, print-Y-axis Penultimate, Y Axis Element, print-Y-axis
+@node Y-axis-column
@appendixsubsec Create a Y Axis Column
The preceding functions provide all the tools needed to construct a
consists of the number one followed by a tic mark.
@need 2000
-@node print-Y-axis Penultimate, , Y-axis-column, print-Y-axis
+@node print-Y-axis Penultimate
@appendixsubsec The Not Quite Final Version of @code{print-Y-axis}
The list constructed by the @code{Y-axis-column} function is passed to
thereby getting rid of what might appear as a bug.)
@need 2000
-@node print-X-axis, Print Whole Graph, print-Y-axis, Full Graph
+@node print-X-axis
@appendixsec The @code{print-X-axis} Function
@cindex Axis, print horizontal
@cindex X axis printing
The value of the variable @code{X-axis-label-spacing} should itself be
measured in units of @code{symbol-width}, since you may want to change
the width of the symbols that you are using to print the body of the
-graph without changing the ways the graph is labelled.
+graph without changing the ways the graph is labeled.
@menu
* Similarities differences:: Much like @code{print-Y-axis}, but not exactly.
* X Axis Tic Marks:: Create tic marks for the horizontal axis.
@end menu
-@node Similarities differences, X Axis Tic Marks, print-X-axis, print-X-axis
@ifnottex
+@node Similarities differences
@unnumberedsubsec Similarities and differences
@end ifnottex
@code{print-X-axis-numbered-line}.
@end enumerate
-@node X Axis Tic Marks, , Similarities differences, print-X-axis
+@node X Axis Tic Marks
@appendixsubsec X Axis Tic Marks
The first function should print the X axis tic marks. We must specify
@end group
@end smallexample
-@node Print Whole Graph, , print-X-axis, Full Graph
+@node Print Whole Graph
@appendixsec Printing the Whole Graph
@cindex Printing the whole graph
@cindex Whole graph printing
Now we are nearly ready to print the whole graph.
The function to print the graph with the proper labels follows the
-outline we created earlier (@pxref{Full Graph, , A Graph with Labelled
+outline we created earlier (@pxref{Full Graph, , A Graph with Labeled
Axes}), but with additions.
@need 1250
* Final printed graph:: The graph itself!
@end menu
-@node The final version, Test print-graph, Print Whole Graph, Print Whole Graph
@ifnottex
+@node The final version
@unnumberedsubsec Changes for the Final Version
@end ifnottex
;;; @r{Final version.}
(defun print-graph
(numbers-list &optional vertical-step)
- "Print labelled bar graph of the NUMBERS-LIST.
+ "Print labeled bar graph of the NUMBERS-LIST.
The numbers-list consists of the Y-axis values.
@end group
@end group
@end smallexample
-@node Test print-graph, Graphing words in defuns, The final version, Print Whole Graph
+@node Test print-graph
@appendixsubsec Testing @code{print-graph}
@need 1250
feature? If you think it is a bug, and should be a `1' instead, (or
even a `0'), you can modify the sources.)
-@node Graphing words in defuns, lambda, Test print-graph, Print Whole Graph
+@node Graphing words in defuns
@appendixsubsec Graphing Numbers of Words and Symbols
Now for the graph for which all this code was written: a graph that
@end group
@end smallexample
-@node lambda, mapcar, Graphing words in defuns, Print Whole Graph
+@node lambda
@appendixsubsec A @code{lambda} Expression: Useful Anonymity
@cindex Anonymous function
@findex lambda
Lisp Reference Manual}, for more about @code{lambda}. Lisp and lambda
expressions derive from the Lambda Calculus.
-@node mapcar, Another Bug, lambda, Print Whole Graph
+@node mapcar
@appendixsubsec The @code{mapcar} Function
@findex mapcar
50 defuns had that many words or symbols---but not necessarily meaning
that none had that many words or symbols.)
-@node Another Bug, Final printed graph, mapcar, Print Whole Graph
+@node Another Bug
@appendixsubsec Another Bug @dots{} Most Insidious
@cindex Bug, most insidious type
@cindex Insidious type of bug
@group
(defun print-graph
(numbers-list &optional vertical-step horizontal-step)
- "Print labelled bar graph of the NUMBERS-LIST.
+ "Print labeled bar graph of the NUMBERS-LIST.
The numbers-list consists of the Y-axis values.
@end group
@group
(defun print-graph
(numbers-list &optional vertical-step horizontal-step)
- "Print labelled bar graph of the NUMBERS-LIST.
+ "Print labeled bar graph of the NUMBERS-LIST.
The numbers-list consists of the Y-axis values.
@end group
@end ignore
@page
-@node Final printed graph, , Another Bug, Print Whole Graph
+@node Final printed graph
@appendixsubsec The Printed Graph
When made and installed, you can call the @code{print-graph} command
@noindent
The largest group of functions contain 10 -- 19 words and symbols each.
-@node Free Software and Free Manuals, GNU Free Documentation License, Full Graph, Top
+@node Free Software and Free Manuals
@appendix Free Software and Free Manuals
@strong{by Richard M. Stallman}
that lists free books available from other publishers:@*
@uref{http://www.gnu.org/doc/other-free-books.html}
-@node GNU Free Documentation License, Index, Free Software and Free Manuals, Top
+@node GNU Free Documentation License
@appendix GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@include doclicense.texi
-@node Index, About the Author, GNU Free Documentation License, Top
-@comment node-name, next, previous, up
+@node Index
@unnumbered Index
@ignore
@end iftex
@ifnottex
-@node About the Author, , Index, Top
+@node About the Author
@unnumbered About the Author
@end ifnottex
@c @end iftex
@bye
-