summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c4
-rw-r--r--src/fns.c3
-rw-r--r--src/image.c8
-rw-r--r--src/indent.c1
-rw-r--r--src/search.c85
5 files changed, 68 insertions, 33 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 8756cbbbd7d..24c997fcdbd 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2224,7 +2224,9 @@ advance_to_char_boundary (ptrdiff_t byte_pos)
DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
1, 1, 0,
- doc: /* Swap the text between current buffer and BUFFER. */)
+ doc: /* Swap the text between current buffer and BUFFER.
+Using this function from `save-excursion' might produce surprising
+results, see Info node `(elisp)Swapping Text'. */)
(Lisp_Object buffer)
{
struct buffer *other_buffer;
diff --git a/src/fns.c b/src/fns.c
index 3895ada325d..31f0fd27418 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -449,8 +449,7 @@ the codeset part of the locale cannot be \"UTF-8\" on MS-Windows.
If your system does not support a locale environment, this function
behaves like `string-equal'.
-Do NOT use this function to compare file names for equality, only
-for sorting them. */)
+Do NOT use this function to compare file names for equality. */)
(Lisp_Object s1, Lisp_Object s2, Lisp_Object locale, Lisp_Object ignore_case)
{
#if defined __STDC_ISO_10646__ || defined WINDOWSNT
diff --git a/src/image.c b/src/image.c
index 1770de7e8ff..7a554ef1b63 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8910,13 +8910,13 @@ and `imagemagick-types-inhibit'. */)
{
Lisp_Object typelist = Qnil;
size_t numf = 0;
- ExceptionInfo ex;
+ ExceptionInfo *ex;
char **imtypes;
size_t i;
- GetExceptionInfo(&ex);
- imtypes = GetMagickList ("*", &numf, &ex);
- DestroyExceptionInfo(&ex);
+ ex = AcquireExceptionInfo ();
+ imtypes = GetMagickList ("*", &numf, ex);
+ DestroyExceptionInfo (ex);
for (i = 0; i < numf; i++)
{
diff --git a/src/indent.c b/src/indent.c
index 1015259cedd..f8c180d3e2b 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2030,6 +2030,7 @@ whether or not it is currently displayed in some window. */)
struct position pos;
pos = *vmotion (PT, PT_BYTE, XINT (lines), w);
SET_PT_BOTH (pos.bufpos, pos.bytepos);
+ it.vpos = pos.vpos;
}
else
{
diff --git a/src/search.c b/src/search.c
index 7c4a02491db..3d4846644ee 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2157,12 +2157,17 @@ DEFUN ("search-backward", Fsearch_backward, Ssearch_backward, 1, 4,
doc: /* Search backward from point for STRING.
Set point to the beginning of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must not extend before that position.
+ The match found must not begin before that position. A value of nil
+ means search to the beginning of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
- If not nil and not t, position at limit of search and return nil.
-Optional fourth argument COUNT, if non-nil, means to search for COUNT
- successive occurrences. If COUNT is negative, search forward,
- instead of backward, for -COUNT occurrences.
+ If not nil and not t, position at limit of search and return nil.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ forward, instead of backward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth to last one (or
+ last, if COUNT is 1 or nil) in the buffer located entirely before
+ the origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
@@ -2177,13 +2182,17 @@ DEFUN ("search-forward", Fsearch_forward, Ssearch_forward, 1, 4, "MSearch: ",
doc: /* Search forward from point for STRING.
Set point to the end of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must not extend after that position. A value of nil is
- equivalent to (point-max).
+ The match found must not end after that position. A value of nil
+ means search to the end of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
-Optional fourth argument COUNT, if non-nil, means to search for COUNT
- successive occurrences. If COUNT is negative, search backward,
- instead of forward, for -COUNT occurrences.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ backward, instead of forward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth one (or first,
+ if COUNT is 1 or nil) in the buffer located entirely after the
+ origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
@@ -2197,14 +2206,19 @@ See also the functions `match-beginning', `match-end' and `replace-match'. */)
DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
"sRE search backward: ",
doc: /* Search backward from point for match for regular expression REGEXP.
-Set point to the beginning of the match, and return point.
-The match found is the one starting last in the buffer
-and yet ending before the origin of the search.
+Set point to the beginning of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must start at or after that position.
+ The match found must not begin before that position. A value of nil
+ means search to the beginning of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
- If not nil and not t, move to limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+ If not nil and not t, position at limit of search and return nil.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ forward, instead of backward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth to last one (or
+ last, if COUNT is 1 or nil) in the buffer located entirely before
+ the origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
@@ -2221,10 +2235,17 @@ DEFUN ("re-search-forward", Fre_search_forward, Sre_search_forward, 1, 4,
doc: /* Search forward from point for regular expression REGEXP.
Set point to the end of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must not extend after that position.
+ The match found must not end after that position. A value of nil
+ means search to the end of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ backward, instead of forward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth one (or first,
+ if COUNT is 1 or nil) in the buffer located entirely after the
+ origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
@@ -2240,14 +2261,19 @@ DEFUN ("posix-search-backward", Fposix_search_backward, Sposix_search_backward,
"sPosix search backward: ",
doc: /* Search backward from point for match for regular expression REGEXP.
Find the longest match in accord with Posix regular expression rules.
-Set point to the beginning of the match, and return point.
-The match found is the one starting last in the buffer
-and yet ending before the origin of the search.
+Set point to the beginning of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must start at or after that position.
+ The match found must not begin before that position. A value of nil
+ means search to the beginning of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
- If not nil and not t, move to limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+ If not nil and not t, position at limit of search and return nil.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ forward, instead of backward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth to last one (or
+ last, if COUNT is 1 or nil) in the buffer located entirely before
+ the origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
@@ -2265,10 +2291,17 @@ DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 1,
Find the longest match in accord with Posix regular expression rules.
Set point to the end of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must not extend after that position.
+ The match found must not end after that position. A value of nil
+ means search to the end of the accessible portion of the buffer.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
-Optional fourth argument is repeat count--search for successive occurrences.
+Optional fourth argument COUNT, if a positive number, means to search
+ for COUNT successive occurrences. If COUNT is negative, search
+ backward, instead of forward, for -COUNT occurrences. A value of
+ nil means the same as 1.
+With COUNT positive, the match found is the COUNTth one (or first,
+ if COUNT is 1 or nil) in the buffer located entirely after the
+ origin of the search; correspondingly with COUNT negative.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.