Another #emacs editing discovery. Every time my thought process goes along the lines of: "I can also do this!?!!"
Today's cast: #occur, #regex isearch, wgrep, and optionally keyboard macros, iedit and wdired.
(h/t This thread: https://emacs.ch/@ramin_hal9001/110933437057616428.
@ramin_hal9001 and @cwebber were mentioning many cools emacs tips and I learnt that I can *edit* what comes out of occur!)
TIL that you can switch from isearch to occur mid search! So you can do something like:
1. Start incremental (regexp) search in an editable buffer.
2. Once satisfied with the regex/search term, Do `M-s o` to have all matching lines end up in an occur buffer.
3. Press `e` to enable wgrep giving you an editable buffer with only matching lines.
4. Do whatever editing you like: iedit, regex replace, keyboard macros, whatever.
5. `C-c C-c` when done and the changes get reflected in *original buffer*.
Triggering occur after incremental search gets you the best of both worlds: the visual feedback on the regexp search helping to interactively adjust it. You jump to occur only when you're satisfied with the matches. It will be as if you had magically typed out that complex regexp free-hand.
#occur : to meet; to clash
- French: arrive
- German: auftreten
- Portuguese: ocorrer
- Spanish: ocurre
------------
See previous words @ https://wordofthehour.org/r/past
#occur : to meet; to clash
- French: arrive
- German: auftreten
- Portuguese: ocorrer
- Spanish: ocurre
------------
See previous words @ https://wordofthehour.org/r/past