[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107964: More small edits for doc/
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107964: More small edits for doc/lispref |
Date: |
Fri, 04 May 2012 20:37:30 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107964
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-05-04 20:37:30 -0400
message:
More small edits for doc/lispref
* control.texi: Where possible, use example rather than smallexample.
(Sequencing, Conditionals, Signaling Errors, Handling Errors):
Tweak page breaks.
* customize.texi: Where possible, use example rather than smallexample.
(Common Keywords, Variable Definitions, Applying Customizations)
(Custom Themes): Tweak page breaks.
* eval.texi, functions.texi, loading.texi, macros.texi:
Where possible, use example rather than smallexample.
* sequences.texi (Arrays): Tweak page breaks.
* symbols.texi: Where possible, use example rather than smallexample.
(Symbol Components): Fix typo.
(Other Plists): Tweak page break.
modified:
doc/lispref/ChangeLog
doc/lispref/control.texi
doc/lispref/customize.texi
doc/lispref/eval.texi
doc/lispref/functions.texi
doc/lispref/loading.texi
doc/lispref/macros.texi
doc/lispref/sequences.texi
doc/lispref/symbols.texi
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2012-05-04 07:38:33 +0000
+++ b/doc/lispref/ChangeLog 2012-05-05 00:37:30 +0000
@@ -1,3 +1,22 @@
+2012-05-05 Glenn Morris <address@hidden>
+
+ * eval.texi, functions.texi, loading.texi, macros.texi:
+ Where possible, use example rather than smallexample.
+
+ * symbols.texi: Where possible, use example rather than smallexample.
+ (Symbol Components): Fix typo.
+ (Other Plists): Tweak page break.
+
+ * sequences.texi (Arrays): Tweak page breaks.
+
+ * customize.texi: Where possible, use example rather than smallexample.
+ (Common Keywords, Variable Definitions, Applying Customizations)
+ (Custom Themes): Tweak page breaks.
+
+ * control.texi: Where possible, use example rather than smallexample.
+ (Sequencing, Conditionals, Signaling Errors, Handling Errors):
+ Tweak page breaks.
+
2012-05-04 Glenn Morris <address@hidden>
* lists.texi (List-related Predicates, List Variables):
=== modified file 'doc/lispref/control.texi'
--- a/doc/lispref/control.texi 2012-04-26 00:31:47 +0000
+++ b/doc/lispref/control.texi 2012-05-05 00:37:30 +0000
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
address@hidden Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software
Foundation, Inc.
address@hidden Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software
Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/control
@node Control Structures, Variables, Evaluation, Top
@@ -94,8 +94,8 @@
@end example
@end defspec
- Two other control constructs likewise evaluate a series of forms but return
-a different value:
+ Two other constructs likewise evaluate a series of forms but return
+different values:
@defspec prog1 form1 address@hidden
This special form evaluates @var{form1} and all of the @var{forms}, in
@@ -160,8 +160,8 @@
given, @code{if} returns @code{nil}.
@code{if} is a special form because the branch that is not selected is
-never evaluated---it is ignored. Thus, in the example below,
address@hidden is not printed because @code{print} is never called.
+never evaluated---it is ignored. Thus, in this example,
address@hidden is not printed because @code{print} is never called:
@example
@group
@@ -258,9 +258,7 @@
@var{condition} of the last clause, like this: @code{(t
@var{body-forms})}. The form @code{t} evaluates to @code{t}, which is
never @code{nil}, so this clause never fails, provided the @code{cond}
-gets to it at all.
-
-For example,
+gets to it at all. For example:
@example
@group
@@ -812,10 +810,10 @@
variable to a list of the form @code{(@var{error-symbol} .@:
@var{data})} (@pxref{Handling Errors}).
-The function @code{signal} never returns (though in older Emacs versions
-it could sometimes return).
+The function @code{signal} never returns.
address@hidden (though in older Emacs versions it sometimes could).
address@hidden
address@hidden
@group
(signal 'wrong-number-of-arguments '(x y))
@error{} Wrong number of arguments: x, y
@@ -825,7 +823,7 @@
(signal 'no-such-error '("My unknown error condition"))
@error{} peculiar error: "My unknown error condition"
@end group
address@hidden smallexample
address@hidden example
@end defun
@cindex CL note---no continuable errors
@@ -991,7 +989,7 @@
Lisp expressions to be executed when this handler handles an error.
Here are examples of handlers:
address@hidden
address@hidden
@group
(error nil)
@@ -1001,7 +999,7 @@
(message
"Either division by zero or failure to open a file"))
@end group
address@hidden smallexample
address@hidden example
Each error that occurs has an @dfn{error symbol} that describes what
kind of error it is. The @code{error-conditions} property of this
@@ -1034,9 +1032,9 @@
@code{condition-case}, for some outer-level handler to catch. Here's
how to do that:
address@hidden
address@hidden
(signal (car err) (cdr err))
address@hidden smallexample
address@hidden example
@noindent
where @code{err} is the error description variable, the first argument
@@ -1055,7 +1053,7 @@
that results from dividing by zero. The handler displays the error
message (but without a beep), then returns a very large number.
address@hidden
address@hidden
@group
(defun safe-divide (dividend divisor)
(condition-case err
@@ -1076,22 +1074,24 @@
@print{} Arithmetic error: (arith-error)
@result{} 1000000
@end group
address@hidden smallexample
address@hidden example
@noindent
-The handler specifies condition name @code{arith-error} so that it will handle
only division-by-zero errors. Other kinds of errors will not be handled, at
least not by this @code{condition-case}. Thus,
+The handler specifies condition name @code{arith-error} so that it
+will handle only division-by-zero errors. Other kinds of errors will
+not be handled (by this @code{condition-case}). Thus:
address@hidden
address@hidden
@group
(safe-divide nil 3)
@error{} Wrong type argument: number-or-marker-p, nil
@end group
address@hidden smallexample
address@hidden example
Here is a @code{condition-case} that catches all kinds of errors,
-including those signaled with @code{error}:
+including those from @code{error}:
address@hidden
address@hidden
@group
(setq baz 34)
@result{} 34
@@ -1109,7 +1109,7 @@
@print{} The error was: (error "Rats! The variable baz was 34, not 35")
@result{} 2
@end group
address@hidden smallexample
address@hidden example
@defmac ignore-errors address@hidden
This construct executes @var{body}, ignoring any errors that occur
@@ -1120,12 +1120,12 @@
Here's the example at the beginning of this subsection rewritten using
@code{ignore-errors}:
address@hidden
address@hidden
@group
(ignore-errors
(delete-file filename))
@end group
address@hidden smallexample
address@hidden example
@end defmac
@defmac with-demoted-errors address@hidden
@@ -1280,7 +1280,7 @@
For example, here we make an invisible buffer for temporary use, and
make sure to kill it before finishing:
address@hidden
address@hidden
@group
(let ((buffer (get-buffer-create " *temp*")))
(with-current-buffer buffer
@@ -1288,7 +1288,7 @@
@var{body-form}
(kill-buffer buffer))))
@end group
address@hidden smallexample
address@hidden example
@noindent
You might think that we could just as well write @code{(kill-buffer
@@ -1313,7 +1313,7 @@
event of failure. Otherwise, Emacs might fill up with useless
subprocesses.
address@hidden
address@hidden
@group
(let ((win nil))
(unwind-protect
@@ -1324,7 +1324,7 @@
(error "Ftp login failed")))
(or win (and process (delete-process process)))))
@end group
address@hidden smallexample
address@hidden example
This example has a small bug: if the user types @kbd{C-g} to
quit, and the quit happens immediately after the function
=== modified file 'doc/lispref/customize.texi'
--- a/doc/lispref/customize.texi 2012-04-26 00:31:47 +0000
+++ b/doc/lispref/customize.texi 2012-05-05 00:37:30 +0000
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
address@hidden Copyright (C) 1997-2012 Free Software Foundation, Inc.
address@hidden Copyright (C) 1997-2012 Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/customize
@node Customization, Loading, Macros, Top
@@ -158,7 +158,7 @@
@defvar customize-package-emacs-version-alist
This alist provides a mapping for the versions of Emacs that are
associated with versions of a package listed in the
address@hidden:package-version} keyword. Its elements look like this:
address@hidden:package-version} keyword. Its elements are:
@example
(@var{package} (@var{pversion} . @var{eversion})@dots{})
@@ -169,6 +169,8 @@
associated Emacs version @var{eversion}. These versions are strings.
For example, the MH-E package updates this alist with the following:
address@hidden Must be small else too wide.
address@hidden FIXME obviously this is out of date (in the code).
@smallexample
(add-to-list 'customize-package-emacs-version-alist
'(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
@@ -395,7 +397,7 @@
@item :set-after @var{variables}
@kindex address@hidden, @code{defcustom} keyword}
When setting variables according to saved customizations, make sure to
-set the variables @var{variables} before this one; in other words, delay
+set the variables @var{variables} before this one; i.e., delay
setting this variable until after those others have been handled. Use
@code{:set-after} if setting this variable won't work properly unless
those other variables already have their intended values.
@@ -682,9 +684,9 @@
specifications for reasonable keys in the alist. Ordinarily, they are
simply atoms, which stand for themselves. For example:
address@hidden
address@hidden
:options '("foo" "bar" "baz")
address@hidden smallexample
address@hidden example
@noindent
specifies that there are three ``known'' keys, namely @code{"foo"},
@@ -696,9 +698,9 @@
the list. The first element will specify the key, like before, while
the second element will specify the value type. For example:
address@hidden
address@hidden
:options '("foo" ("bar" integer) "baz")
address@hidden smallexample
address@hidden example
Finally, you may want to change how the key is presented. By default,
the key is simply shown as a @code{const}, since the user cannot change
@@ -708,37 +710,37 @@
This is done by using a customization type specification instead of a
symbol for the key.
address@hidden
address@hidden
:options '("foo" ((function-item some-function) integer)
"baz")
address@hidden smallexample
address@hidden example
Many alists use lists with two elements, instead of cons cells. For
example,
address@hidden
address@hidden
(defcustom list-alist '(("foo" 1) ("bar" 2) ("baz" 3))
"Each element is a list of the form (KEY VALUE).")
address@hidden smallexample
address@hidden example
@noindent
instead of
address@hidden
address@hidden
(defcustom cons-alist '(("foo" . 1) ("bar" . 2) ("baz" . 3))
"Each element is a cons-cell (KEY . VALUE).")
address@hidden smallexample
address@hidden example
Because of the way lists are implemented on top of cons cells, you can
treat @code{list-alist} in the example above as a cons cell alist, where
the value type is a list with a single element containing the real
value.
address@hidden
address@hidden
(defcustom list-alist '(("foo" 1) ("bar" 2) ("baz" 3))
"Each element is a list of the form (KEY VALUE)."
:type '(alist :value-type (group integer)))
address@hidden smallexample
address@hidden example
The @code{group} widget is used here instead of @code{list} only because
the formatting is better suited for the purpose.
@@ -746,14 +748,14 @@
Similarly, you can have alists with more values associated with each
key, using variations of this trick:
address@hidden
address@hidden
(defcustom person-data '(("brian" 50 t)
("dorith" 55 nil)
("ken" 52 t))
"Alist of basic info about people.
Each element has the form (NAME AGE MALE-FLAG)."
:type '(alist :value-type (group integer boolean)))
address@hidden smallexample
address@hidden example
@item (plist :key-type @var{key-type} :value-type @var{value-type})
This customization type is similar to @code{alist} (see above), except
@@ -1264,7 +1266,7 @@
the user invokes @samp{Save for future sessions} in the Customize
interface, that takes effect by writing a @code{custom-set-variables}
and/or a @code{custom-set-faces} form into the custom file, to be
-evaluated the next time Emacs starts up.
+evaluated the next time Emacs starts.
@defun custom-set-variables &rest args
This function installs the variable customizations specified by
@@ -1335,11 +1337,10 @@
@code{describe-theme} command or types @kbd{?} in the @samp{*Custom
Themes*} buffer.
-Two special theme names are disallowed: @code{user} is a ``dummy''
-theme which stores the user's direct customization settings, and
address@hidden is a ``dummy'' theme which stores changes made outside
-of the Customize system. If you specify either of these as the
address@hidden argument, @code{deftheme} signals an error.
+Two special theme names are disallowed (using them causes an error):
address@hidden is a ``dummy'' theme that stores the user's direct
+customization settings, and @code{changed} is a ``dummy'' theme that
+stores changes made outside of the Customize system.
@end defmac
@defmac provide-theme theme
@@ -1387,7 +1388,7 @@
before loading any non-built-in theme for the first time.
The following functions are useful for programmatically enabling and
-disabling Custom themes:
+disabling themes:
@defun custom-theme-p theme
This function return a address@hidden value if @var{theme} (a symbol)
@@ -1400,14 +1401,11 @@
This function loads the Custom theme named @var{theme} from its source
file, looking for the source file in the directories specified by the
variable @code{custom-theme-load-path}. @xref{Custom Themes,,, emacs,
-The GNU Emacs Manual}. It also @dfn{enables} the theme, causing its
-variable and face settings to take effect.
-
-If the optional argument @var{no-confirm} is address@hidden, this
-skips prompting the user for confirmation before loading the theme.
-
-If the optional argument @var{no-enable} is address@hidden, the theme
-is loaded but not enabled.
+The GNU Emacs Manual}. It also @dfn{enables} the theme (unless the
+optional argument @var{no-enable} is address@hidden), causing its
+variable and face settings to take effect. It prompts the user for
+confirmation before loading the theme, unless the optional argument
address@hidden is address@hidden
@end deffn
@deffn Command enable-theme theme
=== modified file 'doc/lispref/eval.texi'
--- a/doc/lispref/eval.texi 2012-04-26 03:06:36 +0000
+++ b/doc/lispref/eval.texi 2012-05-05 00:37:30 +0000
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
address@hidden Copyright (C) 1990-1994, 1998, 2001-2012 Free Software
Foundation, Inc.
address@hidden Copyright (C) 1990-1994, 1998, 2001-2012 Free Software
Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/eval
@node Evaluation, Control Structures, Symbols, Top
@@ -261,16 +261,13 @@
into the function cell of @code{first}, and the symbol @code{first} into
the function cell of @code{erste}.
address@hidden
address@hidden
@group
;; @r{Build this function cell linkage:}
;; ------------- ----- ------- -------
;; | #<subr car> | <-- | car | <-- | first | <-- | erste |
;; ------------- ----- ------- -------
@end group
address@hidden smallexample
-
address@hidden
@group
(symbol-function 'car)
@result{} #<subr car>
@@ -287,19 +284,19 @@
(erste '(1 2 3)) ; @r{Call the function referenced by @code{erste}.}
@result{} 1
@end group
address@hidden smallexample
address@hidden example
By contrast, the following example calls a function without any symbol
function indirection, because the first element is an anonymous Lisp
function, not a symbol.
address@hidden
address@hidden
@group
((lambda (arg) (erste arg))
'(1 2 3))
@result{} 1
@end group
address@hidden smallexample
address@hidden example
@noindent
Executing the function itself evaluates its body; this does involve
@@ -308,18 +305,18 @@
This form is rarely used and is now deprecated. Instead, you should write it
as:
address@hidden
address@hidden
@group
(funcall (lambda (arg) (erste arg))
'(1 2 3))
@end group
address@hidden smallexample
address@hidden example
or just
address@hidden
address@hidden
@group
(let ((arg '(1 2 3))) (erste arg))
@end group
address@hidden smallexample
address@hidden example
The built-in function @code{indirect-function} provides an easy way to
perform symbol function indirection explicitly.
@@ -342,12 +339,12 @@
Here is how you could define @code{indirect-function} in Lisp:
address@hidden
address@hidden
(defun indirect-function (function)
(if (symbolp function)
(indirect-function (symbol-function function))
function))
address@hidden smallexample
address@hidden example
@end defun
@node Function Forms
=== modified file 'doc/lispref/functions.texi'
--- a/doc/lispref/functions.texi 2012-04-26 03:06:36 +0000
+++ b/doc/lispref/functions.texi 2012-05-05 00:37:30 +0000
@@ -398,7 +398,7 @@
Here are some examples of argument lists and proper calls:
address@hidden
address@hidden
(funcall (lambda (n) (1+ n)) ; @r{One required:}
1) ; @r{requires exactly one argument.}
@result{} 2
@@ -410,7 +410,7 @@
(+ n (apply '+ ns))) ; @r{1 or more arguments.}
1 2 3 4 5)
@result{} 15
address@hidden smallexample
address@hidden example
@node Function Documentation
@subsection Documentation Strings of Functions
@@ -821,7 +821,7 @@
result is always a list. The length of the result is the same as the
length of @var{sequence}. For example:
address@hidden
address@hidden
@group
(mapcar 'car '((a b) (c d) (e f)))
@result{} (a c e)
@@ -853,7 +853,7 @@
(mapcar* 'cons '(a b c) '(1 2 3 4))
@result{} ((a . 1) (b . 2) (c . 3))
@end group
address@hidden smallexample
address@hidden example
@end defun
@defun mapc function sequence
@@ -874,7 +874,7 @@
kind of sequence except a char-table; that is, a list, a vector, a
bool-vector, or a string.
address@hidden
address@hidden
@group
(mapconcat 'symbol-name
'(The cat in the hat)
@@ -888,7 +888,7 @@
"")
@result{} "IBM.9111"
@end group
address@hidden smallexample
address@hidden example
@end defun
@node Anonymous Functions
@@ -1189,18 +1189,18 @@
For instance, in old versions of Emacs the @code{sit-for} function
accepted three arguments, like this
address@hidden
address@hidden
(sit-for seconds milliseconds nodisp)
address@hidden smallexample
address@hidden example
However, calling @code{sit-for} this way is considered obsolete
(@pxref{Waiting}). The old calling convention is deprecated like
this:
address@hidden
address@hidden
(set-advertised-calling-convention
'sit-for '(seconds &optional nodisp))
address@hidden smallexample
address@hidden example
@end defun
@node Inline Functions
@@ -1260,11 +1260,11 @@
defined in other files which would be loaded if that code is run. For
example, byte-compiling @file{fortran.el} used to warn:
address@hidden
address@hidden
In end of data:
fortran.el:2152:1:Warning: the function `gud-find-c-expr' is not known
to be defined.
address@hidden smallexample
address@hidden example
In fact, @code{gud-find-c-expr} is only used in the function that
Fortran mode uses for the local value of
@@ -1277,9 +1277,9 @@
All you need to do is add a @code{declare-function} statement before the
first use of the function in question:
address@hidden
address@hidden
(declare-function gud-find-c-expr "gud.el" nil)
address@hidden smallexample
address@hidden example
This says that @code{gud-find-c-expr} is defined in @file{gud.el} (the
@samp{.el} can be omitted). The compiler takes for granted that that file
=== modified file 'doc/lispref/loading.texi'
--- a/doc/lispref/loading.texi 2012-04-28 08:05:01 +0000
+++ b/doc/lispref/loading.texi 2012-05-05 00:37:30 +0000
@@ -251,31 +251,31 @@
current default directory. Here is an example of how to set
@env{EMACSLOADPATH} variable from @command{sh}:
address@hidden
address@hidden
export EMACSLOADPATH
EMACSLOADPATH=/home/foo/.emacs.d/lisp:/opt/emacs/lisp
address@hidden smallexample
address@hidden example
@noindent
Here is how to set it from @code{csh}:
address@hidden
address@hidden
setenv EMACSLOADPATH /home/foo/.emacs.d/lisp:/opt/emacs/lisp
address@hidden smallexample
address@hidden example
If @env{EMACSLOADPATH} is not set (which is usually the case), Emacs
initializes @code{load-path} with the following two directories:
address@hidden
address@hidden
"/usr/local/share/emacs/@var{version}/site-lisp"
address@hidden smallexample
address@hidden example
@noindent
and
address@hidden
address@hidden
"/usr/local/share/emacs/site-lisp"
address@hidden smallexample
address@hidden example
@noindent
The first one is for locally installed packages for a particular Emacs
@@ -304,9 +304,9 @@
It is common to add code to one's init file (@pxref{Init File}) to
add one or more directories to @code{load-path}. For example:
address@hidden
address@hidden
(push "~/.emacs.d/lisp" load-path)
address@hidden smallexample
address@hidden example
Dumping Emacs uses a special value of @code{load-path}. If the
value of @code{load-path} at the end of dumping is unchanged (that is,
@@ -340,9 +340,9 @@
For instance, suppose @code{load-path} is set to
address@hidden
address@hidden
("/opt/emacs/site-lisp" "/usr/share/emacs/23.3/lisp")
address@hidden smallexample
address@hidden example
@noindent
and that both these directories contain a file named @file{foo.el}.
@@ -535,24 +535,24 @@
The following example shows how @code{doctor} is prepared for
autoloading with a magic comment:
address@hidden
address@hidden
;;;###autoload
(defun doctor ()
"Switch to *doctor* buffer and start giving psychotherapy."
(interactive)
(switch-to-buffer "*doctor*")
(doctor-mode))
address@hidden smallexample
address@hidden example
@noindent
Here's what that produces in @file{loaddefs.el}:
address@hidden
address@hidden
(autoload (quote doctor) "doctor" "\
Switch to *doctor* buffer and start giving psychotherapy.
\(fn)" t nil)
address@hidden smallexample
address@hidden example
@noindent
@cindex @code{fn} in function's documentation string
@@ -571,11 +571,11 @@
@code{loaddefs.el}. That is not desirable. You can put the desired
@code{autoload} call into @code{loaddefs.el} instead by writing this:
address@hidden
address@hidden
;;;###autoload (autoload 'foo "myfile")
(mydefunmacro foo
...)
address@hidden smallexample
address@hidden example
You can use a non-default string as the autoload cookie and have the
corresponding autoload calls written into a file whose name is
@@ -680,7 +680,7 @@
For example, in @file{idlwave.el}, the definition for
@code{idlwave-complete-filename} includes the following code:
address@hidden
address@hidden
(defun idlwave-complete-filename ()
"Use the comint stuff to complete a file name."
(require 'comint)
@@ -688,7 +688,7 @@
(comint-completion-addsuffix nil)
...)
(comint-dynamic-complete-filename)))
address@hidden smallexample
address@hidden example
@noindent
The expression @code{(require 'comint)} loads the file @file{comint.el}
@@ -703,9 +703,9 @@
The @file{comint.el} file contains the following top-level expression:
address@hidden
address@hidden
(provide 'comint)
address@hidden smallexample
address@hidden example
@noindent
This adds @code{comint} to the global @code{features} list, so that
@@ -726,13 +726,13 @@
by including a @code{provide} followed by a @code{require} for the same
feature, as in the following example.
address@hidden
address@hidden
@group
(provide 'my-feature) ; @r{Ignored by byte compiler,}
; @r{evaluated by @code{load}.}
(require 'my-feature) ; @r{Evaluated by byte compiler.}
@end group
address@hidden smallexample
address@hidden example
@noindent
The compiler ignores the @code{provide}, then processes the
@@ -762,7 +762,7 @@
present in a given version. @xref{Network Feature Testing}, for
an example.
address@hidden
address@hidden
features
@result{} (bar bish)
@@ -770,7 +770,7 @@
@result{} foo
features
@result{} (foo bar bish)
address@hidden smallexample
address@hidden example
When a file is loaded to satisfy an autoload, and it stops due to an
error in the evaluation of its contents, any function definitions or
=== modified file 'doc/lispref/macros.texi'
--- a/doc/lispref/macros.texi 2012-04-21 19:34:05 +0000
+++ b/doc/lispref/macros.texi 2012-05-05 00:37:30 +0000
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
address@hidden Copyright (C) 1990-1995, 1998, 2001-2012 Free Software
Foundation, Inc.
address@hidden Copyright (C) 1990-1995, 1998, 2001-2012 Free Software
Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/macros
@node Macros, Customization, Functions, Top
@@ -110,7 +110,7 @@
definitions that shadow the currently defined macros. Byte compilation
uses this feature.
address@hidden
address@hidden
@group
(defmacro inc (var)
(list 'setq var (list '1+ var)))
@@ -132,7 +132,7 @@
(macroexpand '(inc2 r s))
@result{} (progn (inc r) (inc s)) ; @address@hidden not expanded here.}
@end group
address@hidden smallexample
address@hidden example
@end defun
@@ -146,10 +146,10 @@
@code{macroexpand-all}, we see that @code{macroexpand-all} @emph{does}
expand the embedded calls to @code{inc}:
address@hidden
address@hidden
(macroexpand-all '(inc2 r s))
@result{} (progn (setq r (1+ r)) (setq s (1+ s)))
address@hidden smallexample
address@hidden example
@end defun
@@ -333,7 +333,7 @@
problem. This macro allows us to write a ``for'' loop construct.
@findex for
address@hidden
address@hidden
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple \"for\" loop.
@@ -364,7 +364,7 @@
@print{}3 9
@result{} nil
@end group
address@hidden smallexample
address@hidden example
@noindent
The arguments @code{from}, @code{to}, and @code{do} in this macro are
@@ -374,7 +374,7 @@
Here's an equivalent definition simplified through use of backquote:
address@hidden
address@hidden
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple \"for\" loop.
@@ -384,7 +384,7 @@
,@@body
(inc ,var))))
@end group
address@hidden smallexample
address@hidden example
Both forms of this definition (with backquote and without) suffer from
the defect that @var{final} is evaluated on every iteration. If
@@ -399,7 +399,7 @@
once unless repeated evaluation is part of the intended purpose of the
macro. Here is a correct expansion for the @code{for} macro:
address@hidden
address@hidden
@group
(let ((i 1)
(max 3))
@@ -408,11 +408,11 @@
(princ (format "%d %d" i square))
(inc i)))
@end group
address@hidden smallexample
address@hidden example
Here is a macro definition that creates this expansion:
address@hidden
address@hidden
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple for loop: (for i from 1 to 10 do (print i))."
@@ -422,7 +422,7 @@
,@@body
(inc ,var))))
@end group
address@hidden smallexample
address@hidden example
Unfortunately, this fix introduces another problem,
described in the following section.
@@ -435,7 +435,7 @@
follows to make the expansion evaluate the macro arguments the proper
number of times:
address@hidden
address@hidden
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple for loop: (for i from 1 to 10 do (print i))."
@@ -447,14 +447,14 @@
,@@body
(inc ,var))))
@end group
address@hidden smallexample
address@hidden example
@end ifnottex
The new definition of @code{for} has a new problem: it introduces a
local variable named @code{max} which the user does not expect. This
causes trouble in examples such as the following:
address@hidden
address@hidden
@group
(let ((max 0))
(for x from 0 to 10 do
@@ -462,7 +462,7 @@
(if (< max this)
(setq max this)))))
@end group
address@hidden smallexample
address@hidden example
@noindent
The references to @code{max} inside the body of the @code{for}, which
@@ -478,7 +478,7 @@
where put by @code{for}. Here is a definition of @code{for} that works
this way:
address@hidden
address@hidden
@group
(defmacro for (var from init to final do &rest body)
"Execute a simple for loop: (for i from 1 to 10 do (print i))."
@@ -489,7 +489,7 @@
,@@body
(inc ,var)))))
@end group
address@hidden smallexample
address@hidden example
@noindent
This creates an uninterned symbol named @code{max} and puts it in the
=== modified file 'doc/lispref/sequences.texi'
--- a/doc/lispref/sequences.texi 2012-03-10 09:55:54 +0000
+++ b/doc/lispref/sequences.texi 2012-05-05 00:37:30 +0000
@@ -248,7 +248,7 @@
change the length of an existing array.
@item
-For purposes of evaluation, the array is a constant---in other words,
+For purposes of evaluation, the array is a constant---i.e.,
it evaluates to itself.
@item
=== modified file 'doc/lispref/symbols.texi'
--- a/doc/lispref/symbols.texi 2012-04-26 00:31:47 +0000
+++ b/doc/lispref/symbols.texi 2012-05-05 00:37:30 +0000
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
address@hidden Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software
Foundation, Inc.
address@hidden Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software
Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/symbols
@node Symbols, Evaluation, Hash Tables, Top
@@ -91,7 +91,7 @@
@code{symbol-function} (@pxref{Function Cells}).
The property list cell normally should hold a correctly formatted
-property list. To get a symbol's function cell, use the function
+property list. To get a symbol's property list, use the function
@code{symbol-plist}. @xref{Property Lists}.
The function cell or the value cell may be @dfn{void}, which means
@@ -311,7 +311,7 @@
the function returns @var{name} if @var{name} is interned
in the specified obarray, and otherwise @code{nil}.
address@hidden
address@hidden
(intern-soft "frazzle") ; @r{No such symbol exists.}
@result{} nil
(make-symbol "frazzle") ; @r{Create an uninterned one.}
@@ -332,7 +332,7 @@
(eq sym 'frazzle) ; @r{And it is the same one.}
@result{} t
@end group
address@hidden smallexample
address@hidden example
@end defun
@defvar obarray
@@ -347,7 +347,7 @@
omitted, it defaults to the value of @code{obarray}, the standard
obarray for ordinary symbols.
address@hidden
address@hidden
(setq count 0)
@result{} 0
(defun count-syms (s)
@@ -357,7 +357,7 @@
@result{} nil
count
@result{} 1871
address@hidden smallexample
address@hidden example
See @code{documentation} in @ref{Accessing Documentation}, for another
example using @code{mapatoms}.
@@ -463,12 +463,12 @@
Normally, @var{plist} should be a well-formed property list, but this is
not enforced. The return value is @var{plist}.
address@hidden
address@hidden
(setplist 'foo '(a 1 b (2 3) c nil))
@result{} (a 1 b (2 3) c nil)
(symbol-plist 'foo)
@result{} (a 1 b (2 3) c nil)
address@hidden smallexample
address@hidden example
For symbols in special obarrays, which are not used for ordinary
purposes, it may make sense to use the property list cell in a
@@ -493,7 +493,7 @@
the property name @var{property}, replacing any previous property value.
The @code{put} function returns @var{value}.
address@hidden
address@hidden
(put 'fly 'verb 'transitive)
@result{}'transitive
(put 'fly 'noun '(a buzzing little bug))
@@ -502,14 +502,14 @@
@result{} transitive
(symbol-plist 'fly)
@result{} (verb transitive noun (a buzzing little bug))
address@hidden smallexample
address@hidden example
@end defun
@node Other Plists
@subsection Property Lists Outside Symbols
These functions are useful for manipulating property lists
-that are stored in places other than symbols:
+not stored in symbols:
@defun plist-get plist property
This returns the value of the @var{property} property stored in the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107964: More small edits for doc/lispref,
Glenn Morris <=