[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21176: 25.0.50; Garbage in the header line of *Occur* buffers
From: |
Juri Linkov |
Subject: |
bug#21176: 25.0.50; Garbage in the header line of *Occur* buffers |
Date: |
Wed, 14 Oct 2015 19:09:36 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) |
>> I still see garbage that you reported with (setq character-fold-search t).
>
> Oh, I didn't notice that the default value of that variable was
> changed to nil. Then you're right - the bug isn't fixed yet.
>
>> While your bug report is closed, I can't fix it.
>
> Can't you? The status of a bug report should not prevent you from
> doing anything. ;)
>
> Ok, I've just re-opened the bug report.
Thanks, it's more comfortable to fix open bugs rather than closed :)
For this bug the only good solution I see is like in this patch:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 4fc9b38..16ed9af 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1831,7 +1839,12 @@ (defun isearch-occur (regexp &optional nlines)
isearch-regexp-lax-whitespace
isearch-lax-whitespace)
search-whitespace-regexp)))
- (occur regexp nlines)))
+ (occur (if isearch-word
+ (propertize regexp
+ 'isearch-string isearch-string
+ 'isearch-word-mode (isearch--describe-word-mode
isearch-word))
+ regexp)
+ nlines)))
(declare-function hi-lock-read-face-name "hi-lock" ())
diff --git a/lisp/replace.el b/lisp/replace.el
index 3a908ac..718499f 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1657,8 +1657,12 @@ (defun occur-engine (regexp buffers out-buf nlines
case-fold
lines (if (= lines 1) ""
"s")))
;; Don't display regexp for multi-buffer.
(if (> (length buffers) 1)
- "" (format " for \"%s\""
- (query-replace-descr regexp)))
+ "" (format " for %s\"%s\""
+ (or (get-text-property 0
'isearch-word-mode regexp)
+ "")
+ (query-replace-descr
+ (or (get-text-property 0
'isearch-string regexp)
+ regexp))))
(buffer-name buf))
'read-only t))
(setq end (point))