Subject: bug#20357: closed (Re: bug#20357: 25.0.50; deactivate-mark behavior broken)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 17 Apr 2015 14:32:02 +0000

Your bug report

#20357: 25.0.50; deactivate-mark behavior broken

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
20357: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20357
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#20357: 25.0.50; deactivate-mark behavior broken
From: Stefan Monnier <[email-masked]>
To: Oleh Krehel <[email-masked]>
Cc: [email-masked]
Date: Fri, 17 Apr 2015 10:31:32 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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

        Stefan

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.

Subject: 25.0.50; deactivate-mark behavior broken
From: Oleh Krehel <[email-masked]>
To: [email-masked]
Date: Fri, 17 Apr 2015 12:21:01 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

This is a recent change, 24.5.2 doesn't have this bug.

How to reproduce:

1. Mark some text.
2. Call this:

(let (deactivate-mark)
  (indent-region (region-beginning)
                 (region-end)))

Expected behavior: the mark isn't deactivated.

Actual behavior: the mark is deactivated.