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

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

bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode a


From: Juri Linkov
Subject: bug#49963: 28.0.50; isearch failing in Dired after rectangle-mark-mode and query-replace
Date: Tue, 10 Aug 2021 10:03:39 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>   What happened:
> In Dired isearch-{forward,backward} will no longer match anything after 
> running
> `rectangle-mark-mode' and `query-replace'.
>
>   What I thought would happen:
> In Dired after running `rectangle-mark-mode' and `query-replace',
> isearch-{forward,backward} would match again.
>
>   To reproduce:
> 1. emacs -Q
> 2. C-x d <RET>
> 3. C-x C-q
> 4. C-x <SPC> C-n
> 5. M-% <RET> <RET> (entering nothing)
> 6. ^s (searching for anything will show "Failing I-search: ANYTHING" in 
> minibuffer)

Stefan, please help.  Wdired adds advice on a buffer-local 
isearch-filter-predicate,
and perform-replace adds advice on a let-bound isearch-filter-predicate
that changes the global value.  This is the minimal test case:

  (add-function :after-while (local 'isearch-filter-predicate)
                (lambda (&rest _) 'filter-local))

  (let ((isearch-filter-predicate isearch-filter-predicate))
    (add-function :after-while isearch-filter-predicate
                  (lambda (&rest _) 'filter-letbound)))

C-h v isearch-filter-predicate:

  Value:
  #f(advice-wrapper :after-while #f(compiled-function
                                    (&rest args)
                                    #<bytecode -0x1d2ab1d0859aebb6>)
                    (closure
                     (t)
                     (&rest _)
                     'filter-local))
  Local in buffer *scratch*; global value is
  #f(advice-wrapper :after-while isearch-filter-visible
                     (closure
                      (t)
                      (&rest _)
                      'filter-letbound))

Let-binding was supposed to protect from changing the global value,
but with a buffer-local value it still changes the global value.





reply via email to

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