Generally, search commands in Emacs by default perform character
folding, thus matching equivalent character sequences. You can
disable this behavior by customizing the variable
-@code{search-default-regexp-mode} to @code{nil}. @xref{Search
+@code{search-default-mode} to @code{nil}. @xref{Search
Customizations}. Within an incremental search, typing @kbd{M-s '}
(@code{isearch-toggle-character-fold}) toggles character folding, but
only for that search. (Replace commands have a different default,
@cindex default search mode
@cindex search mode, default
The default search mode for the incremental search is specified by
-the variable @code{search-default-regexp-mode}. It can be @code{nil},
+the variable @code{search-default-mode}. It can be @code{nil},
@code{t}, or a function. If it is @code{nil}, the default mode is to
do literal searches without character folding, but with case folding
and lax-whitespace matches as determined by @code{case-fold-search}
(autoload 'character-fold-to-regexp "character-fold")
-(defcustom search-default-regexp-mode #'character-fold-to-regexp
+(defcustom search-default-mode #'character-fold-to-regexp
"Default mode to use when starting isearch.
Value is nil, t, or a function.
(setq isearch-forward forward
isearch-regexp (or regexp
(and (not regexp-function)
- (eq search-default-regexp-mode t)))
+ (eq search-default-mode t)))
isearch-regexp-function (or regexp-function
- (and (functionp search-default-regexp-mode)
+ (and (functionp search-default-mode)
(not regexp)
- search-default-regexp-mode))
+ search-default-mode))
isearch-op-fun op-fun
isearch-last-case-fold-search isearch-case-fold-search
isearch-case-fold-search case-fold-search
(isearch-repeat 'backward))
\f
-;;; Toggles for `isearch-regexp-function' and `search-default-regexp-mode'.
+;;; Toggles for `isearch-regexp-function' and `search-default-mode'.
(defmacro isearch-define-mode-toggle (mode key function &optional docstring &rest body)
"Define a command called `isearch-toggle-MODE' and bind it to `M-s KEY'.
The first line of the command's docstring is auto-generated, the
(cl-callf (lambda (types) (cons 'choice
(cons '(const :tag ,(capitalize (format "%s search" mode)) ,function)
(cdr types))))
- (get 'search-default-regexp-mode 'custom-type)))))))
+ (get 'search-default-mode 'custom-type)))))))
(isearch-define-mode-toggle word "w" word-search-regexp "\
Turning on word search turns off regexp mode.")
(setq regexp-function #'word-search-regexp))
(let ((description
;; Don't use a description on the default search mode.
- (cond ((equal regexp-function search-default-regexp-mode) "")
+ (cond ((equal regexp-function search-default-mode) "")
(regexp-function
(and (symbolp regexp-function)
(or (get regexp-function 'isearch-message-prefix)
(isearch-regexp "regexp ")
;; We're in literal mode. If the default mode is not
;; literal, then describe it.
- ((functionp search-default-regexp-mode) "literal "))))
+ ((functionp search-default-mode) "literal "))))
(if space-before
;; Move space from the end to the beginning.
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)