unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Turn off selection coloring
@ 2009-09-15 19:04 Harry Putnam
  2009-09-15 19:22 ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Harry Putnam @ 2009-09-15 19:04 UTC (permalink / raw)
  To: help-gnu-emacs

I'll admit I only spent about 10 minutes looking for this answer... I
did

M-x apropos <RET> selection <followed by just `select'>

M-x customize-apropos " ditto "

C-h -i m emacs i select (and walked thru them)

I didn't find out how to turn off the blue color that appears when
mark is set, and I scroll. Indicating a selected region.  The one that
requires two spc bar hits to turn off.

I liked the old way... with no color and find myself very often
accidentally coloring a region... 

It is nice when I *intend* to select a region but too often I
accidentally select.... no doubt some kind of poor typing habit
causing it but it means this happens very often for me.

I don't remember having trouble knowing what I selected... when
intentionally selecting a region before we had that highlight, so I
think I want it off.

Can anyone provide a better searching clue?





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

* Re: Turn off selection coloring
  2009-09-15 19:04 Turn off selection coloring Harry Putnam
@ 2009-09-15 19:22 ` Tassilo Horn
  2009-09-17 22:07   ` Harry Putnam
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2009-09-15 19:22 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

Hi Harry,

> I'll admit I only spent about 10 minutes looking for this answer... I
> did
>
> [...]
>
> I didn't find out how to turn off the blue color that appears when
> mark is set, and I scroll. Indicating a selected region.  The one that
> requires two spc bar hits to turn off.

When you only want to remove the coloring, then do

  M-x customize-face RET region

and remove the background color there.

If you don't like the new special handling [1] of the active region at
all, then put

     (transient-mark-mode -1)

into your ~/.emacs.

Bye,
Tassilo
__________
[1] Some commands behave differently when the mark is active of
    deactivated.  This can be very handy, although this feature
    isn't used too much till now.





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

* Re: Turn off selection coloring
  2009-09-15 19:22 ` Tassilo Horn
@ 2009-09-17 22:07   ` Harry Putnam
  2009-09-18  5:49     ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Harry Putnam @ 2009-09-17 22:07 UTC (permalink / raw)
  To: help-gnu-emacs

Tassilo Horn <tassilo@member.fsf.org> writes:

>> I didn't find out how to turn off the blue color that appears when
>> mark is set, and I scroll. Indicating a selected region.  The one that
>> requires two spc bar hits to turn off.
>
> When you only want to remove the coloring, then do
>
>   M-x customize-face RET region
>
> and remove the background color there.
>
> If you don't like the new special handling [1] of the active region at
> all, then put
>
>      (transient-mark-mode -1)
>
> into your ~/.emacs.

Thank for the helpful answers.

> [1] Some commands behave differently when the mark is active of
>    deactivated.  This can be very handy, although this feature
>    isn't used too much till now.

It is mostly the color but I guess the stickyness I seem to see might
be a problem without the color... Its likely I'd have selected regions
and not know it...  Not sure how much havoc that might lead too, but I
don't remember it being a problem before the advent of the coloring.

But then I guess you are saying there other changes that go along with
a selected region.

I have a hunch it would take me mnths or even yrs to notice which
behaved in a way I'd like.  Can you spell them out a bit more?





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

* Re: Turn off selection coloring
  2009-09-17 22:07   ` Harry Putnam
@ 2009-09-18  5:49     ` Tassilo Horn
  2009-09-18 14:53       ` Harry Putnam
  0 siblings, 1 reply; 9+ messages in thread
From: Tassilo Horn @ 2009-09-18  5:49 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

Hi Harry,

>> [1] Some commands behave differently when the mark is active of
>> deactivated.  This can be very handy, although this feature isn't
>> used too much till now.
>
> It is mostly the color but I guess the stickyness I seem to see might
> be a problem without the color... Its likely I'd have selected regions
> and not know it...  Not sure how much havoc that might lead too, but I
> don't remember it being a problem before the advent of the coloring.
>
> But then I guess you are saying there other changes that go along with
> a selected region.

Indeed.

> I have a hunch it would take me mnths or even yrs to notice which
> behaved in a way I'd like.  Can you spell them out a bit more?

Sure.  `ispell-word' has a different behavior when a region is active.

,----[ C-h f ispell-word RET ]
| ispell-word is an interactive compiled Lisp function in `ispell.el'.
| 
| It is bound to M-$, <menu-bar> <tools> <spell> <ispell-word>.
| 
| (ispell-word &optional following quietly continue region)
| 
| Check spelling of word under or before the cursor.
|
| [...]
| 
| Interactively, in Transient Mark mode when the mark is active, call
| `ispell-region' to check the active region for spelling errors.
`----

A quick grep through the emacs sources reveals, that at least those
modes make use of this new feature.

,----
| lisp/allout.el:  (cond ((fboundp 'use-region-p) '(use-region-p))
| lisp/indent.el:   ((use-region-p)
| lisp/org/org-compat.el:	  (use-region-p)
| lisp/proced.el:      (if (use-region-p)
| lisp/proced.el:    (cond ((use-region-p) ;; Omit active region
| lisp/progmodes/ada-mode.el:      (use-region-p)
| lisp/progmodes/cc-cmds.el:   (list current-prefix-arg (use-region-p)))
| lisp/progmodes/delphi.el:  (cond ((use-region-p)
| lisp/progmodes/idlwave.el:      (use-region-p)
| lisp/progmodes/perl-mode.el:  (cond ((use-region-p)            ; indent the active region
| lisp/progmodes/vera-mode.el:	(cond ((and (not (featurep 'xemacs)) (use-region-p))
| lisp/progmodes/vhdl-mode.el:    ((and (not (featurep 'xemacs)) (use-region-p))
| lisp/textmodes/conf-mode.el:      (when (use-region-p)
| lisp/textmodes/ispell.el:   ((and region (use-region-p))
| lisp/textmodes/reftex.el:      (use-region-p)
| lisp/tooltip.el:  `(use-region-p))
| lisp/vc-dir.el:  (if (use-region-p)
`----

But reading the docs, you can put

  (transient-mark-mode -1)

into your .emacs to turn it off, and only when you want to use the
special active region features, you turn it on for the following command
with `C-SPC C-SPC'.  Then you have the coloring and special region
handling only when you really want it.

Bye,
Tassilo





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

* Re: Turn off selection coloring
  2009-09-18  5:49     ` Tassilo Horn
@ 2009-09-18 14:53       ` Harry Putnam
  2009-09-18 18:33         ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Harry Putnam @ 2009-09-18 14:53 UTC (permalink / raw)
  To: help-gnu-emacs

Tassilo Horn <tassilo@member.fsf.org> writes:

> Harry Putnam <reader@newsguy.com> writes:
>
> Hi Harry,
>
>>> [1] Some commands behave differently when the mark is active of
>>> deactivated.  This can be very handy, although this feature isn't
>>> used too much till now.

[...]

> But reading the docs, you can put
>
   (transient-mark-mode -1)
>
> into your .emacs to turn it off, and only when you want to use the
> special active region features, you turn it on for the following command
> with `C-SPC C-SPC'.  Then you have the coloring and special region
> handling only when you really want it.

Thanks again... I think I misunderstood your comment (footnote [1]).
The part that says "although this feature isn't used too much till
now"

I took to mean the behavior you were talking about was new since the
coloring of region became default.  

So I thought you were suggesting some new kinds of behavior related to
region.

Sorry to have caused more work for you.

It appears that setting (transient-mark-mode -1) doesn't prevent
ispell-region from working.  Or other region based actions like
killing a region etc.

One thing I do miss with (transient-mark-mode -1) set is the coloring
when selecting a region with the mouse.

Was there a time when setting mark and scrolling did NOT colorize the
region but selection with mouse did?

Or more cogently... is there a way to do that now.  Stop region
colorizing when done from the keyboard but allow it when selected with
mouse? 

I also seem to recall a time when the colorizing of a region could be
invoked with a double mark set before scrolling, but was not on by
default... Is that still a possibility





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

* Re: Turn off selection coloring
  2009-09-18 14:53       ` Harry Putnam
@ 2009-09-18 18:33         ` Tassilo Horn
  2009-09-19 20:01           ` Harry Putnam
       [not found]           ` <mailman.7064.1253390548.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Tassilo Horn @ 2009-09-18 18:33 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

Hi Harry!

> I took to mean the behavior you were talking about was new since the
> coloring of region became default.

I think, that's the case.

> So I thought you were suggesting some new kinds of behavior related to
> region.
>
> Sorry to have caused more work for you.

I'm happy to help.

> It appears that setting (transient-mark-mode -1) doesn't prevent
> ispell-region from working.  Or other region based actions like
> killing a region etc.

No, all region commands work as usual.  But with an *active* (colored)
region, ispell-word (not ispell-region) spell-checks the whole region,
not only the word at point.  With that feature, you only need to
remember one keybinding/command, and emacs does what you want.

> One thing I do miss with (transient-mark-mode -1) set is the coloring
> when selecting a region with the mouse.

Hm, here it does colorize it.  Did you forget to delete your
customization on the region face (in case you did that)?

> Was there a time when setting mark and scrolling did NOT colorize the
> region but selection with mouse did?

Yes, emacs 22 did so.  And emacs 23 should do so with
transient-mark-mode off.

> Or more cogently... is there a way to do that now.  Stop region
> colorizing when done from the keyboard but allow it when selected with
> mouse?

Yep, as I said.

> I also seem to recall a time when the colorizing of a region could be
> invoked with a double mark set before scrolling, but was not on by
> default... Is that still a possibility

Well, now I'm pretty sure that you removed the background color from the
region face. ;-)

Bye,
Tassilo





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

* Re: Turn off selection coloring
  2009-09-18 18:33         ` Tassilo Horn
@ 2009-09-19 20:01           ` Harry Putnam
       [not found]           ` <mailman.7064.1253390548.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Harry Putnam @ 2009-09-19 20:01 UTC (permalink / raw)
  To: help-gnu-emacs

Tassilo Horn <tassilo@member.fsf.org> writes:

>> I also seem to recall a time when the colorizing of a region could be
>> invoked with a double mark set before scrolling, but was not on by
>> default... Is that still a possibility
>
> Well, now I'm pretty sure that you removed the background color from the
> region face. ;-)

Egad... treble Yup...  Thanks





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

* Re: Turn off selection coloring
       [not found]           ` <mailman.7064.1253390548.2239.help-gnu-emacs@gnu.org>
@ 2009-09-20 19:18             ` John A Pershing Jr
  0 siblings, 0 replies; 9+ messages in thread
From: John A Pershing Jr @ 2009-09-20 19:18 UTC (permalink / raw)
  To: help-gnu-emacs

Keep in mind that there is *always* a region, defined as the stuff
between point and mark (both of which are always defined).  The
difference here is whether the region is considered to be "active" or
not, with this "activeness" causing a few commands to modify their
behavior.

Transient mark mode has also been around for quite a while; it
determines whether certain mark-setting commands (e.g., C-SPC, C-x h)
also set the region "active" or not.  Before the current release,
transient mark mode was off by default, and many of us were completely
unaware of "active regions" or their implications.  If one wanted an
active region, you could use C-SPC C-SPC to temporarily turn on
"activeness" for the current region, or you could enable transient mark
mode in your .emacs file.

The colorization is orthogonal to transient mark mode: it indicates that
you have an active region, either automagically (because you are running
in transient mark mode) or explicitly (via C-SPC C-SPC).  It is probably
a bad idea to suppress this colorization; I would guess that you would
want *some* indication that you are dealing with an active region
(rather than an ordinary region).

If the colorized region is (1) new to you and (2) annoying, then you
probably want to turn off transient mark mode in your .emacs file, since
you have been surviving just fine the past past N years without ever
using an active region.  However, as more and more commands start paying
attention to the activeness of the region and modifying their behavior,
you may (or may not...) want to "get with the program" and start
figuring out what active regions can do for you!

  -jp


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

* Re: Turn off selection coloring
       [not found] <mailman.6729.1253041517.2239.help-gnu-emacs@gnu.org>
@ 2009-09-20 21:49 ` Xah Lee
  0 siblings, 0 replies; 9+ messages in thread
From: Xah Lee @ 2009-09-20 21:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Sep 15, 12:04 pm, Harry Putnam <rea...@newsguy.com> wrote:
> I'll admit I only spent about 10 minutes looking for this answer... I
> did
>
> M-x apropos <RET> selection <followed by just `select'>
>
> M-x customize-apropos " ditto "
>
> C-h -i m emacs i select (and walked thru them)
>
> I didn't find out how to turn off the blue color that appears when
> mark is set, and I scroll. Indicating a selected region.  The one that
> requires two spc bar hits to turn off.
>
> I liked the old way... with no color and find myself very often
> accidentally coloring a region...
>
> It is nice when I *intend* to select a region but too often I
> accidentally select.... no doubt some kind of poor typing habit
> causing it but it means this happens very often for me.
>
> I don't remember having trouble knowing what I selected... when
> intentionally selecting a region before we had that highlight, so I
> think I want it off.
>
> Can anyone provide a better searching clue?

your answer is here:

• New Features in Emacs 23
  http://xahlee.org/emacs/emacs23_features.html


textual excerpt (html table format screted...):

Text Selection Highlighted

Text selection is highlighted by default. This is done by having
transient-mark-mode on by default. To turn it off, put the following
in your emacs init file:

(transient-mark-mode 0) ; 1 for on, 0 for off

If you leave transient-mark-mode on, now several emacs commands
automatically apply to the text selection when text are selected, else
they work on the current word or line. These commands are:
Commands That Automatically Apply To Selection purpose	emacs command
name	shortcut
hard wrap lines	fill-paragraph	Alt+q
indenting code	indent-for-tab-command or other	Tab
check spelling	ispell-word	Alt+$

Also, now you can hold down the Shift key then press arrows key to
select text. To turn this off, put:

(setq shift-select-mode nil) ; “t” for true, “nil” for false

However, by default, pressing delete key will not delete the selected
text. If you want this, put:

(delete-selection-mode 1) ; make typing override text selection

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-20 21:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 19:04 Turn off selection coloring Harry Putnam
2009-09-15 19:22 ` Tassilo Horn
2009-09-17 22:07   ` Harry Putnam
2009-09-18  5:49     ` Tassilo Horn
2009-09-18 14:53       ` Harry Putnam
2009-09-18 18:33         ` Tassilo Horn
2009-09-19 20:01           ` Harry Putnam
     [not found]           ` <mailman.7064.1253390548.2239.help-gnu-emacs@gnu.org>
2009-09-20 19:18             ` John A Pershing Jr
     [not found] <mailman.6729.1253041517.2239.help-gnu-emacs@gnu.org>
2009-09-20 21:49 ` Xah Lee

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