summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-10-26 00:51:02 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-10-26 00:51:02 +0000
commit6b5fdca71696a513a9dcd24a12f9de96788a523a (patch)
tree9161a2b32eb9e03d3e0c0d52ed1f2f524217a064 /lisp/isearch.el
parent207f235e33ce9226d4004b47ccef89b3ea3c7fdb (diff)
downloademacs-6b5fdca71696a513a9dcd24a12f9de96788a523a.tar.gz
* lisp/isearch.el: No visual feedback for default search mode
During an isearch where character-folding is the default, we don't want to take up minibuffer space just to tell the user that "Char-fold " is on. The same goes for other modes, if the user changes the default. In contrast, if the user toggles OFF the default mode, they should see "Literal", to distinguish it from the default mode. (isearch--describe-regexp-mode): Return "" if describing the default mode, and return "literal " if describing a plain search and it is not default.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 3f8ff7a2d39..3b836e4e32d 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1783,7 +1783,6 @@ replacements from Isearch is `M-s w ... M-%'."
isearch-string
(concat "Query replace"
(isearch--describe-regexp-mode (or delimited isearch-regexp-function) t)
- (if isearch-regexp " regexp" "")
(if backward " backward" "")
(if (and transient-mark-mode mark-active) " in region" ""))
isearch-regexp)
@@ -2533,12 +2532,19 @@ If there is no completion possible, say so and continue searching."
"Make a string for describing REGEXP-FUNCTION.
If SPACE-BEFORE is non-nil, put a space before, instead of after,
the word mode."
+ (when (eq regexp-function t)
+ (setq regexp-function #'word-search-regexp))
(let ((description
- (cond ((and (symbolp regexp-function)
- (get regexp-function 'isearch-message-prefix))
- (get regexp-function 'isearch-message-prefix))
- (regexp-function "word ")
- (t ""))))
+ ;; Don't use a description on the default search mode.
+ (cond ((equal regexp-function search-default-regexp-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 "))))
(if space-before
;; Move space from the end to the beginning.
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
@@ -2574,7 +2580,6 @@ the word mode."
isearch-filter-predicate)
prefix)
(isearch--describe-regexp-mode isearch-regexp-function)
- (if isearch-regexp "regexp " "")
(cond
(multi-isearch-file-list "multi-file ")
(multi-isearch-buffer-list "multi-buffer ")