emacs: interactively search open buffers

前端 未结 7 810
滥情空心
滥情空心 2020-12-05 07:52

Is there a way to search all the open buffers for a particular pattern?

C-s interactively searches current buffer. Similarly, is there something that searches all th

7条回答
  •  余生分开走
    2020-12-05 08:17

    This sort of does what you want, in that when you've come to the end of matches for the string/regexp you're searching for, the next search command will start in a new buffer.

    (setq isearch-wrap-function 'isearch-bury-buffer-instead-of-wrap)
    (defun isearch-bury-buffer-instead-of-wrap ()
      "bury current buffer, try to search in next buffer"
      (bury-buffer))
    

    It doesn't switch to a different buffer when the search fails, and when you "back up" the search results by pressing , you won't pop back into the previous buffers searched.

提交回复
热议问题