Subject: bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off

From: Eli Zaretskii <[email-masked]>
Date: Sat, 25 Dec 2021 09:55:36 +0200

> From: Sean Whitton <[email-masked]>
> Date: Fri, 24 Dec 2021 14:39:46 -0700
> 
> Apologies, it was not my intention to suggest that I'm sure the
> behaviour should change.  I reported a bug because I found what seemed
> like inconsistencies between the documentation and the behaviour of the
> command.  From my point of view, improving the documentation without
> changing the behaviour of the command would resolve the issue.
> 
> Thus, I'm attaching a documentation patch.  Hope it can be installed.

Thanks.  I have a couple of comments:

> --- a/doc/emacs/killing.texi
> +++ b/doc/emacs/killing.texi
> @@ -923,11 +923,11 @@ Rectangles
>  @findex rectangle-mark-mode
>    The command @kbd{C-x @key{SPC}} (@code{rectangle-mark-mode}) toggles
>  whether the region-rectangle or the standard region is highlighted
> -(first activating the region if necessary).  When this mode is enabled,
> -commands that resize the region (@kbd{C-f}, @kbd{C-n} etc.)@: do
> -so in a rectangular fashion, and killing and yanking operate on the
> -rectangle.  @xref{Killing}.  The mode persists only as long as the
> -region is active.
> +(first activating the region if necessary, unless Transient Mark mode
> +is off).  When this mode is enabled, commands that resize the region
> +(@kbd{C-f}, @kbd{C-n} etc.)@: do so in a rectangular fashion, and
> +killing and yanking operate on the rectangle.  @xref{Killing}.  The
> +mode persists until the next time the region becomes inactive.

The new text is IMO not accurate, because toggling the mode doesn't
depend on Transient Mark mode.  It's the "active mark" state that
depends on Transient Mark mode, in the sense that the mark doesn't
automatically become active when Transient Mark mode is off and
set-mark-command or push-mark is called.

So I think a better documentation change would be to say that
rectangle mark mode only works when the mark is active, and point to
"Disabled Transient Mark" node of the manual for how to do that when
Transient Mark mode is off.  This should probably be a separate
paragraph, after the current text.

> +When the region is active and in rectangle-mark-mode, @kbd{C-x C-x}

After "when the region is active", I would add a cross-reference to
"Mark", where this is described.