aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKenichi Handa2012-10-17 22:33:48 +0900
committerKenichi Handa2012-10-17 22:33:48 +0900
commit596846525bf5f515541ab1ca9a459f4842d55d1d (patch)
treee1e4f64ebb40daf0d9ee16b84ef824da30cfbffc /doc
parentfe0b1ec40988638025db569a936b09f0295749a1 (diff)
parent1f9f395d8063fd633ba73f6cc025ded953bab502 (diff)
downloademacs-596846525bf5f515541ab1ca9a459f4842d55d1d.tar.gz
emacs-596846525bf5f515541ab1ca9a459f4842d55d1d.zip
merge trunk
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog8
-rw-r--r--doc/emacs/maintaining.texi2
-rw-r--r--doc/emacs/search.texi13
-rw-r--r--doc/lispintro/ChangeLog5
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi4
-rw-r--r--doc/lispref/ChangeLog11
-rw-r--r--doc/lispref/functions.texi81
-rw-r--r--doc/lispref/macros.texi47
8 files changed, 105 insertions, 66 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 47a4c8da522..5ab3c1ab5b8 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,11 @@
12012-10-16 Juri Linkov <juri@jurta.org>
2
3 * search.texi (Query Replace): Document multi-buffer replacement
4 keys. (Bug#12655)
5
6 * maintaining.texi (Tags Search): Change link "Replace" to
7 "Query Replace".
8
12012-10-13 Chong Yidong <cyd@gnu.org> 92012-10-13 Chong Yidong <cyd@gnu.org>
2 10
3 * files.texi (File Conveniences): ImageMagick enabled by default. 11 * files.texi (File Conveniences): ImageMagick enabled by default.
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index d21e3af83dd..67214bde22c 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2221,7 +2221,7 @@ the current buffer, followed by the remaining files of the tags table.
2221reads a regexp to search for and a string to replace with, just like 2221reads a regexp to search for and a string to replace with, just like
2222ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x 2222ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x
2223tags-search}, but repeatedly, processing matches according to your 2223tags-search}, but repeatedly, processing matches according to your
2224input. @xref{Replace}, for more information on query replace. 2224input. @xref{Query Replace}, for more information on query replace.
2225 2225
2226@vindex tags-case-fold-search 2226@vindex tags-case-fold-search
2227@cindex case-sensitivity and tags search 2227@cindex case-sensitivity and tags search
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 21db02c8ab8..7e46e416219 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -1239,6 +1239,19 @@ occurrences.
1239@item ! 1239@item !
1240to replace all remaining occurrences without asking again. 1240to replace all remaining occurrences without asking again.
1241 1241
1242@item Y @r{(Upper-case)}
1243to replace all remaining occurrences in all remaining buffers in
1244multi-buffer replacements (like the Dired `Q' command which performs
1245query replace on selected files). It answers this question and all
1246subsequent questions in the series with "yes", without further
1247user interaction.
1248
1249@item N @r{(Upper-case)}
1250to skip to the next buffer in multi-buffer replacements without
1251replacing remaining occurrences in the current buffer. It answers
1252this question "no", gives up on the questions for the current buffer,
1253and continues to the next buffer in the sequence.
1254
1242@item ^ 1255@item ^
1243to go back to the position of the previous occurrence (or what used to 1256to go back to the position of the previous occurrence (or what used to
1244be an occurrence), in case you changed it by mistake or want to 1257be an occurrence), in case you changed it by mistake or want to
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 11eacf25c96..6c524f5a0ae 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,8 @@
12012-10-17 Gregor Zattler <grfz@gmx.de> (tiny change)
2
3 * emacs-lisp-intro.texi (Narrowing advantages):
4 Minor update for changed what-line implementation. (Bug#12629)
5
12012-06-21 Glenn Morris <rgm@gnu.org> 62012-06-21 Glenn Morris <rgm@gnu.org>
2 7
3 * Makefile.in: Rename infodir to buildinfodir throughout. (Bug#11737) 8 * Makefile.in: Rename infodir to buildinfodir throughout. (Bug#11737)
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 04e3e0c8649..55c3ef4e09e 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -6600,8 +6600,8 @@ buffer; or conversely, an Emacs Lisp function needs to work on all of a
6600buffer that has been narrowed. The @code{what-line} function, for 6600buffer that has been narrowed. The @code{what-line} function, for
6601example, removes the narrowing from a buffer, if it has any narrowing 6601example, removes the narrowing from a buffer, if it has any narrowing
6602and when it has finished its job, restores the narrowing to what it was. 6602and when it has finished its job, restores the narrowing to what it was.
6603On the other hand, the @code{count-lines} function, which is called by 6603On the other hand, the @code{count-lines} function
6604@code{what-line}, uses narrowing to restrict itself to just that portion 6604uses narrowing to restrict itself to just that portion
6605of the buffer in which it is interested and then restores the previous 6605of the buffer in which it is interested and then restores the previous
6606situation. 6606situation.
6607 6607
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 40c457ffe07..acf6f8a51ff 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,14 @@
12012-10-15 Chong Yidong <cyd@gnu.org>
2
3 * macros.texi (Defining Macros): defmacro is now a macro.
4 Explicitly list the docstring and declare arguments.
5
6 * functions.texi (Anonymous Functions): Explicitly list the
7 docstring, declare, and interactive arguments to lambda.
8 (Defining Functions): Likewise for defun.
9 (Inline Functions): Likewise for defsubst.
10 (Declare Form): Tweak description.
11
12012-10-13 Chong Yidong <cyd@gnu.org> 122012-10-13 Chong Yidong <cyd@gnu.org>
2 13
3 * display.texi (ImageMagick Images): ImageMagick enabled by default. 14 * display.texi (ImageMagick Images): ImageMagick enabled by default.
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 845561f91ec..c94e46dad18 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -522,21 +522,20 @@ Scheme.)
522is called @dfn{defining a function}, and it is done with the 522is called @dfn{defining a function}, and it is done with the
523@code{defun} special form. 523@code{defun} special form.
524 524
525@defmac defun name argument-list body-forms... 525@defmac defun name args [doc] [declare] [interactive] body@dots{}
526@code{defun} is the usual way to define new Lisp functions. It 526@code{defun} is the usual way to define new Lisp functions. It
527defines the symbol @var{name} as a function that looks like this: 527defines the symbol @var{name} as a function with argument list
528@var{args} and body forms given by @var{body}. Neither @var{name} nor
529@var{args} should be quoted.
528 530
529@example 531@var{doc}, if present, should be a string specifying the function's
530(lambda @var{argument-list} . @var{body-forms}) 532documentation string (@pxref{Function Documentation}). @var{declare},
531@end example 533if present, should be a @code{declare} form specifying function
534metadata (@pxref{Declare Form}). @var{interactive}, if present,
535should be an @code{interactive} form specifying how the function is to
536be called interactively (@pxref{Interactive Call}).
532 537
533@code{defun} stores this lambda expression in the function cell of 538The return value of @code{defun} is undefined.
534@var{name}. Its return value is @emph{undefined}.
535
536As described previously, @var{argument-list} is a list of argument
537names and may include the keywords @code{&optional} and @code{&rest}.
538Also, the first two of the @var{body-forms} may be a documentation
539string and an interactive declaration. @xref{Lambda Components}.
540 539
541Here are some examples: 540Here are some examples:
542 541
@@ -582,14 +581,14 @@ redefinition from unintentional redefinition.
582@end defmac 581@end defmac
583 582
584@cindex function aliases 583@cindex function aliases
585@defun defalias name definition &optional docstring 584@defun defalias name definition &optional doc
586@anchor{Definition of defalias} 585@anchor{Definition of defalias}
587This special form defines the symbol @var{name} as a function, with 586This special form defines the symbol @var{name} as a function, with
588definition @var{definition} (which can be any valid Lisp function). 587definition @var{definition} (which can be any valid Lisp function).
589Its return value is @emph{undefined}. 588Its return value is @emph{undefined}.
590 589
591If @var{docstring} is non-@code{nil}, it becomes the function 590If @var{doc} is non-@code{nil}, it becomes the function documentation
592documentation of @var{name}. Otherwise, any documentation provided by 591of @var{name}. Otherwise, any documentation provided by
593@var{definition} is used. 592@var{definition} is used.
594 593
595The proper place to use @code{defalias} is where a specific function 594The proper place to use @code{defalias} is where a specific function
@@ -902,11 +901,14 @@ function, you can in principle use any method to construct the list.
902But typically you should use the @code{lambda} macro, or the 901But typically you should use the @code{lambda} macro, or the
903@code{function} special form, or the @code{#'} read syntax: 902@code{function} special form, or the @code{#'} read syntax:
904 903
905@defmac lambda args body... 904@defmac lambda args [doc] [interactive] body@dots{}
906This macro returns an anonymous function with argument list @var{args} 905This macro returns an anonymous function with argument list
907and body forms given by @var{body}. In effect, this macro makes 906@var{args}, documentation string @var{doc} (if any), interactive spec
908@code{lambda} forms ``self-quoting'': evaluating a form whose @sc{car} 907@var{interactive} (if any), and body forms given by @var{body}.
909is @code{lambda} yields the form itself: 908
909In effect, this macro makes @code{lambda} forms ``self-quoting'':
910evaluating a form whose @sc{car} is @code{lambda} yields the form
911itself:
910 912
911@example 913@example
912(lambda (x) (* x x)) 914(lambda (x) (* x x))
@@ -1169,13 +1171,13 @@ If provided, @var{when} should be a string indicating when the function
1169was first made obsolete---for example, a date or a release number. 1171was first made obsolete---for example, a date or a release number.
1170@end defun 1172@end defun
1171 1173
1172@defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring 1174@defmac define-obsolete-function-alias obsolete-name current-name &optional when doc
1173This convenience macro marks the function @var{obsolete-name} obsolete 1175This convenience macro marks the function @var{obsolete-name} obsolete
1174and also defines it as an alias for the function @var{current-name}. 1176and also defines it as an alias for the function @var{current-name}.
1175It is equivalent to the following: 1177It is equivalent to the following:
1176 1178
1177@example 1179@example
1178(defalias @var{obsolete-name} @var{current-name} @var{docstring}) 1180(defalias @var{obsolete-name} @var{current-name} @var{doc})
1179(make-obsolete @var{obsolete-name} @var{current-name} @var{when}) 1181(make-obsolete @var{obsolete-name} @var{current-name} @var{when})
1180@end example 1182@end example
1181@end defmac 1183@end defmac
@@ -1213,16 +1215,16 @@ this:
1213@section Inline Functions 1215@section Inline Functions
1214@cindex inline functions 1216@cindex inline functions
1215 1217
1216@defmac defsubst name argument-list body-forms... 1218 An @dfn{inline function} is a function that works just like an
1217Define an inline function. The syntax is exactly the same as 1219ordinary function, except for one thing: when you byte-compile a call
1218@code{defun} (@pxref{Defining Functions}).
1219@end defmac
1220
1221 You can define an @dfn{inline function} by using @code{defsubst}
1222instead of @code{defun}. An inline function works just like an
1223ordinary function except for one thing: when you byte-compile a call
1224to the function (@pxref{Byte Compilation}), the function's definition 1220to the function (@pxref{Byte Compilation}), the function's definition
1225is expanded into the caller. 1221is expanded into the caller. To define an inline function, use
1222@code{defsubst} instead of @code{defun}.
1223
1224@defmac defsubst name args [doc] [declare] [interactive] body@dots{}
1225This macro defines an inline function. Its syntax is exactly the same
1226as @code{defun} (@pxref{Defining Functions}).
1227@end defmac
1226 1228
1227 Making a function inline often makes its function calls run faster. 1229 Making a function inline often makes its function calls run faster.
1228But it also has disadvantages. For one thing, it reduces flexibility; 1230But it also has disadvantages. For one thing, it reduces flexibility;
@@ -1266,16 +1268,13 @@ convention in Emacs Lisp mode.
1266@anchor{Definition of declare} 1268@anchor{Definition of declare}
1267@defmac declare @var{specs}@dots{} 1269@defmac declare @var{specs}@dots{}
1268This macro ignores its arguments and evaluates to @code{nil}; it has 1270This macro ignores its arguments and evaluates to @code{nil}; it has
1269no run-time effect. However, when a @code{declare} form occurs as the 1271no run-time effect. However, when a @code{declare} form occurs in the
1270@emph{very first form} in the body of a @code{defun} function 1272@var{declare} argument of a @code{defun} or @code{defsubst} function
1271definition or a @code{defmacro} macro definition (@pxref{Defining 1273definition (@pxref{Defining Functions}) or a @code{defmacro} macro
1272Macros}, for a description of @code{defmacro}), it appends the 1274definition (@pxref{Defining Macros}), it appends the properties
1273properties specified by @var{specs} to the function or macro. This 1275specified by @var{specs} to the function or macro. This work is
1274work is specially performed by the @code{defun} and @code{defmacro} 1276specially performed by @code{defun}, @code{defsubst}, and
1275macros. 1277@code{defmacro}.
1276
1277Note that if you put a @code{declare} form in an interactive function,
1278it should go before the @code{interactive} form.
1279 1278
1280Each element in @var{specs} should have the form @code{(@var{property} 1279Each element in @var{specs} should have the form @code{(@var{property}
1281@var{args}@dots{})}, which should not be quoted. These have the 1280@var{args}@dots{})}, which should not be quoted. These have the
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index 0a5152a43a1..8be6a3fbcde 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -185,35 +185,38 @@ During Compile}).
185@node Defining Macros 185@node Defining Macros
186@section Defining Macros 186@section Defining Macros
187 187
188 A Lisp macro is a list whose @sc{car} is @code{macro}. Its @sc{cdr} should 188 A Lisp macro object is a list whose @sc{car} is @code{macro}, and
189be a function; expansion of the macro works by applying the function 189whose @sc{cdr} is a lambda expression. Expansion of the macro works
190(with @code{apply}) to the list of unevaluated argument-expressions 190by applying the lambda expression (with @code{apply}) to the list of
191from the macro call. 191@emph{unevaluated} arguments from the macro call.
192 192
193 It is possible to use an anonymous Lisp macro just like an anonymous 193 It is possible to use an anonymous Lisp macro just like an anonymous
194function, but this is never done, because it does not make sense to pass 194function, but this is never done, because it does not make sense to
195an anonymous macro to functionals such as @code{mapcar}. In practice, 195pass an anonymous macro to functionals such as @code{mapcar}. In
196all Lisp macros have names, and they are usually defined with the 196practice, all Lisp macros have names, and they are almost always
197special form @code{defmacro}. 197defined with the @code{defmacro} macro.
198 198
199@defspec defmacro name argument-list body-forms@dots{} 199@defmac defmacro name args [doc] [declare] body@dots{}
200@code{defmacro} defines the symbol @var{name} as a macro that looks 200@code{defmacro} defines the symbol @var{name} (which should not be
201like this: 201quoted) as a macro that looks like this:
202 202
203@example 203@example
204(macro lambda @var{argument-list} . @var{body-forms}) 204(macro lambda @var{args} . @var{body})
205@end example 205@end example
206 206
207(Note that the @sc{cdr} of this list is a function---a lambda expression.) 207(Note that the @sc{cdr} of this list is a lambda expression.) This
208This macro object is stored in the function cell of @var{name}. Its return 208macro object is stored in the function cell of @var{name}. The
209value is @emph{undefined}. 209meaning of @var{args} is the same as in a function, and the keywords
210 210@code{&rest} and @code{&optional} may be used (@pxref{Argument List}).
211The shape and meaning of @var{argument-list} is the same as in a 211Neither @var{name} nor @var{args} should be quoted. The return value
212function, and the keywords @code{&rest} and @code{&optional} may be used 212of @code{defmacro} is undefined.
213(@pxref{Argument List}). Macros may have a documentation string, but 213
214any @code{interactive} declaration is ignored since macros cannot be 214@var{doc}, if present, should be a string specifying the macro's
215called interactively. 215documentation string. @var{declare}, if present, should be a
216@end defspec 216@code{declare} form specifying metadata for the macro (@pxref{Declare
217Form}). Note that macros cannot have interactive declarations, since
218they cannot be called interactively.
219@end defmac
217 220
218 Macros often need to construct large list structures from a mixture 221 Macros often need to construct large list structures from a mixture
219of constants and nonconstant parts. To make this easier, use the 222of constants and nonconstant parts. To make this easier, use the