all messages for Emacs-related lists mirrored at yhetil.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 12:03:11 +0200	[thread overview]
Message-ID: <87mul0rezk.fsf@metalevel.at> (raw)
In-Reply-To: <m2tvfa3ca1.fsf@metalevel.at>

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





  reply	other threads:[~2019-04-08 10:03 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
2019-04-08  2:35     ` Eli Zaretskii
2019-04-08 10:03       ` Markus Triska [this message]
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

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

  git send-email \
    --in-reply-to=87mul0rezk.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.