[Top][All Lists]

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

Re: Simple isearch concerns

From: Juri Linkov
Subject: Re: Simple isearch concerns
Date: Wed, 07 Apr 2021 19:24:59 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> Okay, I looked a bit closer at multi-isearch, and it seems that the
> attached patch works with mutli-isearch, too.
> +  ;; Terminate the search if point has moved to another buffer.
> +  (unless (eq isearch--current-buffer (current-buffer))
> +    (with-current-buffer isearch--current-buffer (isearch-exit)))

When in your original test case '(pop-to-buffer "*Occur*")'
is replaced with '(kill-current-buffer)':

  (define-key isearch-mode-map (kbd "M-s o")
    #'(lambda ()
        (call-interactively 'isearch-occur)

then it fails with:

  Error in post-command-hook (isearch-post-command-hook): (error "Selecting 
deleted buffer")

All other uses of 'isearch--current-buffer' have a check
for a live buffer, e.g.

  (unless (eq (current-buffer) isearch--current-buffer)
    (when (buffer-live-p isearch--current-buffer)
      (with-current-buffer isearch--current-buffer

reply via email to

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