unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Oleh Krehel <ohwoeowho@gmail.com>
Cc: 20357-done@debbugs.gnu.org
Subject: bug#20357: 25.0.50; deactivate-mark behavior broken
Date: Fri, 17 Apr 2015 15:15:58 -0400	[thread overview]
Message-ID: <jwvfv7ywp4y.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAA01p3qoKRPkQ1tByj_WBrEcHKcT2tNPZrXuUGx+Abse-tjXBw@mail.gmail.com> (Oleh Krehel's message of "Fri, 17 Apr 2015 20:30:14 +0200")

>>> (with-temp-buffer
>>> (insert "foobar")
>>> (set-mark (point))
>>> (goto-char (point-min))
>>> (indent-region (point-min)
>>> (point-max))
>>> mark-active)
>>> In 24.5 it returns nil, which is correct. While in 25 it returns t.
>> Why is it more correct to return nil than to return t?
> Because it's a long standing behavior that if you mark some stuff and
> press TAB, the mark will be deactivated.

That's still the case.  The difference is that now it's deactivated by
the command loop rather than by the command itself.  Doing it in the
command loop is the normal behavior (the one used for most other
commands which cause the mark to be deactivated).

>>> This is a recent change, 24.5.2 doesn't have this bug.
>>> (let (deactivate-mark)
>>>   (indent-region (region-beginning)
>>>                  (region-end)))
>>> Expected behavior: the mark isn't deactivated.
>> At least in 24.4, the mark does get deactivated in my test.

It's also deactivated in Emacs-23.4 in my tests.

> But when I've tested with 24.5 or 25 on my own machine, the tests were
> running fine.

I think we need to know more about what your tests really do.
Maybe they should just be fixed to test (or (not mark-active)
deactivate-mark) instead of only testing mark-active.


        Stefan





      reply	other threads:[~2015-04-17 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 10:21 bug#20357: 25.0.50; deactivate-mark behavior broken Oleh Krehel
2015-04-17 14:31 ` Stefan Monnier
2015-04-17 16:02   ` Oleh Krehel
2015-04-17 18:22     ` Stefan Monnier
2015-04-17 18:30       ` Oleh Krehel
2015-04-17 19:15         ` Stefan Monnier [this message]

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=jwvfv7ywp4y.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20357-done@debbugs.gnu.org \
    --cc=ohwoeowho@gmail.com \
    /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).