Open oscarfv opened 4 years ago
I see aggressive-indent-protected-current-commands
contains query-replace
. I don't know why it is ignored.
BTW, this was tested with Emacs 26 and 27. a-i-m is up to date.
Nevermind. The recipe above is not valid because query-replace
is not called interactively.
In my case the problem was observed while executing query-replace
interactively. The cause was ido-hacks-mode
, which makes this-command
return ido-exit-minibuffer
.
(add-to-list 'aggressive-indent-protected-current-commands 'ido-exit-minibuffer)
fixes the problem, although I don't know if it has implications elsewhere.
Save this code to
foo.el
after adjusting the first line if needed:Now invoke Emacs:
Now
M-x eval-buffer
. Pressy
to accept the first replacement; the line"hello"
is re-indented. Pressy
again to accept the second replacement. The line(foo c)
is replaced with(fox
.