diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-09-25 17:00:17 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-09-25 17:08:00 +0200 |
commit | 497a1ed8bba528bf4078c80bb00b29870eb01e6f (patch) | |
tree | 55aec2280ff0b5cf281838ba3260cd2df41d955d /doc/lispref/strings.texi | |
parent | 499848d8407855d8ca24f0c175c602a0f24da074 (diff) | |
download | emacs-497a1ed8bba528bf4078c80bb00b29870eb01e6f.tar.gz |
string-search robustness and documentation improvement (bug#43598)
* src/fns.c (Fstring_search): Check START-POS argument range.
Simplify logic. Improve doc string.
* test/src/fns-tests.el (string-search): Add test cases.
* doc/lispref/strings.texi (Text Comparison): Elaborate.
* lisp/emacs-lisp/byte-opt.el (pure-fns): Mark string-search as pure.
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r-- | doc/lispref/strings.texi | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 6eb3d6f3100..0f157c39d63 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -660,8 +660,10 @@ ignores case differences. Return the position of the first instance of @var{needle} in @var{haystack}, both of which are strings. If @var{start-pos} is non-@code{nil}, start searching from that position in @var{needle}. +Return @code{nil} if no match was found. This function only considers the characters in the strings when doing -the comparison; text properties are ignored. +the comparison; text properties are ignored. Matching is always +case-sensitive. @end defun @defun compare-strings string1 start1 end1 string2 start2 end2 &optional ignore-case |