unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Markus Triska <triska@metalevel.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 35177@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	[thread overview]
Message-ID: <877ec5wid3.fsf@metalevel.at> (raw)
In-Reply-To: <831s2dakjz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Apr 2019 18:42:40 +0300")

Eli Zaretskii <eliz@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.





  reply	other threads:[~2019-04-07 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07  0:11 bug#35177: 27.0.50; Binding deactivate-mark to nil unexpectedly deactivates the mark Markus Triska
2019-04-07 15:42 ` Eli Zaretskii
2019-04-07 22:39   ` Markus Triska [this message]
2019-04-08  2:35     ` Eli Zaretskii
2019-04-08 10:03       ` Markus Triska
2019-04-08 15:09         ` Eli Zaretskii
2019-04-08 15:50           ` Markus Triska
2019-04-08 16:00             ` Eli Zaretskii
2019-04-09  0:04             ` Noam Postavsky
2019-04-09 15:26               ` Markus Triska
2019-04-09 23:46                 ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ec5wid3.fsf@metalevel.at \
    --to=triska@metalevel.at \
    --cc=35177@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).