GNU bug report logs -
#23038
25.0.92; M-% from isearch broken (error in isearch--describe-regexp-mode)
Previous Next
Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Thu, 17 Mar 2016 14:08:01 UTC
Severity: normal
Merged with 23084
Found in version 25.0.92
Fixed in version 25.1
Done: Michael Heerdegen <michael_heerdegen <at> web.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On Thu, Mar 17, 2016 at 11:53 PM, Artur Malabarba <bruce.connor.am <at> gmail.com
> wrote:
> Thanks Kaushal! It looks good to me.
Thanks! Here's a formatted patch (with indentation fixes too).
By mistake I created my last patch with an alias that did git format-patch
ignoring whitespace diffs. Below patch fixes this bug plus those
indentation changes.
From c06557b30dd8b81362c3970b5b9b54154dfabac9 Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Fri, 18 Mar 2016 10:41:04 -0400
Subject: [PATCH] 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. Added 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 debbugs # 23038.
---
lisp/isearch.el | 19 +++++++++++--------
1 file 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 @@ isearch--describe-regexp-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)
--
2.6.0.rc0.24.gec371ff
--
Kaushal Modi
[Message part 2 (text/html, inline)]
This bug report was last modified 9 years and 119 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.