[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 91e6676: Fix an Isearch var to be a string (Bug#2
From: |
Michael Heerdegen |
Subject: |
[Emacs-diffs] emacs-25 91e6676: Fix an Isearch var to be a string (Bug#23038) |
Date: |
Tue, 22 Mar 2016 00:10:18 +0000 |
branch: emacs-25
commit 91e667692ba1362ca1334b8d58fd16c305ad5e2a
Author: Kaushal Modi <address@hidden>
Commit: Michael Heerdegen <address@hidden>
Fix an Isearch var to be a string (Bug#23038)
* isearch.el (isearch--describe-regexp-mode): The `description' var
needs to always be a string. Add the missing default case for the
cond form that ensures that.
Before this bug fix, for the events when `regexp-function' and
`search-default-mode' both were nil, `description' also stayed nil. So
when `space-before' was non-nil, the "non-string" `description'
(with a value of nil) got passed as an argument to
`replace-regexp-in-string' (where a string was expected). That caused
the error described in Bug#23038.
---
lisp/isearch.el | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 988503e..48354d3 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2585,16 +2585,19 @@ the word mode."
(eq search-default-mode isearch-regexp))) "")
;; 2. Use the `isearch-message-prefix' set for
;; `regexp-function' if available.
- (regexp-function
- (and (symbolp regexp-function)
- (or (get regexp-function 'isearch-message-prefix)
- "")))
+ (regexp-function
+ (and (symbolp regexp-function)
+ (or (get regexp-function 'isearch-message-prefix)
+ "")))
;; 3. Else if `isearch-regexp' is non-nil, set description
;; to "regexp ".
- (isearch-regexp "regexp ")
- ;; 4. And finally, if we're in literal mode (and if the
- ;; default mode is also not literal), describe it.
- ((functionp search-default-mode) "literal "))))
+ (isearch-regexp "regexp ")
+ ;; 4. Else if we're in literal mode (and if the default
+ ;; mode is also not literal), describe it.
+ ((functionp search-default-mode) "literal ")
+ ;; 5. And finally, if none of the above is true, set the
+ ;; description to an empty string.
+ (t ""))))
(if space-before
;; Move space from the end to the beginning.
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 91e6676: Fix an Isearch var to be a string (Bug#23038),
Michael Heerdegen <=