From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/searching-and-case.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 devdocs/elisp/searching-and-case.html (limited to 'devdocs/elisp/searching-and-case.html') diff --git a/devdocs/elisp/searching-and-case.html b/devdocs/elisp/searching-and-case.html new file mode 100644 index 00000000..afbcf942 --- /dev/null +++ b/devdocs/elisp/searching-and-case.html @@ -0,0 +1,12 @@ +

Searching and Case

By default, searches in Emacs ignore the case of the text they are searching through; if you specify searching for ‘FOO’, then ‘Foo’ or ‘foo’ is also considered a match. This applies to regular expressions, too; thus, ‘[aB]’ would match ‘a’ or ‘A’ or ‘b’ or ‘B’.

If you do not want this feature, set the variable case-fold-search to nil. Then all letters must match exactly, including case. This is a buffer-local variable; altering the variable affects only the current buffer. (See Intro to Buffer-Local.) Alternatively, you may change the default value. In Lisp code, you will more typically use let to bind case-fold-search to the desired value.

Note that the user-level incremental search feature handles case distinctions differently. When the search string contains only lower case letters, the search ignores case, but when the search string contains one or more upper case letters, the search becomes case-sensitive. But this has nothing to do with the searching functions used in Lisp code. See Incremental Search in The GNU Emacs Manual.

This buffer-local variable determines whether searches should ignore case. If the variable is nil they do not ignore case; otherwise (and by default) they do ignore case.

+
User Option: case-replace +
+

This variable determines whether the higher-level replacement functions should preserve case. If the variable is nil, that means to use the replacement text verbatim. A non-nil value means to convert the case of the replacement text according to the text being replaced.

This variable is used by passing it as an argument to the function replace-match. See Replacing Match.

+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-and-Case.html +

+
-- cgit v1.2.3