GNU bug report logs -
#35177
27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark
Previous Next
Full log
Message #17 received at 35177 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> None of your additional test cases do what I said I thought you should
> do, though, do they?
In emacs -Q, please evaluate the following form with C-x C-e:
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(insert "hello")
(set-mark-command nil)
(move-beginning-of-line nil))
This does what you say. However, the mark is deactivated after the form
is executed, which is the opposite of what I expect from this snippet.
> I don't think it's something in your code that deactivates the mark,
> it's what Emacs does internally when a command finishes.
I noticed that the mark stays activate (as expected), when I add a
"redisplay" after switch-to-buffer:
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(redisplay)
(insert "hello")
(set-mark-command nil)
(move-beginning-of-line nil))
After I evaluate this, the first form also consistently retains the
active mark when I evaluate it. It is expected that the mark stays
active, but it is unexpected that it does so after I evaluate the second
form, yet is deactivated if I only evaluate the first form.
Please also note that the documentation of deactivate-mark states
"around the code that does the modification". If other preconditions are
necessary to consistently retain the active mark, could you please
document them? Thank you.
This bug report was last modified 6 years and 164 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.