* lisp/isearch.el: Rename search-default-regexp-mode to search-default-mode

(search-default-mode): New variable.
(isearch-mode, isearch-define-mode-toggle)
(isearch--describe-regexp-mode): Update accordingly.
* lisp/menu-bar.el (nonincremental-search-forward): Update accordingly.
* etc/NEWS: Update accordingly.
* doc/emacs/search.texi: Update accordingly.
This commit is contained in:
Artur Malabarba 2016-02-06 18:44:22 +00:00
parent c77ffc8019
commit 4ea1ea7c73
4 changed files with 12 additions and 12 deletions

View file

@ -1268,7 +1268,7 @@ character sequences}.
Generally, search commands in Emacs by default perform character Generally, search commands in Emacs by default perform character
folding, thus matching equivalent character sequences. You can folding, thus matching equivalent character sequences. You can
disable this behavior by customizing the variable 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 '} Customizations}. Within an incremental search, typing @kbd{M-s '}
(@code{isearch-toggle-character-fold}) toggles character folding, but (@code{isearch-toggle-character-fold}) toggles character folding, but
only for that search. (Replace commands have a different default, only for that search. (Replace commands have a different default,
@ -1800,7 +1800,7 @@ not described elsewhere.
@cindex default search mode @cindex default search mode
@cindex search mode, default @cindex search mode, default
The default search mode for the incremental search is specified by 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 @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 do literal searches without character folding, but with case folding
and lax-whitespace matches as determined by @code{case-fold-search} and lax-whitespace matches as determined by @code{case-fold-search}

View file

@ -586,7 +586,7 @@ item as before.
** Search and Replace ** Search and Replace
+++ +++
*** New user option `search-default-regexp-mode' *** New user option `search-default-mode'
specifies the default mode for I-search. specifies the default mode for I-search.
+++ +++

View file

@ -224,7 +224,7 @@ Default value, nil, means edit the string instead."
(autoload 'character-fold-to-regexp "character-fold") (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. "Default mode to use when starting isearch.
Value is nil, t, or a function. Value is nil, t, or a function.
@ -868,11 +868,11 @@ used to set the value of `isearch-regexp-function'."
(setq isearch-forward forward (setq isearch-forward forward
isearch-regexp (or regexp isearch-regexp (or regexp
(and (not regexp-function) (and (not regexp-function)
(eq search-default-regexp-mode t))) (eq search-default-mode t)))
isearch-regexp-function (or regexp-function isearch-regexp-function (or regexp-function
(and (functionp search-default-regexp-mode) (and (functionp search-default-mode)
(not regexp) (not regexp)
search-default-regexp-mode)) search-default-mode))
isearch-op-fun op-fun isearch-op-fun op-fun
isearch-last-case-fold-search isearch-case-fold-search isearch-last-case-fold-search isearch-case-fold-search
isearch-case-fold-search case-fold-search isearch-case-fold-search case-fold-search
@ -1506,7 +1506,7 @@ Use `isearch-exit' to quit without signaling."
(isearch-repeat 'backward)) (isearch-repeat 'backward))
;;; 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) (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'. "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 The first line of the command's docstring is auto-generated, the
@ -1538,7 +1538,7 @@ The command then executes BODY and updates the isearch prompt."
(cl-callf (lambda (types) (cons 'choice (cl-callf (lambda (types) (cons 'choice
(cons '(const :tag ,(capitalize (format "%s search" mode)) ,function) (cons '(const :tag ,(capitalize (format "%s search" mode)) ,function)
(cdr types)))) (cdr types))))
(get 'search-default-regexp-mode 'custom-type))))))) (get 'search-default-mode 'custom-type)))))))
(isearch-define-mode-toggle word "w" word-search-regexp "\ (isearch-define-mode-toggle word "w" word-search-regexp "\
Turning on word search turns off regexp mode.") Turning on word search turns off regexp mode.")
@ -2571,7 +2571,7 @@ the word mode."
(setq regexp-function #'word-search-regexp)) (setq regexp-function #'word-search-regexp))
(let ((description (let ((description
;; Don't use a description on the default search mode. ;; 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 (regexp-function
(and (symbolp regexp-function) (and (symbolp regexp-function)
(or (get regexp-function 'isearch-message-prefix) (or (get regexp-function 'isearch-message-prefix)
@ -2579,7 +2579,7 @@ the word mode."
(isearch-regexp "regexp ") (isearch-regexp "regexp ")
;; We're in literal mode. If the default mode is not ;; We're in literal mode. If the default mode is not
;; literal, then describe it. ;; literal, then describe it.
((functionp search-default-regexp-mode) "literal ")))) ((functionp search-default-mode) "literal "))))
(if space-before (if space-before
;; Move space from the end to the beginning. ;; Move space from the end to the beginning.
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)

View file

@ -244,7 +244,7 @@
(setq menu-bar-last-search-type 'string) (setq menu-bar-last-search-type 'string)
;; Ideally, this whole command would be equivalent to `C-s RET'. ;; Ideally, this whole command would be equivalent to `C-s RET'.
(let ((isearch-forward (not backward)) (let ((isearch-forward (not backward))
(isearch-regexp-function search-default-regexp-mode) (isearch-regexp-function search-default-mode)
(isearch-regexp nil)) (isearch-regexp nil))
(if (or (equal string "") (not string)) (if (or (equal string "") (not string))
(funcall (isearch-search-fun-default) (car search-ring)) (funcall (isearch-search-fun-default) (car search-ring))