Subject: bug#10056: 24.0.91; `copy-to-register' does not deactivate the mark

From: Stefan Monnier <[email-masked]>
Date: Sat, 08 Sep 2012 16:21:37 -0400

>> This behavior is definitely annoying for me: when I mark some fragment
>> of code and type TAB, what I want is that Emacs revise the indentation
>> of code, and correct it if necessary, but in any case, I don't want
>> the mark to remain active.
> Have you looked at the code for c-i-l-o-region?  At a quick glance, I
> can't see where the distinction is made between indentation adjusted and
> not adjusted.

The way mark deactivation works is that the mark gets deactivated after
any command that modified the buffer (that's the basic heuristic used
to avoid having to change umpteen commands to explicitly deactivate-mark).
In the case of commands like indent-region which sometimes modify the
buffer and sometimes not, it's often necessary to explicitly call
deactivate-mark to avoid the kind of inconsistencies described above.

        Stefan