[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: icomplete-mode deactivates region
From: |
Stefan Monnier |
Subject: |
Re: icomplete-mode deactivates region |
Date: |
Mon, 21 Mar 2005 16:50:00 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> That means the interesting bits in the example above are these:
> (set-mark (point))
> (beginning-of-line 0))
> ... set the mark and move point. (Using `push-mark' instead of
> `set-mark' doesn't seem to make a difference.)
Oh, I see it now:
% emacs -Q
M-x icomplete-mode RET
M-x transient-mark-mode RET
M-SPC .. move around to select text...
M-x ignore RET
And note how the mark is deactivated.
Note that if you instead do M-x ignore C-g, the mark stays active.
Better yet: you can reproduce the problem even if icomplete-mode is
turned off:
% emacs -Q
M-x transient-mark-mode RET
M-SPC .. move around to select text...
M-x ign RET
The problem is that the RET command modifies the minibuffer and thus sets
deactivate-mark (which is a global variable). And after the command is
finished (we're then back in the main buffer) the command-loop notices
deactivate-mark is non-nil and thus sets mark-active to nil.
I.e. deactivate-mark was set to non-nil in buffer A and it causes
mark-active to be set to nil in buffer B.
I think the right answer is to make deactivate-mark buffer-local.
Stefan
Re: icomplete-mode deactivates region, Stefan Monnier, 2005/03/21