I came across this problem today: I had a table with many entries and wanted to perform a text substitution (normal text substitution was sufficient as I hardly ever need regex text substitutions) in all cells of a single column. I ended up pressing y
and n
many times, instead of just !
as it would've been had I had a way of restricting the text substitution (I used M-%
/ query-replace
).
What's the best way of performing this task?
region-extract-function
which is respected byquery-replace
. The tricky part is to get the buffer-positions of the table slice's rows.