diff options
| author | Kaushal Modi | 2016-03-14 20:15:17 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-03-14 20:15:17 +0200 |
| commit | 0ce37eac45f8b1279e89e854f71bb3f35fd43d29 (patch) | |
| tree | 9a0ca1e990ab544c9b9ccf561defd4a8afb364db | |
| parent | f3033d4d028c1cd7c36ce9e9aa82f4a6c33f57c7 (diff) | |
| download | emacs-0ce37eac45f8b1279e89e854f71bb3f35fd43d29.tar.gz emacs-0ce37eac45f8b1279e89e854f71bb3f35fd43d29.zip | |
Fix Isearch prompt when invoked with an argument
* lisp/isearch.el (isearch--describe-regexp-mode): With
`search-default-mode' set to nil, if user does C-u C-s, the minibuffer
now displays "Regexp I-search: " again. But if the user has set
`search-default-mode' to t, and then does C-s, the minibuffer now
displays "I-search: " because the default search mode is now regexp
mode. Comments have been added to explain the priority of conditions
in the `cond' form. (Bug#22991)
| -rw-r--r-- | lisp/isearch.el | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index b8ada2c766a..988503eaa4f 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2574,15 +2574,26 @@ the word mode." | |||
| 2574 | (when (eq regexp-function t) | 2574 | (when (eq regexp-function t) |
| 2575 | (setq regexp-function #'word-search-regexp)) | 2575 | (setq regexp-function #'word-search-regexp)) |
| 2576 | (let ((description | 2576 | (let ((description |
| 2577 | ;; Don't use a description on the default search mode. | 2577 | (cond |
| 2578 | (cond ((equal regexp-function search-default-mode) "") | 2578 | ;; 1. Do not use a description on the default search mode, |
| 2579 | ;; but only if the default search mode is non-nil. | ||
| 2580 | ((or (and search-default-mode | ||
| 2581 | (equal search-default-mode regexp-function)) | ||
| 2582 | ;; Special case where `search-default-mode' is t | ||
| 2583 | ;; (defaults to regexp searches). | ||
| 2584 | (and (eq search-default-mode t) | ||
| 2585 | (eq search-default-mode isearch-regexp))) "") | ||
| 2586 | ;; 2. Use the `isearch-message-prefix' set for | ||
| 2587 | ;; `regexp-function' if available. | ||
| 2579 | (regexp-function | 2588 | (regexp-function |
| 2580 | (and (symbolp regexp-function) | 2589 | (and (symbolp regexp-function) |
| 2581 | (or (get regexp-function 'isearch-message-prefix) | 2590 | (or (get regexp-function 'isearch-message-prefix) |
| 2582 | ""))) | 2591 | ""))) |
| 2592 | ;; 3. Else if `isearch-regexp' is non-nil, set description | ||
| 2593 | ;; to "regexp ". | ||
| 2583 | (isearch-regexp "regexp ") | 2594 | (isearch-regexp "regexp ") |
| 2584 | ;; We're in literal mode. If the default mode is not | 2595 | ;; 4. And finally, if we're in literal mode (and if the |
| 2585 | ;; literal, then describe it. | 2596 | ;; default mode is also not literal), describe it. |
| 2586 | ((functionp search-default-mode) "literal ")))) | 2597 | ((functionp search-default-mode) "literal ")))) |
| 2587 | (if space-before | 2598 | (if space-before |
| 2588 | ;; Move space from the end to the beginning. | 2599 | ;; Move space from the end to the beginning. |