unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
@ 2020-08-02  4:19 Sean Whitton
  2020-08-02 14:12 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Sean Whitton @ 2020-08-02  4:19 UTC (permalink / raw)
  To: 42663

Hello,

rectangle-mark-mode's docstring says

    Toggle the region as rectangular.  Activates the region if needed.
    Only lasts until the region is deactivated.

However, when Transient Mark mode is off,

1) the region does not get activated by C-x SPC;

2) the mode lasts until the mark is subsequently activated and then
   deactivated again; and

3) rectangle-mark-mode works inconsistently until the mark is activated:
   killing the region kills the rectangle, but C-x C-x does not rotate
   through the four corners of the rectangle.

I think the simplest fix might be for rectangle-mark-mode to activate
the mark even when Transient Mark mode is off.  I think I'll probably
add that to my own configuration, where Transient Mark mode is off.

-- 
Sean Whitton





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
  2020-08-02  4:19 Sean Whitton
@ 2020-08-02 14:12 ` Eli Zaretskii
  2020-09-22 15:46   ` Lars Ingebrigtsen
  2021-12-24 21:41   ` Sean Whitton
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2020-08-02 14:12 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 42663

> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Sat, 01 Aug 2020 21:19:22 -0700
> 
> rectangle-mark-mode's docstring says
> 
>     Toggle the region as rectangular.  Activates the region if needed.
>     Only lasts until the region is deactivated.
> 
> However, when Transient Mark mode is off,
> 
> 1) the region does not get activated by C-x SPC;
> 
> 2) the mode lasts until the mark is subsequently activated and then
>    deactivated again; and
> 
> 3) rectangle-mark-mode works inconsistently until the mark is activated:
>    killing the region kills the rectangle, but C-x C-x does not rotate
>    through the four corners of the rectangle.
> 
> I think the simplest fix might be for rectangle-mark-mode to activate
> the mark even when Transient Mark mode is off.  I think I'll probably
> add that to my own configuration, where Transient Mark mode is off.

I'm not sure the current behavior you described is a bug.  You seem to
be so confident it is that you haven't even provide an explanation why
you think so, and a naïve reading of the doc string doesn't make that
obvious (e.g., "if needed" could cover item 1).  In general, when
transient-mark-mode is off, Emacs behaves differently than when it's
on, and that's by design.

So could you please provide a more detailed explanation why you think
these are bugs?

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
  2020-08-02 14:12 ` Eli Zaretskii
@ 2020-09-22 15:46   ` Lars Ingebrigtsen
  2021-12-24 21:41   ` Sean Whitton
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-22 15:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 42663, Sean Whitton

Eli Zaretskii <eliz@gnu.org> writes:

> I'm not sure the current behavior you described is a bug.  You seem to
> be so confident it is that you haven't even provide an explanation why
> you think so, and a naïve reading of the doc string doesn't make that
> obvious (e.g., "if needed" could cover item 1).  In general, when
> transient-mark-mode is off, Emacs behaves differently than when it's
> on, and that's by design.
>
> So could you please provide a more detailed explanation why you think
> these are bugs?

More information was requested some months ago, but none was received,
so I'm closing this bug report.  If this is still a problem, please
respond to the debbugs mail address, and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
  2020-08-02 14:12 ` Eli Zaretskii
  2020-09-22 15:46   ` Lars Ingebrigtsen
@ 2021-12-24 21:41   ` Sean Whitton
  1 sibling, 0 replies; 7+ messages in thread
From: Sean Whitton @ 2021-12-24 21:41 UTC (permalink / raw)
  To: Eli Zaretskii, 42663

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

control: tag -1 + patch - moreinfo

Hello,

On Sun 02 Aug 2020 at 05:12PM +03, Eli Zaretskii wrote:

> I'm not sure the current behavior you described is a bug.  You seem to
> be so confident it is that you haven't even provide an explanation why
> you think so, and a naïve reading of the doc string doesn't make that
> obvious (e.g., "if needed" could cover item 1).  In general, when
> transient-mark-mode is off, Emacs behaves differently than when it's
> on, and that's by design.
>
> So could you please provide a more detailed explanation why you think
> these are bugs?

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.

-- 
Sean Whitton

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Improve-rectangle-mark-mode-documentation-regarding-.patch --]
[-- Type: text/x-patch, Size: 3414 bytes --]

From cf87b92aef2013b1d5a72a980f1f958f00222775 Mon Sep 17 00:00:00 2001
From: Sean Whitton <spwhitton@spwhitton.name>
Date: Fri, 24 Dec 2021 14:31:35 -0700
Subject: [PATCH] Improve rectangle-mark-mode documentation regarding mark
 activation

* doc/emacs/killing.texi:
* lisp/rect.el (rectangle-mark-mode): State that rectangle-mark-mode
does not activate the mark when Transient Mark mode is off.  State
that the mode persists until the next time the region becomes
inactive; if rectangle-mark-mode does not activate the mark, then the
mode persists until the region is both activated and subsequently
deactivated.  Qualify discussion of rectangle-exchange-point-and-mark
to say that it cycles the four corners only when the region is active.
---
 doc/emacs/killing.texi | 20 ++++++++++----------
 lisp/rect.el           |  3 ++-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 375ac970d7..f6458e8c8b 100644
--- 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.
 
 Unlike the standard region, the region-rectangle can have its corners
 extended past the end of buffer, or inside stretches of white space
@@ -937,11 +937,11 @@ Rectangles
 @findex rectangle-exchange-point-and-mark
 @findex exchange-point-and-mark@r{, in rectangle-mark-mode}
 @kindex C-x C-x@r{, in rectangle-mark-mode}
-When the region is in rectangle-mark-mode, @kbd{C-x C-x} runs the
-command @code{rectangle-exchange-point-and-mark}, which cycles between
-the four corners of the region-rectangle.  This comes in handy if you
-want to modify the dimensions of the region-rectangle before invoking
-an operation on the marked text.
+When the region is active and in rectangle-mark-mode, @kbd{C-x C-x}
+runs the command @code{rectangle-exchange-point-and-mark}, which
+cycles between the four corners of the region-rectangle.  This comes
+in handy if you want to modify the dimensions of the region-rectangle
+before invoking an operation on the marked text.
 
 @node CUA Bindings
 @section CUA Bindings
diff --git a/lisp/rect.el b/lisp/rect.el
index d288adfbaf..80f992e182 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -651,7 +651,8 @@ rectangle-mark-mode-map
 (define-minor-mode rectangle-mark-mode
   "Toggle the region as rectangular.
 
-Activates the region if needed.  Only lasts until the region is deactivated."
+Activates the region if it's inactive and Transient Mark mode is
+on.  Only lasts until the region is next deactivated."
   :lighter nil
   (rectangle--reset-crutches)
   (when rectangle-mark-mode
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
       [not found] <87sfuh1y3h.fsf@melete.silentflame.com>
@ 2021-12-25  7:55 ` Eli Zaretskii
  2021-12-27 20:04   ` Sean Whitton
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-12-25  7:55 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 42663

> From: Sean Whitton <spwhitton@spwhitton.name>
> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
  2021-12-25  7:55 ` bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off Eli Zaretskii
@ 2021-12-27 20:04   ` Sean Whitton
  2021-12-28 17:40     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Sean Whitton @ 2021-12-27 20:04 UTC (permalink / raw)
  To: Eli Zaretskii, 42663

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Hello,

On Sat 25 Dec 2021 at 09:55AM +02, Eli Zaretskii wrote:

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

Yes, that's better, thank you.

Revised patch enclosed.

-- 
Sean Whitton

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0001-Improve-rectangle-mark-mode-documentation-regardi.patch --]
[-- Type: text/x-patch, Size: 2945 bytes --]

From 6b7d5550ce7a5b72712730248f9d8f07f15e7483 Mon Sep 17 00:00:00 2001
From: Sean Whitton <spwhitton@spwhitton.name>
Date: Mon, 27 Dec 2021 12:58:25 -0700
Subject: [PATCH v2] Improve rectangle-mark-mode documentation regarding mark
 activation

* doc/emacs/killing.texi: Describe how rectangle-mark-mode works when
Transient Mark mode is off.  Qualify discussion of
rectangle-exchange-point-and-mark to say that it cycles the four
corners only when the region is active.
* lisp/rect.el (rectangle-mark-mode): State that rectangle-mark-mode
does not activate the mark when Transient Mark mode is off.  Reword
sentence about how long the mode lasts to account for when Transient
Mark mode is off.
---
 doc/emacs/killing.texi | 16 +++++++++++-----
 lisp/rect.el           |  3 ++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 375ac970d7..3815c0fef6 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -929,6 +929,11 @@ Rectangles
 rectangle.  @xref{Killing}.  The mode persists only as long as the
 region is active.
 
+The region-rectangle works only when the mark is active.  In
+particular, when Transient Mark mode is off (@pxref{Disabled Transient
+Mark}), in addition to typing @kbd{C-x @key{SPC}} you will need to
+activate the mark.
+
 Unlike the standard region, the region-rectangle can have its corners
 extended past the end of buffer, or inside stretches of white space
 that point normally cannot enter, like in the middle of a TAB
@@ -937,11 +942,12 @@ Rectangles
 @findex rectangle-exchange-point-and-mark
 @findex exchange-point-and-mark@r{, in rectangle-mark-mode}
 @kindex C-x C-x@r{, in rectangle-mark-mode}
-When the region is in rectangle-mark-mode, @kbd{C-x C-x} runs the
-command @code{rectangle-exchange-point-and-mark}, which cycles between
-the four corners of the region-rectangle.  This comes in handy if you
-want to modify the dimensions of the region-rectangle before invoking
-an operation on the marked text.
+When the region is active (@pxref{Mark}) and in rectangle-mark-mode,
+@kbd{C-x C-x} runs the command
+@code{rectangle-exchange-point-and-mark}, which cycles between the
+four corners of the region-rectangle.  This comes in handy if you want
+to modify the dimensions of the region-rectangle before invoking an
+operation on the marked text.
 
 @node CUA Bindings
 @section CUA Bindings
diff --git a/lisp/rect.el b/lisp/rect.el
index d288adfbaf..80f992e182 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -651,7 +651,8 @@ rectangle-mark-mode-map
 (define-minor-mode rectangle-mark-mode
   "Toggle the region as rectangular.
 
-Activates the region if needed.  Only lasts until the region is deactivated."
+Activates the region if it's inactive and Transient Mark mode is
+on.  Only lasts until the region is next deactivated."
   :lighter nil
   (rectangle--reset-crutches)
   (when rectangle-mark-mode
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off
  2021-12-27 20:04   ` Sean Whitton
@ 2021-12-28 17:40     ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-12-28 17:40 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 42663-done

> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Mon, 27 Dec 2021 13:04:07 -0700
> 
> > 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.
> 
> Yes, that's better, thank you.
> 
> Revised patch enclosed.

Thanks, installed on the emacs-28 branch, and closing the bug.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-28 17:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87sfuh1y3h.fsf@melete.silentflame.com>
2021-12-25  7:55 ` bug#42663: 28.0.50; rectangle-mark-mode does not behave as documented when transient-mark-mode is off Eli Zaretskii
2021-12-27 20:04   ` Sean Whitton
2021-12-28 17:40     ` Eli Zaretskii
2020-08-02  4:19 Sean Whitton
2020-08-02 14:12 ` Eli Zaretskii
2020-09-22 15:46   ` Lars Ingebrigtsen
2021-12-24 21:41   ` Sean Whitton

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).