Subject: bug#32956: 26.1.50; t-m-m mark deactivation documentation

From: [email-masked] (Charles A. Roelli)
Date: Sat, 06 Oct 2018 16:19:55 +0200

t-m-m's documentation currently states:

	      The mark is "deactivated" by changing the buffer,
  and after certain other operations that set the mark but whose
  main purpose is something else--for example, incremental search,
  M-<, and M->.

All of the examples (incremental search, M-<, and M->) do not always
deactivate the mark.  For example, for incremental search, try from
emacs -Q:

M-< C-SPC C-s buffer RET	> the mark is not deactivated

For M-< and M->, try:

M-< M-@ M-</M->			> neither M-< nor M-> deactivate the mark

There does seem to be at least one case where M-< and M-> do
deactivate the mark.  Try:

double-clicking the word "buffer" in *scratch*
M-</M->

Both M-< and M-> deactivate the mark in this case.  IIUC, this
behavior is explained in (info "(emacs) Shift Selection"):

     A mark set via mouse commands behaves the same as a mark set via
  shift-selection (*note Setting Mark::).  For example, if you specify a
  region by dragging the mouse, you can continue to extend the region
  using shifted cursor motion commands.  In either case, any unshifted
  cursor motion command deactivates the mark.

In light of this, here's a change for review on emacs-26:

diff --git a/lisp/simple.el b/lisp/simple.el
index d5674aa..8bbafe4 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5793,10 +5793,10 @@ transient-mark-mode
 
 Transient Mark mode is a global minor mode.  When enabled, the
 region is highlighted with the `region' face whenever the mark
-is active.  The mark is \"deactivated\" by changing the buffer,
-and after certain other operations that set the mark but whose
-main purpose is something else--for example, incremental search,
-\\[beginning-of-buffer], and \\[end-of-buffer].
+is active.  The mark is \"deactivated\" after certain non-motion
+commands, including those that change the text in the buffer, and
+during shift or mouse selection by any unshifted cursor motion
+command (see Info node `Shift Selection' for more details).
 
 You can also deactivate the mark by typing \\[keyboard-quit] or
 \\[keyboard-escape-quit].