bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#10738: insert before setting the mark means the mark wont be set


From: Stefan Monnier
Subject: bug#10738: insert before setting the mark means the mark wont be set
Date: Mon, 06 Feb 2012 16:24:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

>> From emacs -q, consider the following program:
> (defun foo ()
>   (interactive)
>   (insert "bar")
>   (push-mark)
>   (forward-line)
>   (activate-mark))

> M-x foo, bar appears, but the mark is not set.

> (defun baz ()
>    (interactive)
>    (push-mark)
>    (forward-line)
>    (activate-mark))

> I wouldn't expect a command *before* setting the mark to affect if the
> mark was actually set. Is this a concurrency bug?

The mark gets deactivated after a command that modifies the buffer.
`foo' above is a command that modifies the buffer, so the mark is
deactivated afterwards.  This is done via the
`deactivate-mark' variable.
You can let-bind it around the call to `insert' to prevent that variable
from being set.


        Stefan





reply via email to

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