Subject: bug#32379: closed (Re: bug#32379: Acknowledgement (27.0.50; Todo mode commands can change active region))

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 14 Aug 2018 15:59:02 +0000

Your bug report

#32379: 27.0.50; Todo mode commands can change active region

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

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

Subject: Re: bug#32379: Acknowledgement (27.0.50; Todo mode commands can change active region)
From: Stephen Berman <[email-masked]>
To: [email-masked]
Date: Tue, 14 Aug 2018 17:57:18 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Closing.

Steve Berman

Subject: 27.0.50; Todo mode commands can change active region
From: Stephen Berman <[email-masked]>
To: [email-masked]
Date: Mon, 06 Aug 2018 23:37:08 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

If there is an active region (i.e. non-nil transient-mark-mode) in a
todo-mode category, then various todo-mode commands have the unintended
side-effect of shifting the region, i.e. highlighting a different part
of the category.  (FTR, the commands are those bound by default in
todo-mode as follows: `f', `b', `j', `g', `v',`V', `S'; in addition, the
effect happens when using `C-x C-q' in todo-edit-mode to return to
todo-mode, and also with `g' or RET on an item in a virtual category
(todo-filtered-items-mode) as well as RET on an item in the Fancy Diary
display, both of which also jumpt to a todo-mode buffer.)  These
commands all change point when the todo-mode is returned to, thus
shifting the region.

Another mode susceptible to this problem is info-mode, and there it is
circumvented by the line (if transient-mark-mode (deactivate-mark)) in
Info-goto-node.  The same fix seems to work for todo-mode as well, and
at first I thought it could be almost confined to one function:
todo-category-select, which is called by all the commands that give rise
to the problem except `C-x C-q' in todo-edit-mode when it is used to
finish editing an item, though maybe changing that part of the code to
call todo-category-select wouldn't be a problem.  However, adding that
line to todo-category-select has the side-effect of removing region
highlighting when `i r' is typed, which executes the command to use the
active region as the text of a new todo item, so this is very
undesirable.  I haven't been able to figure out why that happens, so for
the time being I will go with the less elegant solution of calling
deactivate-mark in all the commands that cause the region to shift and
commit this fix to master.

In GNU Emacs 27.0.50 (build 15, x86_64-pc-linux-gnu, GTK+ Version 3.22.28)
 of 2018-08-06 built on rosalinde
Repository revision: bedf905dd37ef8ad45d5912dd230bfe63a1721b3
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Linux From Scratch