[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isearch multiple buffers
From: |
Juri Linkov |
Subject: |
Re: isearch multiple buffers |
Date: |
Sun, 20 Jul 2008 22:34:07 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
> It would be nice to have this in ibuffer too...
Done in the patch below where I also renamed too long function
name `multi-isearch-forward-buffers' to `multi-isearch-buffers'
(and `multi-isearch-forward-files' to `multi-isearch-files').
As for key bindings, I don't know what does `A' in Dired stand for,
but it seems it has mnemonics for _a_ll files/buffers. By analogy,
I've added two key bindings to ibuffer with the key `a' inside:
M-s a C-s ibuffer-do-isearch
M-s a M-C-s ibuffer-do-isearch-regexp
`C-s' and `M-C-s' at the end of the key sequence are very convenient.
They cause the feeling that these commands were run by typing standard
Isearch keys `C-s' and `M-C-s', and the user can immediately type the same
`C-s' again to repeat the search with the last search string and so on.
Index: lisp/ibuf-ext.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ibuf-ext.el,v
retrieving revision 1.71
diff -c -r1.71 ibuf-ext.el
*** lisp/ibuf-ext.el 27 Jun 2008 10:34:50 -0000 1.71
--- lisp/ibuf-ext.el 20 Jul 2008 19:33:48 -0000
***************
*** 408,413 ****
--- 408,431 ----
:modifier-p :maybe)
(revert-buffer t t))
+ ;;;###autoload (autoload 'ibuffer-do-isearch "ibuf-ext")
+ (define-ibuffer-op ibuffer-do-isearch ()
+ "Perform a `isearch-forward' in marked buffers."
+ (:interactive ()
+ :opstring "searched in"
+ :complex t
+ :modifier-p :maybe)
+ (multi-isearch-buffers (ibuffer-get-marked-buffers)))
+
+ ;;;###autoload (autoload 'ibuffer-do-isearch-regexp "ibuf-ext")
+ (define-ibuffer-op ibuffer-do-isearch-regexp ()
+ "Perform a `isearch-forward-regexp' in marked buffers."
+ (:interactive ()
+ :opstring "searched regexp in"
+ :complex t
+ :modifier-p :maybe)
+ (multi-isearch-buffers-regexp (ibuffer-get-marked-buffers)))
+
;;;###autoload (autoload 'ibuffer-do-replace-regexp "ibuf-ext")
(define-ibuffer-op replace-regexp (from-str to-str)
"Perform a `replace-regexp' in marked buffers."
Index: lisp/ibuffer.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ibuffer.el,v
retrieving revision 1.107
diff -c -r1.107 ibuffer.el
*** lisp/ibuffer.el 2 Jul 2008 13:28:01 -0000 1.107
--- lisp/ibuffer.el 20 Jul 2008 19:33:05 -0000
***************
*** 410,415 ****
--- 410,417 ----
(define-key map (kbd "=") 'ibuffer-diff-with-file)
(define-key map (kbd "j") 'ibuffer-jump-to-buffer)
(define-key map (kbd "M-g") 'ibuffer-jump-to-buffer)
+ (define-key map (kbd "M-s a C-s") 'ibuffer-do-isearch)
+ (define-key map (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp)
(define-key map (kbd "DEL") 'ibuffer-unmark-backward)
(define-key map (kbd "M-DEL") 'ibuffer-unmark-all)
(define-key map (kbd "* *") 'ibuffer-unmark-all)
***************
*** 2376,2381 ****
--- 2378,2385 ----
'\\[ibuffer-do-revert]' - Revert the marked buffers.
'\\[ibuffer-do-toggle-read-only]' - Toggle read-only state of marked
buffers.
'\\[ibuffer-do-delete]' - Kill the marked buffers.
+ '\\[ibuffer-do-isearch]' - Do incremental search in the marked buffers.
+ '\\[ibuffer-do-isearch-regexp]' - Isearch for regexp in the marked buffers.
'\\[ibuffer-do-replace-regexp]' - Replace by regexp in each of the marked
buffers.
'\\[ibuffer-do-query-replace]' - Query replace in each of the marked
buffers.
--
Juri Linkov
http://www.jurta.org/emacs/