unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16403: 24.3.50; Rectangular selection visually disturbing
@ 2014-01-09 10:15 Ivan Kalyaev
  2014-01-09 21:10 ` Daniel Colascione
  0 siblings, 1 reply; 14+ messages in thread
From: Ivan Kalyaev @ 2014-01-09 10:15 UTC (permalink / raw)
  To: 16403

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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-09 10:15 bug#16403: 24.3.50; Rectangular selection visually disturbing Ivan Kalyaev
@ 2014-01-09 21:10 ` Daniel Colascione
  2014-01-10 11:28   ` Ivan Kalyaev
  2014-01-10 19:58   ` Bastien
  0 siblings, 2 replies; 14+ messages in thread
From: Daniel Colascione @ 2014-01-09 21:10 UTC (permalink / raw)
  To: Ivan Kalyaev, 16403

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.





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-09 21:10 ` Daniel Colascione
@ 2014-01-10 11:28   ` Ivan Kalyaev
  2014-01-10 19:58   ` Bastien
  1 sibling, 0 replies; 14+ messages in thread
From: Ivan Kalyaev @ 2014-01-10 11:28 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 16403

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



-- 
С уважением, Иван





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-09 21:10 ` Daniel Colascione
  2014-01-10 11:28   ` Ivan Kalyaev
@ 2014-01-10 19:58   ` Bastien
  2014-01-10 20:16     ` Eli Zaretskii
  1 sibling, 1 reply; 14+ messages in thread
From: Bastien @ 2014-01-10 19:58 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Ivan Kalyaev, 16403

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

Daniel Colascione <dancol@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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rect.el.patch --]
[-- Type: text/x-diff, Size: 1273 bytes --]

diff --git a/lisp/rect.el b/lisp/rect.el
index f1f0b8d..3d890b5 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -444,7 +444,8 @@ Activates the region if needed.  Only lasts until the region is deactivated."
               (lambda () (rectangle-mark-mode -1)))
     (unless (region-active-p)
       (push-mark)
-      (activate-mark))))
+      (activate-mark)
+      (message "Mark set (rectangle mode)"))))
 
 (defun rectangle--extract-region (orig &optional delete)
   (if (not rectangle-mark-mode)
@@ -553,10 +554,10 @@ Activates the region if needed.  Only lasts until the region is deactivated."
                     (overlay-put ol 'after-string str))))
                ((overlay-get ol 'after-string)
                 (overlay-put ol 'after-string nil)))
-              (when (= leftcol rightcol)
+              (when (and (= leftcol rightcol) (window-system))
                 ;; Make zero-width rectangles visible!
-                (overlay-put ol 'after-string
-                             (concat (propertize " "
+		(overlay-put ol 'after-string
+			     (concat (propertize " "
                                                  'face '(region (:height 0.2)))
                                      (overlay-get ol 'after-string))))
               (push ol nrol)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-10 19:58   ` Bastien
@ 2014-01-10 20:16     ` Eli Zaretskii
  2014-01-10 20:20       ` Bastien
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2014-01-10 20:16 UTC (permalink / raw)
  To: Bastien; +Cc: ivan.kalyaev, 16403

> From: Bastien <bzg@altern.org>
> Date: Fri, 10 Jan 2014 20:58:33 +0100
> Cc: Ivan Kalyaev <ivan.kalyaev@gmail.com>, 16403@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).





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-10 20:16     ` Eli Zaretskii
@ 2014-01-10 20:20       ` Bastien
  2014-01-10 23:57         ` Stefan Monnier
  0 siblings, 1 reply; 14+ messages in thread
From: Bastien @ 2014-01-10 20:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ivan.kalyaev, 16403

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Bastien <bzg@altern.org>
>> Date: Fri, 10 Jan 2014 20:58:33 +0100
>> Cc: Ivan Kalyaev <ivan.kalyaev@gmail.com>, 16403@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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-10 20:20       ` Bastien
@ 2014-01-10 23:57         ` Stefan Monnier
  2014-01-11 10:02           ` Bastien
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2014-01-10 23:57 UTC (permalink / raw)
  To: Bastien; +Cc: ivan.kalyaev, 16403

> 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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-10 23:57         ` Stefan Monnier
@ 2014-01-11 10:02           ` Bastien
  2014-01-12 20:03             ` Stefan Monnier
  0 siblings, 1 reply; 14+ messages in thread
From: Bastien @ 2014-01-11 10:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: ivan.kalyaev, 16403

Stefan Monnier <monnier@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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-11 10:02           ` Bastien
@ 2014-01-12 20:03             ` Stefan Monnier
  2014-01-12 22:26               ` Bastien
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2014-01-12 20:03 UTC (permalink / raw)
  To: Bastien; +Cc: ivan.kalyaev, 16403

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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-12 20:03             ` Stefan Monnier
@ 2014-01-12 22:26               ` Bastien
  2014-01-13  4:00                 ` Stefan Monnier
  2014-01-13 10:57                 ` Bastien
  0 siblings, 2 replies; 14+ messages in thread
From: Bastien @ 2014-01-12 22:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: ivan.kalyaev, 16403

Stefan Monnier <monnier@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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-12 22:26               ` Bastien
@ 2014-01-13  4:00                 ` Stefan Monnier
  2014-01-13 10:57                 ` Bastien
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2014-01-13  4:00 UTC (permalink / raw)
  To: Bastien; +Cc: ivan.kalyaev, 16403

> 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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-12 22:26               ` Bastien
  2014-01-13  4:00                 ` Stefan Monnier
@ 2014-01-13 10:57                 ` Bastien
  2016-08-09  1:45                   ` npostavs
  1 sibling, 1 reply; 14+ messages in thread
From: Bastien @ 2014-01-13 10:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: ivan.kalyaev, 16403

Bastien <bzg@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





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2014-01-13 10:57                 ` Bastien
@ 2016-08-09  1:45                   ` npostavs
  2016-09-02  3:09                     ` npostavs
  0 siblings, 1 reply; 14+ messages in thread
From: npostavs @ 2016-08-09  1:45 UTC (permalink / raw)
  To: Bastien; +Cc: ivan.kalyaev, Stefan Monnier, 16403

Bastien <bzg@altern.org> writes:

> Bastien <bzg@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...?





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

* bug#16403: 24.3.50; Rectangular selection visually disturbing
  2016-08-09  1:45                   ` npostavs
@ 2016-09-02  3:09                     ` npostavs
  0 siblings, 0 replies; 14+ messages in thread
From: npostavs @ 2016-09-02  3:09 UTC (permalink / raw)
  To: 16403; +Cc: ivan.kalyaev, Stefan Monnier

close 16403 
quit

npostavs@users.sourceforge.net writes:

> Bastien <bzg@altern.org> writes:
>
>> Bastien <bzg@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.





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

end of thread, other threads:[~2016-09-02  3:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 10:15 bug#16403: 24.3.50; Rectangular selection visually disturbing Ivan Kalyaev
2014-01-09 21:10 ` Daniel Colascione
2014-01-10 11:28   ` Ivan Kalyaev
2014-01-10 19:58   ` Bastien
2014-01-10 20:16     ` Eli Zaretskii
2014-01-10 20:20       ` Bastien
2014-01-10 23:57         ` Stefan Monnier
2014-01-11 10:02           ` Bastien
2014-01-12 20:03             ` Stefan Monnier
2014-01-12 22:26               ` Bastien
2014-01-13  4:00                 ` Stefan Monnier
2014-01-13 10:57                 ` Bastien
2016-08-09  1:45                   ` npostavs
2016-09-02  3:09                     ` npostavs

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