bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37496: 27.0.50; C-s failing to search


From: Juri Linkov
Subject: bug#37496: 27.0.50; C-s failing to search
Date: Mon, 07 Oct 2019 21:17:41 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> I was just editing file names, then quitting with C-c C-c and often
> pressing ^^ to go to upper directory. I have normally two windows,
> from one I move the files to the other one
>
> Sometimes I forget to press C-c C-c, then I notice it and press it,
> but could not observe how the bug is invoked.

Next time you encounter this problem please try running this diagnostics
with just 'M-x isearch-diagnostics RET' in the buffer where isearch fails:

(defun isearch-diagnostics ()
  (interactive)
  (let* ((variables
          '(major-mode
            buffer-read-only
            isearch-mode
            isearch-success
            isearch-error
            isearch-wrapped
            isearch-adjusted
            isearch-suspended
            isearch-regexp
            isearch-case-fold-search
            isearch-invisible
            isearch-hidden
            isearch-allow-scroll
            isearch-search-fun-function
            isearch-wrap-function
            isearch-push-state-function
            isearch-mode-hook
            isearch-update-post-hook
            isearch-mode-end-hook
            isearch-filter-predicate
            dired-isearch-filenames
            dired-isearch-filenames-mode))
         (diagnostics
          (concat
           (mapconcat
            (lambda (v)
              (format "%s: %s %s" v
                      (cl-prin1-to-string (and (boundp v) (buffer-local-value v 
(current-buffer))))
                      (cl-prin1-to-string (and (boundp v) (default-value v)))))
            variables "\n")
           (format "\nany read-only: %S\n" (text-property-any (point-min) 
(point-max) 'read-only t)))))
    (display-buffer
     (with-current-buffer (get-buffer-create "*isearch-diagnostics*")
       (erase-buffer)
       (insert diagnostics)
       (current-buffer)))))

>From what I see wdired doesn't restore a previous value of 
>isearch-filter-predicate.
This is fine as long as there are no read-only properties kept in the
Dired buffer, but it seems in your case read-only properties might be
still present after finishing Wdired-mode.  If you can reproduce the bug
please also try the following patch that could fix it:

diff --git a/lisp/wdired.el b/lisp/wdired.el
index 44f083bb7f..35f1b5ebbd 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -357,6 +357,8 @@ wdired-change-to-dired-mode
     (remove-text-properties
      (point-min) (point-max)
      '(front-sticky nil rear-nonsticky nil read-only nil keymap nil)))
+  (remove-function (local 'isearch-filter-predicate)
+                   #'wdired-isearch-filter-read-only)
   (use-local-map dired-mode-map)
   (force-mode-line-update)
   (setq buffer-read-only t)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]