Files
This can be done using the noccur package, which can be installed from MELPA .
It provides two functions:
noccur-dired , which will perform multi-occur in tagged filesnoccur-project , which will execute multi-occur in all files in the current project . This is recursive.
Typical usage from documentation: Mx noccur-project RET foo RET
Then, the contents of the buffer can be edited using the-edit-mode method (associated with e). To save changes to all modified buffers and return to click mode, press Cc Cc .
Buffers
This can be done using the built-in ibuffer . Mark the buffers with the m key, then press the O key to run ibuffer-do-occur at the marked buffers . I personally activate ibuffer using (defalias 'list-buffers 'ibuffer) in my .emacs .
You can also use the built-in multi-occur-in-matching-buffers , which will execute multi-occur in buffers matching the regular expression . A typical use is Mx multi-occur-in-matching-buffers RET ext$ RET regexp RET , where ext$ is a regular expression for buffers already open in Emacs, and regexp is what needs to be matched.
thdox
source share