\input texinfo @c -*-texinfo-*-
@comment %**start of header
@setfilename ../info/eintr
+@c setfilename emacs-lisp-intro.info
@c sethtmlfilename emacs-lisp-intro.html
@settitle Programming in Emacs Lisp
@syncodeindex vr cp
@comment %**end of header
-@set edition-number 2.10
-@set update-date 2003 July 15
+@set edition-number 2.14
+@set update-date 2004 Oct 12
@ignore
## Summary of shell commands to create various output formats:
+ pushd /usr/local/src/emacs/lispintro/
+
## Info output
makeinfo --no-split --paragraph-indent=0 --verbose emacs-lisp-intro.texi
## View Info output with standalone reader
info emacs-lisp-intro.info
+ ## popd
+
@end ignore
@c ================ Included Figures ================
Edition @value{edition-number}, @value{update-date}
@sp 1
Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2001,
-2002, 2003 Free Software Foundation, Inc.
+2002, 2003, 2004 Free Software Foundation, Inc.
@sp 1
@iftex
@chapter List Processing
To the untutored eye, Lisp is a strange programming language. In Lisp
-code there are parentheses everywhere. Some people even claim that the
-name stands for `Lots of Isolated Silly Parentheses'. But the claim is
-unwarranted. Lisp stands for LISt Processing, and the programming
-language handles @emph{lists} (and lists of lists) by putting them
-between parentheses. The parentheses mark the boundaries of the list.
-Sometimes a list is preceded by a single apostrophe or quotation mark,
-@samp{'}. Lists are the basis of Lisp.
+code there are parentheses everywhere. Some people even claim that
+the name stands for `Lots of Isolated Silly Parentheses'. But the
+claim is unwarranted. Lisp stands for LISt Processing, and the
+programming language handles @emph{lists} (and lists of lists) by
+putting them between parentheses. The parentheses mark the boundaries
+of the list. Sometimes a list is preceded by a single apostrophe or
+quotation mark, @samp{'}@footnote{The single apostrophe or quotation
+mark is an abbreviation for the function @code{quote}; you need not
+think about functions now; functions are defined in @ref{Making
+Errors, , Generate an Error Message}.} Lists are the basis of Lisp.
@menu
* Lisp Lists:: What are lists?
@need 1250
As usual, the error message tries to be helpful and makes sense after you
-learn how to read it.
+learn how to read it.@footnote{@code{(quote hello)} is an expansion of
+the abbreviation @code{'hello}.}
The first part of the error message is straightforward; it says
@samp{wrong type argument}. Next comes the mysterious jargon word
Alternatively, if the special letter-codes are not right for your
application, you can pass your own arguments to @code{interactive} as
-a list. @xref{interactive, , Using @code{Interactive}, elisp, The
+a list. @xref{Using Interactive, , Using @code{Interactive}, elisp, The
GNU Emacs Lisp Reference Manual}, for more information about this advanced
technique.
false. When this happens, the second argument or then-part of the
overall @code{if} expression is @emph{not} evaluated, but the third or
else-part @emph{is} evaluated. You might think of this as the cloudy
-day alternative for the decision `if it is warm and sunny, then go to
+day alternative for the decision ``if it is warm and sunny, then go to
the beach, else read a book!''.
The word ``else'' is not written in the Lisp code; the else-part of an
expression:
@smallexample
-(* (buffer-size) (prefix-numeric-value arg)
+(* (buffer-size) (prefix-numeric-value arg))
@end smallexample
@noindent
variables that you do expect a user to change. Although you can still
use @code{defvar} for user customizable variables, please use
@code{defcustom} instead, since that special form provides a path into
-the Customization commands. (@xref{defcustom, , Setting Variables
-with @code{defcustom}}.)
+the Customization commands. (@xref{defcustom, , Specifying Variables
+using @code{defcustom}}.)
When you specified a variable using the @code{defvar} special form,
you could distinguish a readily settable variable from others by
@end group
@end smallexample
+@findex set-variable
@noindent
-This means that you could (and still can) use the @code{edit-options}
-command to change the value of
-@code{shell-command-default-error-buffer} temporarily.
-
-@findex edit-options
-However, options set using @code{edit-options} are set only for the
-duration of your editing session. The new values are not saved
-between sessions. Each time Emacs starts, it reads the original
+You could (and still can) use the @code{set-variable} command to
+change the value of @code{shell-command-default-error-buffer}
+temporarily. However, options set using @code{set-variable} are set
+only for the duration of your editing session. The new values are not
+saved between sessions. Each time Emacs starts, it reads the original
value, unless you change the value within your @file{.emacs} file,
either by setting it manually or by using @code{customize}.
@xref{Emacs Initialization, , Your @file{.emacs} File}.
-For me, the major use of the @code{edit-options} command is to suggest
-variables that I might want to set in my @file{.emacs} file. I urge
-you to look through the list. (@xref{Edit Options, , Editing Variable
-Values, emacs, The GNU Emacs Manual}.)
+For me, the major use of the @code{set-variable} command is to suggest
+variables that I might want to set in my @file{.emacs} file. There
+are now more than 700 such variables --- far too many to remember
+readily. Fortunately, you can press @key{TAB} after calling the
+@code{M-x set-variable} command to see the list of variables.
+(@xref{Examining, , Examining and Setting Variables, emacs,
+The GNU Emacs Manual}.)
@node copy-region-as-kill, cons & search-fwd Review, defvar, Cutting & Storing Text
@comment node-name, next, previous, up
and the second of which holds the address of @code{buttercup}.
A pair of address-boxes is called a @dfn{cons cell} or @dfn{dotted
-pair}. @xref{List Type, , List Type , elisp, The GNU Emacs Lisp
+pair}. @xref{Cons Cell Type, , Cons Cell and List Types, elisp, The GNU Emacs Lisp
Reference Manual}, and @ref{Dotted Pair Notation, , Dotted Pair
Notation, elisp, The GNU Emacs Lisp Reference Manual}, for more
information about cons cells and dotted pairs.
@end smallexample
@noindent
-(@xref{defcustom, , Setting Variables with @code{defcustom}}.
+(@xref{defcustom, , Specifying Variables using @code{defcustom}}.)
Then evaluate the @code{lengths-list-file} expression.)
@need 1200
((eq t (car (cdr (car current-directory-list))))
;; decide whether to skip or recurse
(if
- (equal (or "." "..")
+ (equal "."
(substring (car (car current-directory-list)) -1))
- ;; then do nothing if filename is that of
- ;; current directory or parent
+ ;; then do nothing since filename is that of
+ ;; current directory or parent, "." or ".."
()
@end group
@group
The name of the variable is @code{text-mode-hook}; it has no default
value; and its documentation string tells you what it does.
-The @code{:type} keyword tells Emacs what kind of data
-@code{text-mode-hook} should be set to and how to display the value in
-a Customization buffer.
+The @code{:type} keyword tells Emacs the kind of data to which
+@code{text-mode-hook} should be set and how to display the value in a
+Customization buffer.
The @code{:options} keyword specifies a suggested list of values for
the variable. Currently, you can use @code{:options} only for a hook.
@item Ignore case when using `grep'@*
@samp{-n}@w{ } Prefix each line of output with line number@*
@samp{-i}@w{ } Ignore case distinctions@*
-@samp{-e}@w{ } Protect patterns beginning with a hyphen character, @samp{-}
+@samp{-e}@w{ } Protect patterns beginning with a hyphen character, @samp{-}
@smallexample
(setq grep-command "grep -n -i -e ")
@end itemize
@subsubheading Fixing Unpleasant Key Bindings
-@cindex Key bindings, fixing
+@cindex Key bindings, fixing
@cindex Bindings, key, fixing unpleasant
Some systems bind keys unpleasantly. Sometimes, for example, the
Sometimes when you you write text, you duplicate words---as with ``you
you'' near the beginning of this sentence. I find that most
-frequently, I duplicate ``the'; hence, I call the function for
+frequently, I duplicate ``the''; hence, I call the function for
detecting duplicated words, @code{the-the}.
@need 1250
@end smallexample
@end ifnottex
+@c qqq
@ignore
Graphing Definitions Re-listed
(print-X-axis numbers-list horizontal-step)))
@end group
@end smallexample
+@c qqq
@end ignore
@page