GNU bug report logs - #32956
26.1.50; t-m-m mark deactivation documentation

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch

Date: Sat, 6 Oct 2018 14:17:02 UTC

Severity: normal

Tags: fixed

Found in version 26.1.50

Fixed in version 26.2

Done: charles <at> aurox.ch

Bug is archived. No further changes may be made.

Full log


Message #27 received at 32956 <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 32956 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#32956: 26.1.50; t-m-m mark deactivation documentation
Date: Sun, 07 Oct 2018 16:39:07 +0200
> Date: Sun, 7 Oct 2018 01:02:28 +0000 (UTC)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> > Hmm, deactivate-mark is nil by default -- what effect would setting it
> > to "nil" again have?  Is it to counteract the effect of previous
> > function calls within the command, which may have set
> > "deactivate-mark" to "t"?
> 
> This is about defining a command that activates the region
> and wants to leave/keep it activated after the command
> is finished.
> 
> Consider, as one example, a repeatable command that
> does something  with the active region (e.g. indents it).
> Because it is repeatable it wants to keep the region 
> activated, for the next action. It needs to do this at
> the end: (setq deactivate-mark  nil).

I think changing or adding text in the buffer is what eventually tells
the command loop to deactivate the mark (via the variable
deactivate-mark).  The command loop should not do that by default
after each command.  For example, from emacs -Q:

M-: (defun foo () (interactive)) RET C-x h M-x foo RET > does NOT deactivate the mark
M-: (defun foo () (interactive) (insert "text")) RET C-x h M-x foo RET > DOES deactivate the mark

So, developers should only have to add (setq deactivate-mark nil) to
the end of their command if it is a command that changes or adds
buffer text without wanting to deactivate the mark.

This is explained in the Elisp manual (where it belongs, I think).
But the Emacs manual does lack an index entry for "deactivating the
mark", which seems like an area for improvement.




This bug report was last modified 6 years and 284 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.