GNU bug report logs -
#16403
24.3.50; Rectangular selection visually disturbing
Previous Next
Reported by: Ivan Kalyaev <ivan.kalyaev <at> gmail.com>
Date: Thu, 9 Jan 2014 10:16:01 UTC
Severity: normal
Found in version 24.3.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16403 in the body.
You can then email your comments to 16403 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 09 Jan 2014 10:16:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ivan Kalyaev <ivan.kalyaev <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 09 Jan 2014 10:16:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
When I press <C-x SPS> to start vertical selection lines of text shift to the
right because empty selection is represented with a line symbol.
It looked like font rendering glitch at first. The jerky motion is disturbing.
How do you think the visual experience could be made better?
For comparison, vim selects the starting character right away.
--
With respect, Ivan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 09 Jan 2014 21:12:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 16403 <at> debbugs.gnu.org (full text, mbox):
On 01/09/2014 02:15 AM, Ivan Kalyaev wrote:
> When I press <C-x SPS> to start vertical selection lines of text shift to the
> right because empty selection is represented with a line symbol.
>
> It looked like font rendering glitch at first. The jerky motion is disturbing.
>
> How do you think the visual experience could be made better?
>
> For comparison, vim selects the starting character right away.
I usually use Emacs in a window system. In a tty, yes, this behavior
looks bad. We should do something about it.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 10 Jan 2014 11:29:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Daniel,
> I usually use Emacs in a window system. In a tty, yes, this behavior looks bad.
Actually, I can see this behavior in the GUI version as well (only the
line symbol is not in full-width).
Please see this screencast for illustration: http://i.stack.imgur.com/KIfjc.gif
On Fri, Jan 10, 2014 at 1:10 AM, Daniel Colascione <dancol <at> dancol.org> wrote:
> On 01/09/2014 02:15 AM, Ivan Kalyaev wrote:
>>
>> When I press <C-x SPS> to start vertical selection lines of text shift to
>> the
>> right because empty selection is represented with a line symbol.
>>
>> It looked like font rendering glitch at first. The jerky motion is
>> disturbing.
>>
>> How do you think the visual experience could be made better?
>>
>> For comparison, vim selects the starting character right away.
>
>
> I usually use Emacs in a window system. In a tty, yes, this behavior looks
> bad. We should do something about it.
--
С уважением, Иван
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 10 Jan 2014 19:59:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 16403 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Daniel Colascione <dancol <at> dancol.org> writes:
> On 01/09/2014 02:15 AM, Ivan Kalyaev wrote:
>> When I press <C-x SPS> to start vertical selection lines of text shift to the
>> right because empty selection is represented with a line symbol.
>>
>> It looked like font rendering glitch at first. The jerky motion is disturbing.
>>
>> How do you think the visual experience could be made better?
>>
>> For comparison, vim selects the starting character right away.
>
> I usually use Emacs in a window system. In a tty, yes, this behavior
> looks bad. We should do something about it.
I suggest these fixes (see patch attached):
- don't display an after-string overlay in tty;
- Let C-x SPC sends this message to the user:
"Mark active (rectangle mode)"
instead of just "Mark active"
Let me know what you think.
[rect.el.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--
Bastien
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 10 Jan 2014 20:18:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> From: Bastien <bzg <at> altern.org>
> Date: Fri, 10 Jan 2014 20:58:33 +0100
> Cc: Ivan Kalyaev <ivan.kalyaev <at> gmail.com>, 16403 <at> debbugs.gnu.org
>
> - (when (= leftcol rightcol)
> + (when (and (= leftcol rightcol) (window-system))
Please don't use window-system as a predicate. Use display-graphic-p
instead (in this case; there are other display-*-p predicates that
target other situations).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 10 Jan 2014 20:21:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Bastien <bzg <at> altern.org>
>> Date: Fri, 10 Jan 2014 20:58:33 +0100
>> Cc: Ivan Kalyaev <ivan.kalyaev <at> gmail.com>, 16403 <at> debbugs.gnu.org
>>
>> - (when (= leftcol rightcol)
>> + (when (and (= leftcol rightcol) (window-system))
>
> Please don't use window-system as a predicate. Use display-graphic-p
> instead (in this case; there are other display-*-p predicates that
> target other situations).
Thanks for the advice.
I'll will wait for other maintainers to give feedback and apply
this on monday if it's good.
--
Bastien
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 10 Jan 2014 23:58:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> I'll will wait for other maintainers to give feedback and apply
> this on monday if it's good.
It's probably fine for ttys, indeed, but it doesn't solve the problem
for GUI frames.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sat, 11 Jan 2014 10:04:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> I'll will wait for other maintainers to give feedback and apply
>> this on monday if it's good.
>
> It's probably fine for ttys, indeed, but it doesn't solve the problem
> for GUI frames.
I thought the behavior in GUI frames was acceptable,
and the "glitch" a way to warn the user.
Maybe in GUI the visual hint could be a change in the cursor
shape? E.g. from box to vbar.
--
Bastien
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 12 Jan 2014 20:04:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 16403 <at> debbugs.gnu.org (full text, mbox):
>>> I'll will wait for other maintainers to give feedback and apply
>>> this on monday if it's good.
>> It's probably fine for ttys, indeed, but it doesn't solve the problem
>> for GUI frames.
> I thought the behavior in GUI frames was acceptable,
This OP's use-case is a GUI frame. Daniel pointed out that it's even
worse under ttys.
> Maybe in GUI the visual hint could be a change in the cursor
> shape? E.g. from box to vbar.
The intention is not just to warn the user that we're in rectangle mode,
but to actually show the boundaries of the 0-width rectangle.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 12 Jan 2014 22:27:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>>>> I'll will wait for other maintainers to give feedback and apply
>>>> this on monday if it's good.
>>> It's probably fine for ttys, indeed, but it doesn't solve the problem
>>> for GUI frames.
>> I thought the behavior in GUI frames was acceptable,
>
> This OP's use-case is a GUI frame. Daniel pointed out that it's even
> worse under ttys.
Okay.
>> Maybe in GUI the visual hint could be a change in the cursor
>> shape? E.g. from box to vbar.
>
> The intention is not just to warn the user that we're in rectangle mode,
> but to actually show the boundaries of the 0-width rectangle.
I will commit the change about the warning independently of the way
rectangle boundaries are shown.
Two ideas:
1) using a vbar cursor, which not only warn the user, but also
visually represent an empty rectangle.
2) reduce the width of the line inserted to reduce the glitch.
(Both are compatible, of course.)
Note that vim does not allow empty rectangle selection:
C-v y p will copy and paste the character at point.
I cannot think of situations where the user would want an empty
rectangle, but at the same time not allowing them would not be
consistent with Emacs behavior.
--
Bastien
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Mon, 13 Jan 2014 04:01:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> I cannot think of situations where the user would want an empty
> rectangle, but at the same time not allowing them would not be
> consistent with Emacs behavior.
Emacs uses empty rectangles so as to provide the `insert-rectangle'
functionality using the `string-rectangle' command, so we save
a key-binding.
So, empty rectangles are fairly important.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Mon, 13 Jan 2014 10:58:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Bastien <bzg <at> altern.org> writes:
>> The intention is not just to warn the user that we're in rectangle mode,
>> but to actually show the boundaries of the 0-width rectangle.
>
> I will commit the change about the warning independently of the way
> rectangle boundaries are shown.
Done in r116008.
--
Bastien
Severity set to 'important' from 'normal'
Request was from
Stefan Monnier <monnier <at> iro.umontreal.ca>
to
control <at> debbugs.gnu.org
.
(Mon, 13 Jan 2014 14:42:01 GMT)
Full text and
rfc822 format available.
Severity set to 'normal' from 'important'
Request was from
Stefan Monnier <monnier <at> iro.umontreal.ca>
to
control <at> debbugs.gnu.org
.
(Sat, 09 Aug 2014 17:11:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Tue, 09 Aug 2016 01:46:01 GMT)
Full text and
rfc822 format available.
Message #45 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Bastien <bzg <at> altern.org> writes:
> Bastien <bzg <at> altern.org> writes:
>
>>> The intention is not just to warn the user that we're in rectangle mode,
>>> but to actually show the boundaries of the 0-width rectangle.
>>
>> I will commit the change about the warning independently of the way
>> rectangle boundaries are shown.
>
> Done in r116008.
I can't tell if this bug is considered fixed, or...?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Fri, 02 Sep 2016 03:09:01 GMT)
Full text and
rfc822 format available.
Message #48 received at 16403 <at> debbugs.gnu.org (full text, mbox):
close 16403
quit
npostavs <at> users.sourceforge.net writes:
> Bastien <bzg <at> altern.org> writes:
>
>> Bastien <bzg <at> altern.org> writes:
>>
>>>> The intention is not just to warn the user that we're in rectangle mode,
>>>> but to actually show the boundaries of the 0-width rectangle.
>>>
>>> I will commit the change about the warning independently of the way
>>> rectangle boundaries are shown.
>>
>> Done in r116008.
>
> I can't tell if this bug is considered fixed, or...?
I will assume yes.
bug closed, send any further explanations to
16403 <at> debbugs.gnu.org and Ivan Kalyaev <ivan.kalyaev <at> gmail.com>
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Fri, 02 Sep 2016 03:09:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 30 Sep 2016 11:24:03 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Dani Moncayo <dmoncayo <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 02 Mar 2025 16:29:01 GMT)
Full text and
rfc822 format available.
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 02 Mar 2025 16:30:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 02 Mar 2025 16:32:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 16403 <at> debbugs.gnu.org (full text, mbox):
Hi.
I've been looking for a way to avoid the ugly visual effect of
"micro-shifting" text while making a zero-width rectangular region (on
a GUI Emacs frame).
(see the illustration reported time ago in this ticket:
http://i.stack.imgur.com/KIfjc.gif)
It seems that the problem was fixed for TTYs frames, but not for GUI
frames, IMO.
I think it would be nice to display that "thin vertical line" _over_
the actual text; i.e. as an overlay, without any offsetting of the
current text.
If that is too complicated, I'd like to have a way to configure Emacs
_not_ to show that "thin vertical line" at all (i.e. to have the same
behavior on GUI frames as on TTY frames).
(after all, if I want to know the current limits of such a zero-width
rectangular region, I can type "C-x C-x" twice, or "C-f C-b")
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 02 Mar 2025 16:45:01 GMT)
Full text and
rfc822 format available.
Message #62 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Date: Sun, 2 Mar 2025 17:31:34 +0100
>
> I've been looking for a way to avoid the ugly visual effect of
> "micro-shifting" text while making a zero-width rectangular region (on
> a GUI Emacs frame).
That's by design.
> I think it would be nice to display that "thin vertical line" _over_
> the actual text; i.e. as an overlay, without any offsetting of the
> current text.
Emacs doesn't have such capabilities.
> If that is too complicated, I'd like to have a way to configure Emacs
> _not_ to show that "thin vertical line" at all (i.e. to have the same
> behavior on GUI frames as on TTY frames).
>
> (after all, if I want to know the current limits of such a zero-width
> rectangular region, I can type "C-x C-x" twice, or "C-f C-b")
I believe that line was meant to be an indication that the region is
active and you have a rectangle, even an empty one. But I'm CC'ing
Stefan in case I misremember.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 02 Mar 2025 16:56:01 GMT)
Full text and
rfc822 format available.
Message #65 received at 16403 <at> debbugs.gnu.org (full text, mbox):
>> If that is too complicated, I'd like to have a way to configure Emacs
>> _not_ to show that "thin vertical line" at all (i.e. to have the same
>> behavior on GUI frames as on TTY frames).
>>
>> (after all, if I want to know the current limits of such a zero-width
>> rectangular region, I can type "C-x C-x" twice, or "C-f C-b")
>
> I believe that line was meant to be an indication that the region is
> active and you have a rectangle, even an empty one. But I'm CC'ing
> Stefan in case I misremember.
I can't think of any reason why we couldn't add a config var to disable
that thin vertical line. I find it convenient (tho I agree that the
small motion is bar jarring), but that's a question of taste.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 13:30:02 GMT)
Full text and
rfc822 format available.
Message #68 received at submit <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:
> I can't think of any reason why we couldn't add a config var to disable
> that thin vertical line. I find it convenient (tho I agree that the
> small motion is bar jarring), but that's a question of taste.
It is a bit more than only convenient: for commands like
`string-rectangle' or `rectangle-number-lines' it is an important guide
visualizing what one will get.
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 13:30:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 13:53:01 GMT)
Full text and
rfc822 format available.
Message #74 received at submit <at> debbugs.gnu.org (full text, mbox):
On Wed, Mar 5, 2025 at 2:28 PM Michael Heerdegen
<michael_heerdegen <at> web.de> wrote:
>
> Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
> > I can't think of any reason why we couldn't add a config var to disable
> > that thin vertical line. I find it convenient (tho I agree that the
> > small motion is bar jarring), but that's a question of taste.
>
> It is a bit more than only convenient: for commands like
> `string-rectangle' or `rectangle-number-lines' it is an important guide
> visualizing what one will get.
FWIW: As I said, I dislike the current visual effect of shifting the
text. And I would definitely prefer _not_ to see _any_ visual
indication of a zero-columns rectangle, if that indication entails
such a visual effect. That's why I'm asking for a way to configure
the behavior I prefer.
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 13:53:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 21:21:01 GMT)
Full text and
rfc822 format available.
Message #80 received at 16403 <at> debbugs.gnu.org (full text, mbox):
>> > that thin vertical line. I find it convenient (tho I agree that the
>> > small motion is bar jarring), but that's a question of taste.
>>
>> It is a bit more than only convenient: for commands like
>> `string-rectangle' or `rectangle-number-lines' it is an important guide
>> visualizing what one will get.
>
> FWIW: As I said, I dislike the current visual effect of shifting the
> text. And I would definitely prefer _not_ to see _any_ visual
> indication of a zero-columns rectangle, if that indication entails
> such a visual effect. That's why I'm asking for a way to configure
> the behavior I prefer.
In the short term, I think adding a config var to disable the small
space is probably the best option. Patch welcome.
In the longer term, it might be worthwhile to consider adding a delay,
i.e. a zero-width rectangle would start being shown as "zero width" but
after a short idle time we'd add the small space to make it more
visually obvious. It would help avoid the small movement that
occurs between the time you `C-x RET` and the time you start moving
the cursor while still offering the convenient visual feedback to those
willing to wait a little.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Wed, 05 Mar 2025 22:26:01 GMT)
Full text and
rfc822 format available.
Message #83 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> >> > that thin vertical line. I find it convenient (tho I agree that the
> >> > small motion is bar jarring), but that's a question of taste.
> >>
> >> It is a bit more than only convenient: for commands like
> >> `string-rectangle' or `rectangle-number-lines' it is an important guide
> >> visualizing what one will get.
> >
> > FWIW: As I said, I dislike the current visual effect of shifting the
> > text. And I would definitely prefer _not_ to see _any_ visual
> > indication of a zero-columns rectangle, if that indication entails
> > such a visual effect. That's why I'm asking for a way to configure
> > the behavior I prefer.
>
> In the short term, I think adding a config var to disable the small
> space is probably the best option. Patch welcome.
> In the longer term, it might be worthwhile to consider adding a delay,
> i.e. a zero-width rectangle would start being shown as "zero width" but
> after a short idle time we'd add the small space to make it more
> visually obvious. It would help avoid the small movement that
> occurs between the time you `C-x RET` and the time you start moving
> the cursor while still offering the convenient visual feedback to those
> willing to wait a little.
As long as we're considering shedding bikes, maybe
toss this orthogonal possibility into the list.
When the selection is a 0-columns rectangle, show
the vertical thin-space line with a different face,
to make it more prominent. Optionally, of course.
IOW, have an option for the highlighting behavior
when zero columns are selected:
1. No highlighting (no thin space, so no apparent
movement).
E.g., numeric value N, for highlighting after
N seconds. (0 means what you suggested.)
2. Highlighting with face `region'.
E.g., value nil.
3. Highlighting with another face.
E.g., value that face.
That third possibility can help if face `region'
doesn't stand out that much and you want to see
better that a rectangle is selected and where it is.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 06 Mar 2025 07:57:01 GMT)
Full text and
rfc822 format available.
Message #86 received at submit <at> debbugs.gnu.org (full text, mbox):
> IOW, have an option for the highlighting behavior
> when zero columns are selected:
>
> 1. No highlighting (no thin space, so no apparent
> movement).
> E.g., numeric value N, for highlighting after
> N seconds. (0 means what you suggested.)
> 2. Highlighting with face `region'.
> E.g., value nil.
> 3. Highlighting with another face.
> E.g., value that face.
Should this option be applied to the non-rectangular empty region
as well? I.e. as soon as you type 'C-SPC' should it indicate
with the same narrow line that the selection is activated?
Or maybe such indication is not necessary if an empty region
is ignored anyway when use-empty-active-region is nil?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 06 Mar 2025 07:57:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 06 Mar 2025 17:20:02 GMT)
Full text and
rfc822 format available.
Message #92 received at submit <at> debbugs.gnu.org (full text, mbox):
> > IOW, have an option for the highlighting behavior
> > when zero columns are selected:
> >
> > 1. No highlighting (no thin space, so no apparent
> > movement).
> > E.g., numeric value N, for highlighting after
> > N seconds. (0 means what you suggested.)
> > 2. Highlighting with face `region'.
> > E.g., value nil.
> > 3. Highlighting with another face.
> > E.g., value that face.
>
> Should this option be applied to the non-rectangular empty region
> as well? I.e. as soon as you type 'C-SPC' should it indicate
> with the same narrow line that the selection is activated?
> Or maybe such indication is not necessary if an empty region
> is ignored anyway when use-empty-active-region is nil?
I wouldn't do that. If you want some such behavior
for nonrectangular regions I'd suggest a separate
option. What's best for one isn't necessarily best
for the other. A vertical line makes sense for a
rectangular region.
(FWIW, a horizontal line would also have made sense.
It could even make sense to use both vertical and
horizontal. But no one has implemented adding a
thin horizontal line.)
I don't think `use-empty-active-region' should have
any bearing on whether to show an indication of the
rectangular region being empty. I think indication
is just as useful - nay, more useful, when that
option is non-nil. You want to know when the region
(mark) is active.
___
FWIW:
When the region is active, `modeline-region-mode'
shows, in the mode-line, info about the region,
taking the place of the `mode-line-position' info.
Option `mlr-region-style' says what kind of info:
* `Characters'. Number of characters in region or rectangle.
* `Bytes'. Number of bytes in region or rectangle.
* `Lines (& words) & chars / rows & columns (& words & chars)'.
For a regular region, you see lines and characters.
For a rectangular region you see rows and columns.
This can optionally include words for region and words & chars for
rectangle: see options `mlr-non-rectangle-style' and
`mlr-rectangle-style'.
To change the concrete formatting used, change variables
`mlr-lines+chars-format', `mlr-lines+words+chars-format',
`mlr-rows+cols-format', and `mlr-rows+cols+words+chars-format'.
* `Customized format'. An arbitrary format you specify.
By default, for a rectangular region you see the
number of rows and columns.
That mode-line active-region indication text has face
`mlr-region', which by default looks the same as face
`region', so it's quite apparent when the region is
active.
What's more, when you use a command, such as
`query-replace', that's known to use the active region,
face `mlr-region-acting-on' is used, to draw attention
to this fact. By default, this looks the same as face
`region', but with a red overline & underline.
https://www.emacswiki.org/emacs/ModeLineRegion
https://www.emacswiki.org/emacs/modeline-region.el
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Thu, 06 Mar 2025 17:20:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 09 Mar 2025 10:15:02 GMT)
Full text and
rfc822 format available.
Message #98 received at 16403 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Eli Zaretskii
> <eliz <at> gnu.org>, 16403 <at> debbugs.gnu.org
> Date: Wed, 05 Mar 2025 16:20:40 -0500
>
> >> > that thin vertical line. I find it convenient (tho I agree that the
> >> > small motion is bar jarring), but that's a question of taste.
> >>
> >> It is a bit more than only convenient: for commands like
> >> `string-rectangle' or `rectangle-number-lines' it is an important guide
> >> visualizing what one will get.
> >
> > FWIW: As I said, I dislike the current visual effect of shifting the
> > text. And I would definitely prefer _not_ to see _any_ visual
> > indication of a zero-columns rectangle, if that indication entails
> > such a visual effect. That's why I'm asking for a way to configure
> > the behavior I prefer.
>
> In the short term, I think adding a config var to disable the small
> space is probably the best option. Patch welcome.
> In the longer term, it might be worthwhile to consider adding a delay,
> i.e. a zero-width rectangle would start being shown as "zero width" but
> after a short idle time we'd add the small space to make it more
> visually obvious. It would help avoid the small movement that
> occurs between the time you `C-x RET` and the time you start moving
> the cursor while still offering the convenient visual feedback to those
> willing to wait a little.
Here's a patch with the "short-term" solution. Does it give good
results? Should I install it (with the necessary NEWS addition)?"
diff --git a/lisp/rect.el b/lisp/rect.el
index be99a33..e630f80 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -456,6 +456,11 @@ rectangle-preview
:version "25.1"
:type 'boolean)
+(defcustom rectangle-indicate-zero-width-rectangle t
+ "If non-nil, make zero-width rectangles visible on display."
+ :version "31.1"
+ :type 'boolean)
+
(defun rectangle--string-preview ()
(when rectangle-preview
(let ((str (minibuffer-contents)))
@@ -960,7 +965,8 @@ rectangle--highlight-for-redisplay
(overlay-put ol 'after-string str))))
((overlay-get ol 'after-string)
(overlay-put ol 'after-string nil)))
- (when (and (= leftcol rightcol) (display-graphic-p))
+ (when (and (= leftcol rightcol) (display-graphic-p)
+ rectangle-indicate-zero-width-rectangle)
;; Make zero-width rectangles visible!
(overlay-put ol 'after-string
(concat (propertize
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 09 Mar 2025 11:00:02 GMT)
Full text and
rfc822 format available.
Message #101 received at 16403 <at> debbugs.gnu.org (full text, mbox):
On Sun, Mar 9, 2025 at 11:14 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> [...]
> Here's a patch with the "short-term" solution. Does it give good
> results? Should I install it (with the necessary NEWS addition)?"
Your patch works here. Thanks.
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#16403
; Package
emacs
.
(Sun, 09 Mar 2025 17:07:01 GMT)
Full text and
rfc822 format available.
Message #104 received at 16403 <at> debbugs.gnu.org (full text, mbox):
I noted:
> (FWIW, a horizontal line would also have made sense.
> It could even make sense to use both vertical and
> horizontal. But no one has implemented adding a
> thin horizontal line.)
In fact, maybe, depending on how it were implemented,
using a horizontal line instead of a vertical one
would also not have the visual effect that disturbs
OP. If the vertical space needed for the horizontal
line were taken from the interline space, then there
would be no jump in vertical distance.
If someone knowledgeable were to implement it, I
think it would be helpful to optionally provide:
1. Both horizontal and vertical lines.
2. Only-horizontal and only-vertical lines.
And again, with the possibility of using a different
face for the empty-rectangle case, i.e., when the
highlighting is just a line (or lines).
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Thu, 13 Mar 2025 11:38:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ivan Kalyaev <ivan.kalyaev <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 13 Mar 2025 11:38:02 GMT)
Full text and
rfc822 format available.
Message #109 received at 16403-done <at> debbugs.gnu.org (full text, mbox):
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Date: Sun, 9 Mar 2025 11:58:45 +0100
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, michael_heerdegen <at> web.de,
> 16403 <at> debbugs.gnu.org
>
> On Sun, Mar 9, 2025 at 11:14 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > [...]
> > Here's a patch with the "short-term" solution. Does it give good
> > results? Should I install it (with the necessary NEWS addition)?"
>
> Your patch works here. Thanks.
Thanks, installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 11 Apr 2025 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 123 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.