aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Malabarba2015-10-26 00:51:02 +0000
committerArtur Malabarba2015-10-26 00:51:02 +0000
commit6b5fdca71696a513a9dcd24a12f9de96788a523a (patch)
tree9161a2b32eb9e03d3e0c0d52ed1f2f524217a064
parent207f235e33ce9226d4004b47ccef89b3ea3c7fdb (diff)
downloademacs-6b5fdca71696a513a9dcd24a12f9de96788a523a.tar.gz
emacs-6b5fdca71696a513a9dcd24a12f9de96788a523a.zip
* 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.
-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-%'."
1783 isearch-string 1783 isearch-string
1784 (concat "Query replace" 1784 (concat "Query replace"
1785 (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) 1785 (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t)
1786 (if isearch-regexp " regexp" "")
1787 (if backward " backward" "") 1786 (if backward " backward" "")
1788 (if (and transient-mark-mode mark-active) " in region" "")) 1787 (if (and transient-mark-mode mark-active) " in region" ""))
1789 isearch-regexp) 1788 isearch-regexp)
@@ -2533,12 +2532,19 @@ If there is no completion possible, say so and continue searching."
2533 "Make a string for describing REGEXP-FUNCTION. 2532 "Make a string for describing REGEXP-FUNCTION.
2534If SPACE-BEFORE is non-nil, put a space before, instead of after, 2533If SPACE-BEFORE is non-nil, put a space before, instead of after,
2535the word mode." 2534the word mode."
2535 (when (eq regexp-function t)
2536 (setq regexp-function #'word-search-regexp))
2536 (let ((description 2537 (let ((description
2537 (cond ((and (symbolp regexp-function) 2538 ;; Don't use a description on the default search mode.
2538 (get regexp-function 'isearch-message-prefix)) 2539 (cond ((equal regexp-function search-default-regexp-mode) "")
2539 (get regexp-function 'isearch-message-prefix)) 2540 (regexp-function
2540 (regexp-function "word ") 2541 (and (symbolp regexp-function)
2541 (t "")))) 2542 (or (get regexp-function 'isearch-message-prefix)
2543 "")))
2544 (isearch-regexp "regexp ")
2545 ;; We're in literal mode. If the default mode is not
2546 ;; literal, then describe it.
2547 ((functionp search-default-regexp-mode) "literal "))))
2542 (if space-before 2548 (if space-before
2543 ;; Move space from the end to the beginning. 2549 ;; Move space from the end to the beginning.
2544 (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) 2550 (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
@@ -2574,7 +2580,6 @@ the word mode."
2574 isearch-filter-predicate) 2580 isearch-filter-predicate)
2575 prefix) 2581 prefix)
2576 (isearch--describe-regexp-mode isearch-regexp-function) 2582 (isearch--describe-regexp-mode isearch-regexp-function)
2577 (if isearch-regexp "regexp " "")
2578 (cond 2583 (cond
2579 (multi-isearch-file-list "multi-file ") 2584 (multi-isearch-file-list "multi-file ")
2580 (multi-isearch-buffer-list "multi-buffer ") 2585 (multi-isearch-buffer-list "multi-buffer ")