GNU bug report logs - #10738
insert before setting the mark means the mark wont be set

Previous Next

Package: emacs;

Reported by: Christopher Monsanto <chris <at> monsan.to>

Date: Mon, 6 Feb 2012 18:04:02 UTC

Severity: normal

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Christopher Monsanto <chris <at> monsan.to>
Cc: 10738 <at> debbugs.gnu.org
Subject: bug#10738: insert before setting the mark means the mark wont be set
Date: Mon, 06 Feb 2012 16:24:37 -0500
>> 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




This bug report was last modified 13 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.