GNU bug report logs -
#35177
27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
> I think you need to put the entire progn inside the binding of
> deactivate-mark. IOW, the binding should be in effect when the
> command terminates.
Please consider the following additional test cases: Both of the
following forms keep the mark activated, while neither of them has the
binding in effect when the commond terminates.
Form 1:
(progn
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(erase-buffer)
(insert "hello"))
(set-mark-command nil)
(move-beginning-of-line nil))
Form 2:
(progn
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(erase-buffer)
(insert "hello"))
(let (deactivate-mark-1)
(set-mark-command nil)
(move-beginning-of-line nil)))
So, it seems very unexpected to me that an additional let-binding of
deactivate-mark (to nil) causes deactivation of the mark, whereas both
of these forms keep the mark activated (when evaluated with C-x C-e).
If anything, I expect an additional let-binding of deactivate-mark to
nil to retain the active mark "all the more". In other words, if:
(progn
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(erase-buffer)
(insert "hello"))
(let (deactivate-mark-1)
(set-mark-command nil)
(move-beginning-of-line nil)))
keeps the mark activated, then I expect the following to do too:
(progn
(let (deactivate-mark)
(switch-to-buffer (get-buffer-create "t"))
(erase-buffer)
(insert "hello"))
(let (deactivate-mark)
(set-mark-command nil)
(move-beginning-of-line nil)))
Note that I only changed deactivate-mark-1 to deactivate-mark.
So, in other words, binding deactivate-mark to nil deactivates the mark,
which is the opposite of what I expect it to do.
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.