diff options
| author | Paul Eggert | 2016-08-05 14:09:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-08-05 14:09:08 -0700 |
| commit | 6b780a2e97c032d1749f190e0f5cfbbce99d0a60 (patch) | |
| tree | 18287633d9eb2d63d8badf035144e8a3143c00db /doc/lispref | |
| parent | 95c6606a477e017ed7b418fcc81fd937895fee20 (diff) | |
| parent | 9ba51edf62b25c678508a316ec78a09b18d3bf9e (diff) | |
| download | emacs-6b780a2e97c032d1749f190e0f5cfbbce99d0a60.tar.gz emacs-6b780a2e97c032d1749f190e0f5cfbbce99d0a60.zip | |
Merge from origin/emacs-25
9ba51ed Document buffer-swap-text+save-excursion interaction
452aa94 Fix eieio vs cl-generic incompatibilities found in Rudel (bug...
248d5dd Include cl-generic in package--builtin-versions (bug#22817)
8f5a8b6 Improve timing in `tramp-test29-environment-variables'
05ba7a0 Add test for handling environment variables in Tramp
e393d4f * lisp/emacs-lisp/package.el (describe-package-1) (package-st...
5e38887 ; * lisp/net/tramp.el: Fix 2010-10-04 comment typo. (Bug#23913)
90f2169 ; Spelling fixes
069fc05 Improve documentation of search functions
0a0144a Delete environment variables in Tramp when needed
f624671 Add "New in Emacs 25" section to the FAQ
658daf9 Fix 'vertical-motion' in non-interactive sessions
686b520 Fix memory leak in imagemagick-types
4069b71 Update ELisp manual to match 'string-collate-equalp' doc string
1b2d6a6 Clarify docstring of find-feature-regexp
aac62a6 Add details to cl-lib defining macros' docstrings
d6aa4da Clarify doc string of 'save-buffer'
03bcf11 Un-confuse doc string of 'string-collate-equalp'
c53135b Clarify documentation of 'mouse-on-link-p'
# Conflicts:
# lisp/emacs-lisp/eieio-core.el
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/buffers.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 67 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 5 |
3 files changed, 49 insertions, 29 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 1f7f263fb21..740d7cfd8a1 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -1211,6 +1211,12 @@ swapped as well: the positions of point and mark, all the markers, the | |||
| 1211 | overlays, the text properties, the undo list, the value of the | 1211 | overlays, the text properties, the undo list, the value of the |
| 1212 | @code{enable-multibyte-characters} flag (@pxref{Text Representations, | 1212 | @code{enable-multibyte-characters} flag (@pxref{Text Representations, |
| 1213 | enable-multibyte-characters}), etc. | 1213 | enable-multibyte-characters}), etc. |
| 1214 | |||
| 1215 | @strong{Warning:} If this function is called from within a | ||
| 1216 | @code{save-excursion} form, the current buffer will be set to | ||
| 1217 | @var{buffer} upon leaving the form, since the marker used by | ||
| 1218 | @code{save-excursion} to save the position and buffer will be swapped | ||
| 1219 | as well. | ||
| 1214 | @end defun | 1220 | @end defun |
| 1215 | 1221 | ||
| 1216 | If you use @code{buffer-swap-text} on a file-visiting buffer, you | 1222 | If you use @code{buffer-swap-text} on a file-visiting buffer, you |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 644716a95c7..a04e6938cef 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -44,7 +44,7 @@ Searching and Replacement, emacs, The GNU Emacs Manual}. | |||
| 44 | buffer is multibyte; they convert the search string to unibyte if the | 44 | buffer is multibyte; they convert the search string to unibyte if the |
| 45 | buffer is unibyte. @xref{Text Representations}. | 45 | buffer is unibyte. @xref{Text Representations}. |
| 46 | 46 | ||
| 47 | @deffn Command search-forward string &optional limit noerror repeat | 47 | @deffn Command search-forward string &optional limit noerror count |
| 48 | This function searches forward from point for an exact match for | 48 | This function searches forward from point for an exact match for |
| 49 | @var{string}. If successful, it sets point to the end of the occurrence | 49 | @var{string}. If successful, it sets point to the end of the occurrence |
| 50 | found, and returns the new value of point. If no match is found, the | 50 | found, and returns the new value of point. If no match is found, the |
| @@ -95,24 +95,24 @@ The argument @var{noerror} only affects valid searches which fail to | |||
| 95 | find a match. Invalid arguments cause errors regardless of | 95 | find a match. Invalid arguments cause errors regardless of |
| 96 | @var{noerror}. | 96 | @var{noerror}. |
| 97 | 97 | ||
| 98 | If @var{repeat} is a positive number @var{n}, it serves as a repeat | 98 | If @var{count} is a positive number @var{n}, the search is done |
| 99 | count: the search is repeated @var{n} times, each time starting at the | 99 | @var{n} times; each successive search starts at the end of the |
| 100 | end of the previous time's match. If these successive searches | 100 | previous match. If all these successive searches succeed, the |
| 101 | succeed, the function succeeds, moving point and returning its new | 101 | function call succeeds, moving point and returning its new value. |
| 102 | value. Otherwise the search fails, with results depending on the | 102 | Otherwise the function call fails, with results depending on the value |
| 103 | value of @var{noerror}, as described above. If @var{repeat} is a | 103 | of @var{noerror}, as described above. If @var{count} is a negative |
| 104 | negative number -@var{n}, it serves as a repeat count of @var{n} for a | 104 | number -@var{n}, the search is done @var{n} times in the opposite |
| 105 | search in the opposite (backward) direction. | 105 | (backward) direction. |
| 106 | @end deffn | 106 | @end deffn |
| 107 | 107 | ||
| 108 | @deffn Command search-backward string &optional limit noerror repeat | 108 | @deffn Command search-backward string &optional limit noerror count |
| 109 | This function searches backward from point for @var{string}. It is | 109 | This function searches backward from point for @var{string}. It is |
| 110 | like @code{search-forward}, except that it searches backwards rather | 110 | like @code{search-forward}, except that it searches backwards rather |
| 111 | than forwards. Backward searches leave point at the beginning of the | 111 | than forwards. Backward searches leave point at the beginning of the |
| 112 | match. | 112 | match. |
| 113 | @end deffn | 113 | @end deffn |
| 114 | 114 | ||
| 115 | @deffn Command word-search-forward string &optional limit noerror repeat | 115 | @deffn Command word-search-forward string &optional limit noerror count |
| 116 | This function searches forward from point for a word match for | 116 | This function searches forward from point for a word match for |
| 117 | @var{string}. If it finds a match, it sets point to the end of the | 117 | @var{string}. If it finds a match, it sets point to the end of the |
| 118 | match found, and returns the new value of point. | 118 | match found, and returns the new value of point. |
| @@ -156,8 +156,10 @@ returns @code{nil} instead of signaling an error. If @var{noerror} is | |||
| 156 | neither @code{nil} nor @code{t}, it moves point to @var{limit} (or the | 156 | neither @code{nil} nor @code{t}, it moves point to @var{limit} (or the |
| 157 | end of the accessible portion of the buffer) and returns @code{nil}. | 157 | end of the accessible portion of the buffer) and returns @code{nil}. |
| 158 | 158 | ||
| 159 | If @var{repeat} is non-@code{nil}, then the search is repeated that many | 159 | If @var{count} is a positive number, it specifies how many successive |
| 160 | times. Point is positioned at the end of the last match. | 160 | occurrences to search for. Point is positioned at the end of the last |
| 161 | match. If @var{count} is a negative number, the search is backward | ||
| 162 | and point is positioned at the beginning of the last match. | ||
| 161 | 163 | ||
| 162 | @findex word-search-regexp | 164 | @findex word-search-regexp |
| 163 | Internally, @code{word-search-forward} and related functions use the | 165 | Internally, @code{word-search-forward} and related functions use the |
| @@ -165,7 +167,7 @@ function @code{word-search-regexp} to convert @var{string} to a | |||
| 165 | regular expression that ignores punctuation. | 167 | regular expression that ignores punctuation. |
| 166 | @end deffn | 168 | @end deffn |
| 167 | 169 | ||
| 168 | @deffn Command word-search-forward-lax string &optional limit noerror repeat | 170 | @deffn Command word-search-forward-lax string &optional limit noerror count |
| 169 | This command is identical to @code{word-search-forward}, except that | 171 | This command is identical to @code{word-search-forward}, except that |
| 170 | the beginning or the end of @var{string} need not match a word | 172 | the beginning or the end of @var{string} need not match a word |
| 171 | boundary, unless @var{string} begins or ends in whitespace. | 173 | boundary, unless @var{string} begins or ends in whitespace. |
| @@ -173,14 +175,14 @@ For instance, searching for @samp{ball boy} matches @samp{ball boyee}, | |||
| 173 | but does not match @samp{balls boy}. | 175 | but does not match @samp{balls boy}. |
| 174 | @end deffn | 176 | @end deffn |
| 175 | 177 | ||
| 176 | @deffn Command word-search-backward string &optional limit noerror repeat | 178 | @deffn Command word-search-backward string &optional limit noerror count |
| 177 | This function searches backward from point for a word match to | 179 | This function searches backward from point for a word match to |
| 178 | @var{string}. This function is just like @code{word-search-forward} | 180 | @var{string}. This function is just like @code{word-search-forward} |
| 179 | except that it searches backward and normally leaves point at the | 181 | except that it searches backward and normally leaves point at the |
| 180 | beginning of the match. | 182 | beginning of the match. |
| 181 | @end deffn | 183 | @end deffn |
| 182 | 184 | ||
| 183 | @deffn Command word-search-backward-lax string &optional limit noerror repeat | 185 | @deffn Command word-search-backward-lax string &optional limit noerror count |
| 184 | This command is identical to @code{word-search-backward}, except that | 186 | This command is identical to @code{word-search-backward}, except that |
| 185 | the beginning or the end of @var{string} need not match a word | 187 | the beginning or the end of @var{string} need not match a word |
| 186 | boundary, unless @var{string} begins or ends in whitespace. | 188 | boundary, unless @var{string} begins or ends in whitespace. |
| @@ -1005,7 +1007,7 @@ only the search functions useful in programs. The principal one is | |||
| 1005 | the buffer is multibyte; they convert the regular expression to unibyte | 1007 | the buffer is multibyte; they convert the regular expression to unibyte |
| 1006 | if the buffer is unibyte. @xref{Text Representations}. | 1008 | if the buffer is unibyte. @xref{Text Representations}. |
| 1007 | 1009 | ||
| 1008 | @deffn Command re-search-forward regexp &optional limit noerror repeat | 1010 | @deffn Command re-search-forward regexp &optional limit noerror count |
| 1009 | This function searches forward in the current buffer for a string of | 1011 | This function searches forward in the current buffer for a string of |
| 1010 | text that is matched by the regular expression @var{regexp}. The | 1012 | text that is matched by the regular expression @var{regexp}. The |
| 1011 | function skips over any amount of text that is not matched by | 1013 | function skips over any amount of text that is not matched by |
| @@ -1014,14 +1016,12 @@ It returns the new value of point. | |||
| 1014 | 1016 | ||
| 1015 | If @var{limit} is non-@code{nil}, it must be a position in the current | 1017 | If @var{limit} is non-@code{nil}, it must be a position in the current |
| 1016 | buffer. It specifies the upper bound to the search. No match | 1018 | buffer. It specifies the upper bound to the search. No match |
| 1017 | extending after that position is accepted. | 1019 | extending after that position is accepted. If @var{limit} is omitted |
| 1020 | or @code{nil}, it defaults to the end of the accessible portion of the | ||
| 1021 | buffer. | ||
| 1018 | 1022 | ||
| 1019 | If @var{repeat} is supplied, it must be a positive number; the search | 1023 | What @code{re-search-forward} does when the search fails depends on |
| 1020 | is repeated that many times; each repetition starts at the end of the | 1024 | the value of @var{noerror}: |
| 1021 | previous match. If all these successive searches succeed, the search | ||
| 1022 | succeeds, moving point and returning its new value. Otherwise the | ||
| 1023 | search fails. What @code{re-search-forward} does when the search | ||
| 1024 | fails depends on the value of @var{noerror}: | ||
| 1025 | 1025 | ||
| 1026 | @table @asis | 1026 | @table @asis |
| 1027 | @item @code{nil} | 1027 | @item @code{nil} |
| @@ -1033,6 +1033,19 @@ Move point to @var{limit} (or the end of the accessible portion of the | |||
| 1033 | buffer) and return @code{nil}. | 1033 | buffer) and return @code{nil}. |
| 1034 | @end table | 1034 | @end table |
| 1035 | 1035 | ||
| 1036 | The argument @var{noerror} only affects valid searches which fail to | ||
| 1037 | find a match. Invalid arguments cause errors regardless of | ||
| 1038 | @var{noerror}. | ||
| 1039 | |||
| 1040 | If @var{count} is a positive number @var{n}, the search is done | ||
| 1041 | @var{n} times; each successive search starts at the end of the | ||
| 1042 | previous match. If all these successive searches succeed, the | ||
| 1043 | function call succeeds, moving point and returning its new value. | ||
| 1044 | Otherwise the function call fails, with results depending on the value | ||
| 1045 | of @var{noerror}, as described above. If @var{count} is a negative | ||
| 1046 | number -@var{n}, the search is done @var{n} times in the opposite | ||
| 1047 | (backward) direction. | ||
| 1048 | |||
| 1036 | In the following example, point is initially before the @samp{T}. | 1049 | In the following example, point is initially before the @samp{T}. |
| 1037 | Evaluating the search call moves point to the end of that line (between | 1050 | Evaluating the search call moves point to the end of that line (between |
| 1038 | the @samp{t} of @samp{hat} and the newline). | 1051 | the @samp{t} of @samp{hat} and the newline). |
| @@ -1057,7 +1070,7 @@ comes back" twice. | |||
| 1057 | @end example | 1070 | @end example |
| 1058 | @end deffn | 1071 | @end deffn |
| 1059 | 1072 | ||
| 1060 | @deffn Command re-search-backward regexp &optional limit noerror repeat | 1073 | @deffn Command re-search-backward regexp &optional limit noerror count |
| 1061 | This function searches backward in the current buffer for a string of | 1074 | This function searches backward in the current buffer for a string of |
| 1062 | text that is matched by the regular expression @var{regexp}, leaving | 1075 | text that is matched by the regular expression @var{regexp}, leaving |
| 1063 | point at the beginning of the first text found. | 1076 | point at the beginning of the first text found. |
| @@ -1228,13 +1241,13 @@ non-greedy repetition operators (@pxref{Regexp Special, non-greedy}). | |||
| 1228 | This is because POSIX backtracking conflicts with the semantics of | 1241 | This is because POSIX backtracking conflicts with the semantics of |
| 1229 | non-greedy repetition. | 1242 | non-greedy repetition. |
| 1230 | 1243 | ||
| 1231 | @deffn Command posix-search-forward regexp &optional limit noerror repeat | 1244 | @deffn Command posix-search-forward regexp &optional limit noerror count |
| 1232 | This is like @code{re-search-forward} except that it performs the full | 1245 | This is like @code{re-search-forward} except that it performs the full |
| 1233 | backtracking specified by the POSIX standard for regular expression | 1246 | backtracking specified by the POSIX standard for regular expression |
| 1234 | matching. | 1247 | matching. |
| 1235 | @end deffn | 1248 | @end deffn |
| 1236 | 1249 | ||
| 1237 | @deffn Command posix-search-backward regexp &optional limit noerror repeat | 1250 | @deffn Command posix-search-backward regexp &optional limit noerror count |
| 1238 | This is like @code{re-search-backward} except that it performs the full | 1251 | This is like @code{re-search-backward} except that it performs the full |
| 1239 | backtracking specified by the POSIX standard for regular expression | 1252 | backtracking specified by the POSIX standard for regular expression |
| 1240 | matching. | 1253 | matching. |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 4e4c239291e..0b9529460f3 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -503,8 +503,9 @@ the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. | |||
| 503 | If your system does not support a locale environment, this function | 503 | If your system does not support a locale environment, this function |
| 504 | behaves like @code{string-equal}. | 504 | behaves like @code{string-equal}. |
| 505 | 505 | ||
| 506 | Do @emph{not} use this function to compare file names for equality, only | 506 | Do @emph{not} use this function to compare file names for equality, as |
| 507 | for sorting them. | 507 | filesystems generally don't honor linguistic equivalence of strings |
| 508 | that collation implements. | ||
| 508 | @end defun | 509 | @end defun |
| 509 | 510 | ||
| 510 | @defun string-prefix-p string1 string2 &optional ignore-case | 511 | @defun string-prefix-p string1 string2 &optional ignore-case |