GNU bug report logs - #35177
27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sun, 7 Apr 2019 00:09:02 UTC

Severity: normal

Found in version 27.0.50

Full log


View this message in rfc822 format

From: Markus Triska <triska <at> metalevel.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35177 <at> debbugs.gnu.org
Subject: bug#35177: 27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark
Date: Mon, 08 Apr 2019 00:39:04 +0200
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.