unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 20357-done@debbugs.gnu.org
Subject: bug#20357: 25.0.50; deactivate-mark behavior broken
Date: Fri, 17 Apr 2015 18:02:57 +0200	[thread overview]
Message-ID: <CAA01p3pkfyA-Myh8tbOB3g+5NXatBXs1=JYrEstzH7p0bTNyhA@mail.gmail.com> (raw)
In-Reply-To: <jwv383yygqg.fsf-monnier+emacsbugs@gnu.org>

Hi Stefan,

On Fri, Apr 17, 2015 at 4:31 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> (let (deactivate-mark)
>>   (indent-region (region-beginning)
>>                  (region-end)))
>> Expected behavior: the mark isn't deactivated.
>> Actual behavior: the mark is deactivated.
>
> Oops, indeed.  Fixed with the patch below,
>
> diff --git a/lisp/indent.el b/lisp/indent.el
> index 74e73a6..18c1fd4 100644
> --- a/lisp/indent.el
> +++ b/lisp/indent.el
> @@ -537,7 +537,7 @@ column to indent to; if it is nil, use one of the three methods above."
>    ;; In most cases, reindenting modifies the buffer, but it may also
>    ;; leave it unmodified, in which case we have to deactivate the mark
>    ;; by hand.
> -  (deactivate-mark))
> +  (setq deactivate-mark t))
>
>  (defun indent-relative-maybe ()
>    "Indent a new line like previous nonblank line.

This is still not the correct behavior. Example code:

(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.

Oleh





  reply	other threads:[~2015-04-17 16:02 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 [this message]
2015-04-17 18:22     ` Stefan Monnier
2015-04-17 18:30       ` Oleh Krehel
2015-04-17 19:15         ` Stefan Monnier

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='CAA01p3pkfyA-Myh8tbOB3g+5NXatBXs1=JYrEstzH7p0bTNyhA@mail.gmail.com' \
    --to=ohwoeowho@gmail.com \
    --cc=20357-done@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).