diff options
| author | Kenichi Handa | 2012-10-17 22:33:48 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-10-17 22:33:48 +0900 |
| commit | 596846525bf5f515541ab1ca9a459f4842d55d1d (patch) | |
| tree | e1e4f64ebb40daf0d9ee16b84ef824da30cfbffc /doc | |
| parent | fe0b1ec40988638025db569a936b09f0295749a1 (diff) | |
| parent | 1f9f395d8063fd633ba73f6cc025ded953bab502 (diff) | |
| download | emacs-596846525bf5f515541ab1ca9a459f4842d55d1d.tar.gz emacs-596846525bf5f515541ab1ca9a459f4842d55d1d.zip | |
merge trunk
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/search.texi | 13 | ||||
| -rw-r--r-- | doc/lispintro/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 81 | ||||
| -rw-r--r-- | doc/lispref/macros.texi | 47 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-10-13 Chong Yidong <cyd@gnu.org> | 9 | 2012-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. | |||
| 2221 | reads a regexp to search for and a string to replace with, just like | 2221 | reads a regexp to search for and a string to replace with, just like |
| 2222 | ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x | 2222 | ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x |
| 2223 | tags-search}, but repeatedly, processing matches according to your | 2223 | tags-search}, but repeatedly, processing matches according to your |
| 2224 | input. @xref{Replace}, for more information on query replace. | 2224 | input. @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 ! |
| 1240 | to replace all remaining occurrences without asking again. | 1240 | to replace all remaining occurrences without asking again. |
| 1241 | 1241 | ||
| 1242 | @item Y @r{(Upper-case)} | ||
| 1243 | to replace all remaining occurrences in all remaining buffers in | ||
| 1244 | multi-buffer replacements (like the Dired `Q' command which performs | ||
| 1245 | query replace on selected files). It answers this question and all | ||
| 1246 | subsequent questions in the series with "yes", without further | ||
| 1247 | user interaction. | ||
| 1248 | |||
| 1249 | @item N @r{(Upper-case)} | ||
| 1250 | to skip to the next buffer in multi-buffer replacements without | ||
| 1251 | replacing remaining occurrences in the current buffer. It answers | ||
| 1252 | this question "no", gives up on the questions for the current buffer, | ||
| 1253 | and continues to the next buffer in the sequence. | ||
| 1254 | |||
| 1242 | @item ^ | 1255 | @item ^ |
| 1243 | to go back to the position of the previous occurrence (or what used to | 1256 | to go back to the position of the previous occurrence (or what used to |
| 1244 | be an occurrence), in case you changed it by mistake or want to | 1257 | be 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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-06-21 Glenn Morris <rgm@gnu.org> | 6 | 2012-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 | |||
| 6600 | buffer that has been narrowed. The @code{what-line} function, for | 6600 | buffer that has been narrowed. The @code{what-line} function, for |
| 6601 | example, removes the narrowing from a buffer, if it has any narrowing | 6601 | example, removes the narrowing from a buffer, if it has any narrowing |
| 6602 | and when it has finished its job, restores the narrowing to what it was. | 6602 | and when it has finished its job, restores the narrowing to what it was. |
| 6603 | On the other hand, the @code{count-lines} function, which is called by | 6603 | On the other hand, the @code{count-lines} function |
| 6604 | @code{what-line}, uses narrowing to restrict itself to just that portion | 6604 | uses narrowing to restrict itself to just that portion |
| 6605 | of the buffer in which it is interested and then restores the previous | 6605 | of the buffer in which it is interested and then restores the previous |
| 6606 | situation. | 6606 | situation. |
| 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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-10-13 Chong Yidong <cyd@gnu.org> | 12 | 2012-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.) | |||
| 522 | is called @dfn{defining a function}, and it is done with the | 522 | is 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 |
| 527 | defines the symbol @var{name} as a function that looks like this: | 527 | defines 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}) | 532 | documentation string (@pxref{Function Documentation}). @var{declare}, |
| 531 | @end example | 533 | if present, should be a @code{declare} form specifying function |
| 534 | metadata (@pxref{Declare Form}). @var{interactive}, if present, | ||
| 535 | should be an @code{interactive} form specifying how the function is to | ||
| 536 | be called interactively (@pxref{Interactive Call}). | ||
| 532 | 537 | ||
| 533 | @code{defun} stores this lambda expression in the function cell of | 538 | The return value of @code{defun} is undefined. |
| 534 | @var{name}. Its return value is @emph{undefined}. | ||
| 535 | |||
| 536 | As described previously, @var{argument-list} is a list of argument | ||
| 537 | names and may include the keywords @code{&optional} and @code{&rest}. | ||
| 538 | Also, the first two of the @var{body-forms} may be a documentation | ||
| 539 | string and an interactive declaration. @xref{Lambda Components}. | ||
| 540 | 539 | ||
| 541 | Here are some examples: | 540 | Here 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} |
| 587 | This special form defines the symbol @var{name} as a function, with | 586 | This special form defines the symbol @var{name} as a function, with |
| 588 | definition @var{definition} (which can be any valid Lisp function). | 587 | definition @var{definition} (which can be any valid Lisp function). |
| 589 | Its return value is @emph{undefined}. | 588 | Its return value is @emph{undefined}. |
| 590 | 589 | ||
| 591 | If @var{docstring} is non-@code{nil}, it becomes the function | 590 | If @var{doc} is non-@code{nil}, it becomes the function documentation |
| 592 | documentation of @var{name}. Otherwise, any documentation provided by | 591 | of @var{name}. Otherwise, any documentation provided by |
| 593 | @var{definition} is used. | 592 | @var{definition} is used. |
| 594 | 593 | ||
| 595 | The proper place to use @code{defalias} is where a specific function | 594 | The 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. | |||
| 902 | But typically you should use the @code{lambda} macro, or the | 901 | But 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{} |
| 906 | This macro returns an anonymous function with argument list @var{args} | 905 | This macro returns an anonymous function with argument list |
| 907 | and 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}. |
| 909 | is @code{lambda} yields the form itself: | 908 | |
| 909 | In effect, this macro makes @code{lambda} forms ``self-quoting'': | ||
| 910 | evaluating a form whose @sc{car} is @code{lambda} yields the form | ||
| 911 | itself: | ||
| 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 | |||
| 1169 | was first made obsolete---for example, a date or a release number. | 1171 | was 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 |
| 1173 | This convenience macro marks the function @var{obsolete-name} obsolete | 1175 | This convenience macro marks the function @var{obsolete-name} obsolete |
| 1174 | and also defines it as an alias for the function @var{current-name}. | 1176 | and also defines it as an alias for the function @var{current-name}. |
| 1175 | It is equivalent to the following: | 1177 | It 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 |
| 1217 | Define an inline function. The syntax is exactly the same as | 1219 | ordinary 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} | ||
| 1222 | instead of @code{defun}. An inline function works just like an | ||
| 1223 | ordinary function except for one thing: when you byte-compile a call | ||
| 1224 | to the function (@pxref{Byte Compilation}), the function's definition | 1220 | to the function (@pxref{Byte Compilation}), the function's definition |
| 1225 | is expanded into the caller. | 1221 | is 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{} | ||
| 1225 | This macro defines an inline function. Its syntax is exactly the same | ||
| 1226 | as @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. |
| 1228 | But it also has disadvantages. For one thing, it reduces flexibility; | 1230 | But 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{} |
| 1268 | This macro ignores its arguments and evaluates to @code{nil}; it has | 1270 | This macro ignores its arguments and evaluates to @code{nil}; it has |
| 1269 | no run-time effect. However, when a @code{declare} form occurs as the | 1271 | no 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 |
| 1271 | definition or a @code{defmacro} macro definition (@pxref{Defining | 1273 | definition (@pxref{Defining Functions}) or a @code{defmacro} macro |
| 1272 | Macros}, for a description of @code{defmacro}), it appends the | 1274 | definition (@pxref{Defining Macros}), it appends the properties |
| 1273 | properties specified by @var{specs} to the function or macro. This | 1275 | specified by @var{specs} to the function or macro. This work is |
| 1274 | work is specially performed by the @code{defun} and @code{defmacro} | 1276 | specially performed by @code{defun}, @code{defsubst}, and |
| 1275 | macros. | 1277 | @code{defmacro}. |
| 1276 | |||
| 1277 | Note that if you put a @code{declare} form in an interactive function, | ||
| 1278 | it should go before the @code{interactive} form. | ||
| 1279 | 1278 | ||
| 1280 | Each element in @var{specs} should have the form @code{(@var{property} | 1279 | Each 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 |
| 189 | be a function; expansion of the macro works by applying the function | 189 | whose @sc{cdr} is a lambda expression. Expansion of the macro works |
| 190 | (with @code{apply}) to the list of unevaluated argument-expressions | 190 | by applying the lambda expression (with @code{apply}) to the list of |
| 191 | from 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 |
| 194 | function, but this is never done, because it does not make sense to pass | 194 | function, but this is never done, because it does not make sense to |
| 195 | an anonymous macro to functionals such as @code{mapcar}. In practice, | 195 | pass an anonymous macro to functionals such as @code{mapcar}. In |
| 196 | all Lisp macros have names, and they are usually defined with the | 196 | practice, all Lisp macros have names, and they are almost always |
| 197 | special form @code{defmacro}. | 197 | defined 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 |
| 201 | like this: | 201 | quoted) 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 |
| 208 | This macro object is stored in the function cell of @var{name}. Its return | 208 | macro object is stored in the function cell of @var{name}. The |
| 209 | value is @emph{undefined}. | 209 | meaning 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}). | |
| 211 | The shape and meaning of @var{argument-list} is the same as in a | 211 | Neither @var{name} nor @var{args} should be quoted. The return value |
| 212 | function, and the keywords @code{&rest} and @code{&optional} may be used | 212 | of @code{defmacro} is undefined. |
| 213 | (@pxref{Argument List}). Macros may have a documentation string, but | 213 | |
| 214 | any @code{interactive} declaration is ignored since macros cannot be | 214 | @var{doc}, if present, should be a string specifying the macro's |
| 215 | called interactively. | 215 | documentation string. @var{declare}, if present, should be a |
| 216 | @end defspec | 216 | @code{declare} form specifying metadata for the macro (@pxref{Declare |
| 217 | Form}). Note that macros cannot have interactive declarations, since | ||
| 218 | they 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 |
| 219 | of constants and nonconstant parts. To make this easier, use the | 222 | of constants and nonconstant parts. To make this easier, use the |