all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Kelly Dean <kellydeanch@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: RE: Proposal to change cursor appearance to indicate region activation
Date: Sat, 23 Nov 2013 12:25:08 -0800 (PST)	[thread overview]
Message-ID: <78667428-5c03-402b-8d42-5342079d9bfd@default> (raw)
In-Reply-To: <jwvob5bz1mz.fsf-monnier+emacs@gnu.org>

> > (add-hook 'deactivate-mark-hook (lambda () (setq cursor-type t)))
> > (add-hook 'activate-mark-hook (lambda () (setq cursor-type 'bar)))
> 
> I like the idea, but this collides with other uses of cursor-type.
> Could someone cook up a patch which only does the above if cursor-
> type has not been modified (and which lets users opt-out if they
> prefer).  Also, the patch should directly modify deactivate-mark
> and activate-mark rather than using the hooks.

If you do anything like this, please put it in a minor mode or make
it otherwise customizable (e.g. trivial to turn off).  I would even
argue against it being on by default (but not strongly) - I prefer
that the default behavior not be changed.

It is simple for a user or library to change the `cursor-type' on
demand or based on some dynamic condition.  Why put this on mark
(de)activation hooks unconditionally, or "directly modify
deactivate-mark and activate-mark"?  That sounds like a mistake.

For instance, I have the cursor type change to `box' for overwrite
mode and read-only buffers, and use type `bar' as the default.  And
the type changes to `box' when Emacs is idle.  But these things are
user choices.  They happen only if a user chooses them, and the
particular types used for each state are also customizable.

Emacs should do likewise: make such behavior optional.  You speak
of letting users opt out, but only if the `cursor-type' has been
modified, whatever that might mean (does it matter how it was
modified or how long ago?).

The problems this proposal purports to solve are exaggerated, IMO:

1. The 1st reason given for the proposal is to let users tell when
the active region is empty: "when the region is active but empty,
there's no visual indication of this status."

A better way to do that is to include the code from library
`modeline-posn.el' for this: show the region size, highlighted
with face `region', in the mode line in place of the buffer size
whenever the region is active.

2. The 2nd reason given for the proposal: "Neither is there
indication of the active region if point is one less than mark and
blink-cursor-mode is off."

I don't see that.  For me, the active region is highlighted in that
case.  Am I missing something?

And again, the `modeline-posn.el' region-size indication shows
clearly when the region size is 1, regardless of the where point
is relative to mark.

3. The 3rd reason given for the proposal: "Also, if point is
greater than mark, the active region is highlighted, but the block
cursor does an inverse-video highlight of the character following
the region."

So?  The cursor, block or otherwise, indicates point: where text
will insert.  A block cursor is on top of the character after
point, but that does not mean or suggest that that character is
selected, i.e., is in the region.

The proposal says that this "(speaking from experience) an Emacs
newbie finds distracting, since it seems to indicate that that
character is also part of the region, even though it actually
isn't."

In what way does it "seem to indicate" that the character under
the cursor is part of the region?  It never indicated that to me,
and I don't see how it would for others.

And even if some newbie did mistakenly get that impression, how
long does it take to realize that that impression is incorrect?
Emacs provides plenty of visual feedback about what is the
correct impression.  It doesn't take any thought to find out what
is in the region and what is not.  It just takes one or two
selections - an experimentation of maybe 20 seconds or so.
Seriously, how long did it take you to figure out the truth here?

4. The 4th and final reason given for this proposal: "Adding to
the confusion, the inverse-video highlighted character actually
is part of the region in the case that point is less than mark."

So?  The position of the cursor does not tell you anything about
whether the character after it (for `bar') or under it (for
`box') is part of the region.  For `bar', you can see the
character after the cursor, so you can tell.  OK.  For `box',
you can see the character also, and you can see the `region'
face applied to it as foreground.  I.e., you see the character
highlighted as part of the region, but you see it in inverse
video.

Admittedly, the `region' face as background instead of
foreground is more obvious.  I'll grant you that. But that alone
does not justify this feature being hardcoded into Emacs, IMO.

If this feature is added, please make it optional, easy to
change (turn off), and preferably not on by default.  And you
are welcome to consider incorporating the behavior of
`modeline-posn.el'.
http://www.emacswiki.org/emacs-en/download/modeline-posn.el



      reply	other threads:[~2013-11-23 20:25 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-20  2:54 Proposal to change cursor appearance to indicate region activation Kelly Dean
2013-04-20  7:23 ` Drew Adams
2015-01-22  5:38   ` [PATCH] " Kelly Dean
2015-01-22 14:25     ` Stefan Monnier
2015-01-23  3:08       ` [PATCH] " Kelly Dean
2015-01-23  4:55         ` Stefan Monnier
2015-01-23 11:07           ` Kelly Dean
2015-01-23 17:49             ` Drew Adams
2015-01-24  3:06               ` Kelly Dean
2015-01-24  4:52                 ` Stefan Monnier
2015-01-24  9:22                   ` Kelly Dean
2015-01-25 14:29                     ` Stefan Monnier
2015-01-28  9:15                       ` [PATCH] Run hook when variable is set Kelly Dean
2015-01-28  9:23                         ` [PATCH] Proposal to change cursor appearance to indicate region activation Kelly Dean
2015-01-28 11:24                           ` David Kastrup
2015-01-28 12:13                             ` David Kastrup
2015-01-29 10:46                             ` Kelly Dean
2015-01-29 11:16                               ` David Kastrup
2015-01-30  7:20                                 ` Kelly Dean
2015-01-30  9:19                                   ` David Kastrup
2015-01-30 10:05                                     ` Kelly Dean
2015-01-30 10:12                                       ` David Kastrup
2015-01-30  9:43                                   ` Kelly Dean
2015-01-28 19:25                         ` [PATCH] Run hook when variable is set Stefan Monnier
2015-01-29  8:20                           ` Kelly Dean
2015-01-29  8:28                             ` Lars Ingebrigtsen
2015-01-29 14:58                             ` Stefan Monnier
2015-01-30  7:34                               ` Kelly Dean
2015-01-30 15:55                                 ` Stefan Monnier
2015-01-31  9:18                                   ` Kelly Dean
2015-01-31 20:48                                     ` Stefan Monnier
2015-02-02  5:40                                       ` Kelly Dean
2015-02-02 15:57                                         ` Stefan Monnier
2015-02-03 19:56                                           ` Kelly Dean
2015-02-03 22:49                                             ` Stefan Monnier
2015-02-05  3:10                                               ` [PATCH] (Updated) " Kelly Dean
2015-02-05 13:57                                                 ` Stefan Monnier
2015-02-06  5:34                                                   ` Kelly Dean
2015-02-06 14:42                                                     ` Stefan Monnier
2015-02-07 12:27                                                       ` Kelly Dean
2015-02-07 15:09                                                         ` Stefan Monnier
2015-02-09  3:24                                                           ` Kelly Dean
2015-02-12 19:58                                                             ` Stefan Monnier
2015-02-13 23:08                                                               ` Kelly Dean
2015-02-14  0:55                                                                 ` Stefan Monnier
2015-02-14 22:19                                                                   ` Kelly Dean
2015-02-15 20:25                                                                     ` Stefan Monnier
2015-02-17  2:22                                                                       ` Kelly Dean
2015-02-17 23:07                                                                         ` Richard Stallman
2015-02-18  3:19                                                                           ` The purpose of makunbound (Was: Run hook when variable is set) Kelly Dean
2015-02-18  5:48                                                                             ` The purpose of makunbound Stefan Monnier
2015-02-18  8:51                                                                               ` Kelly Dean
2015-02-18 14:34                                                                                 ` Stefan Monnier
2015-02-18 18:53                                                                                   ` Kelly Dean
2015-02-18 22:42                                                                                     ` Stefan Monnier
2015-02-19 10:36                                                                                       ` Kelly Dean
2015-02-22  0:18                                                                                   ` Kelly Dean
2015-02-19 10:45                                                                           ` Kelly Dean
2015-02-19 13:33                                                                             ` Stefan Monnier
2015-02-19 23:51                                                                               ` Kelly Dean
2015-02-20  1:59                                                                                 ` Stefan Monnier
2015-02-20  9:35                                                                                   ` Kelly Dean
2015-02-20 16:55                                                                                     ` Stefan Monnier
2015-02-20  2:58                                                                                 ` Stephen J. Turnbull
2015-02-20  0:56                                                                             ` Richard Stallman
2015-02-20  9:02                                                                               ` Kelly Dean
2015-02-20 15:41                                                                                 ` Richard Stallman
2015-02-21  5:45                                                                                   ` Stephen J. Turnbull
2015-02-22  0:32                                                                                     ` Kelly Dean
2015-02-22  8:45                                                                                       ` Andreas Schwab
2015-02-18  5:15                                                                         ` [PATCH] (Updated) Run hook when variable is set Kelly Dean
2015-02-18 22:37                                                                           ` Stefan Monnier
2015-02-18 22:37                                                                         ` Stefan Monnier
2015-02-19 10:35                                                                           ` Kelly Dean
2015-02-19 13:30                                                                             ` Stefan Monnier
2015-02-20  6:48                                                                               ` Kelly Dean
2015-02-20 19:29                                                                                 ` Stefan Monnier
2015-02-21 14:18                                                                                   ` Kelly Dean
2015-02-21 20:51                                                                                     ` Stefan Monnier
2015-02-22  0:32                                                                                       ` Kelly Dean
2015-02-22 10:40                                                                                         ` Stephen J. Turnbull
2015-02-22 21:35                                                                                         ` Stefan Monnier
2015-02-23  3:09                                                                                           ` Kelly Dean
2015-02-23  4:19                                                                                             ` Stefan Monnier
2015-02-20 20:27                                                                               ` Proposal for debugging/testing option Kelly Dean
2015-02-24 16:28                                                                                 ` Stefan Monnier
2015-02-14 20:37                                                               ` [PATCH] (Updated) Run hook when variable is set Johan Bockgård
2015-02-15 19:36                                                                 ` Stefan Monnier
2015-02-15 19:53                                                                   ` Patches: inline vs. attachment, compressed vs. uncompressed. [was: Run hook when variable is set] Alan Mackenzie
2015-02-06  9:55                                                   ` [PATCH] (Updated) Run hook when variable is set Kelly Dean
2015-01-30 23:29                                 ` [PATCH] " Richard Stallman
2015-01-31  9:23                                   ` Kelly Dean
2015-01-31 23:16                                     ` Richard Stallman
2015-02-02  5:41                                       ` Kelly Dean
2015-02-01  2:04                               ` Alexis
2015-02-01  4:05                                 ` Stefan Monnier
2015-02-01  8:58                                   ` David Kastrup
2015-01-29 16:06                             ` Eli Zaretskii
2015-01-30  7:14                               ` Kelly Dean
2015-01-30  9:08                                 ` Eli Zaretskii
2015-01-23 20:34             ` [PATCH] Proposal to change cursor appearance to indicate region activation Stefan Monnier
2015-01-24  0:25               ` Kelly Dean
2015-01-23 10:01         ` Tassilo Horn
2015-01-23 17:49           ` Drew Adams
2015-01-23 10:06         ` Eli Zaretskii
2015-01-23 11:40           ` Kelly Dean
2015-01-23 11:56             ` Eli Zaretskii
2015-01-22  5:41   ` Kelly Dean
2013-11-23 13:34 ` Stefan Monnier
2013-11-23 20:25   ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78667428-5c03-402b-8d42-5342079d9bfd@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=kellydeanch@yahoo.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.