emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cvs] bug when using pc-selection-mode/transient-mark-mode


From: Karl Chen
Subject: Re: [cvs] bug when using pc-selection-mode/transient-mark-mode
Date: Sun, 22 Sep 2002 18:05:38 -0700 (PDT)

On Sun, 22 Sep 2002, Stefan Monnier wrote:
> `mark-active' is buffer-local and I think `deactivate-mark' should
> be buffer-local as well.  But that begs the question "when do we check
> whether deactivate-mark was set and reset mark-active accordingly" ?
> Are we going to loop through all buffers, looking for ones with
> a non-nil deactivate-mark ?
> So maybe we should not make it buffer-local but instead make it hold
> a list of buffers whose mark should be deactivated.
> Currently we only use t or nil where t means "current-buffer".

Some options for a buffer-local deactivate-mark without checking all
buffers:

1. Only check deactivate-mark of the buffer that is current at the end of
each command (at the same places it's currently checked). This is similar
to current behavior (besides avoiding the temporary buffer modification
quirks); the current code doesn't support implicit mark deactivation using
deactivate-mark on buffers besides the one that's current at the end of
the command, either.  The downside is that if deactivate-mark IS set in a
non-current buffer then the behavior later can be non-deterministic (e.g.:
start in buffer B1. command C1 sets deactivate-mark in B2 but stays in B1.
... command C2 switches to B2. B2's mark will get deactivated after C2
because at C2, the command loop only cleared B1's deactivate-mark but then
checked B2's deactivate-mark).

2. In the command loop, check only the deactivate-mark of the buffer that
was current at the beginning of the command. However, if a command
switches to another buffer, modifies the new buffer, and stays in this
buffer, then the new buffer's mark SHOULD get deactivated.

3. Check the deactivate-mark of the buffer that was current at the
beginning of the command, and if the current buffer at the end of the
command is different, check that also.

Non-automatic mark deactivation on any buffer can always be done using the
deactivate-mark /function/. The small number of commands that want to
deactivate the mark in a non-current buffer (I can't think of any right
now) perhaps should required to do so explicitly.

-- 
Karl Chen / address@hidden








reply via email to

[Prev in Thread] Current Thread [Next in Thread]