unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: Do Re Mi (was: Q on Text Properties popup menu - shouldn'titusethepointerposition, not the cursor position?)
Date: Mon, 27 Jun 2005 15:41:22 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICKENMCJAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1DmwkL-0005Hm-VN@fencepost.gnu.org>

        I also added items "Change Face Foreground", "Change Face
        Background", and "Change Face Attribute" to the menu. The
        first two let you change a face incrementally (using the
        arrow keys or mouse wheel). Using the C-mouse-2 popup menu,
        you can just point to some text that has a face and change the
        face's colors incrementally. No need to know the face name or color
        names/values beforehand: just point and tweak.

    That is completely unrelated to changing the text properties of some
    text, but it could be a useful feature, if it makes face customization
    really easy.  Can you describe the interface?  How do you use the
    mouse to change a color?  Colors are in a 3-dimensional space,
    and the mouse moves only in two dimensions.

Right; it is unrelated, except that it is a way to change the foreground and
background properties of a face or a frame.

I mentioned the incremental-change behavior previously (search for "doremi"
in archive for Nov or Dec 2004). A writeup is here:
http://www.emacswiki.org/cgi-bin/wiki/DoReMi. The same technique is used for
resizing and moving frames, zooming frames (font size), and cycling through
buffers, bookmarks, marks, or color themes, and other incremental or cyclic
changes. The idea is to (re)use the arrow keys for different commands.

Here's what the user experiences (it's easier to try it than to explain it,
however):

1. C-mouse-2 on text in, say, face `font-lock-comment'.
Choose "Change Face Foreground" in the popup "Text Properties" menu.

Alternatively, use `M-x doremi-face-fg'; that command prompts you for the
face to change.

2. Prompt appears in minibuffer:

"Change foreground of `font-lock-comment'. Adjust red, green, blue, hue,
saturation, or value? [rgbhsv]"

3. Enter one of the characters [rgbhsv]. Let's say you enter `r', for
incrementing/decrementing the red color component.

Note 1: You can do this (change color component) at any time during
incremental color change (step 4). For example, if you are incrementing the
red color component and you hit `v', then you switch immediatly to
incrementing the value color component. This is very useful; in effect, it
means that you need not reason in terms of RGB or HSV. A combination of
value changes and RGB changes, for instance, is often handy. You need not
think at all, in fact: just adjust a component to see what it does -
WYSIWYG. You can quickly obtain the color you want.

Note 2: The increment is set by default so as to give you a reasonable
change with each incrementation. You can change the increment, however, to
give you as fine control of the color as you need.

Note 3: Color models RGB, HSV, and CMY are handled. Color components cyan,
magenta, and yellow are just the opposite of components red, green, and
blue, respectively. Incrementing one is the same as decrementing the other.
So, for instance, if you want to increment magenta, just decrement (down
arrow) green.

4. Prompt appears in minibuffer:

"Use up, down, or mouse wheel to adjust value (modifier key: faster). Value
now: Firebrick"

or whatever your current foreground value of `font-lock-comment' is - mine
is Firebrick.

5. Use the up or down key, or the mouse wheel, to increment or decrement the
current red value. The foreground property of the face is changed - you can
see the result immediately on any buffers showing that face.

After each up/down/wheel action, the prompt echoes the (new) current value.
Color values are from now on expressed in the hex form #RRRRGGGGBBBB (red,
green, blue). For example, the prompt looks like this after hitting the up
arrow once:

"Use up, down, or mouse wheel to adjust value (modifier key: faster). Value
now: #B3B222222222"

After hitting the up arrow again, this is the prompt:

"Use up, down, or mouse wheel to adjust value (modifier key: faster). Value
now: #B4B222222222"

You can just hold down an arrow key to repeat its action and keep
incrementing. The echoed value is updated accordingly - just watch it spin
like an odometer. You can go back and forth with the up and down keys, until
you get just what you want.

If you hold down a modifier key (by default, `Meta') while using the arrow
keys or mouse wheel, then the incrementation is boosted: the increment is
larger. Use it to get quickly in the neighborhood of the color you want. The
prompt text "(modifier key: faster)" indicates this possibility. Do Re Mi
commands (such as `doremi-bookmarks') that cycle through enumerations,
instead of incrementing numerical values, do not have this modifier
behavior, with its prompt.

Note: Other Do Re Mi commands use all four arrows, if appropriate. For
instance, a command for resizing frames lets you use all four to grow/shrink
both width and height. This is actually accomplished by having two Do Re Mi
commands, one for each dimension, bound to up/down and left/right arrows
respectively. Each command calls the other at the end, if the other's arrows
are used. The user just seamlessly uses any of the four arrows, without
exiting from the initial command.

6. When you finally get the color you want, just do anything other than
[rgbhsv], up, down, or mouse-wheel, to exit. This message then appears in
the echo area:

"Use `customize-customized' to revisit changes."

The updated value is communicated to Customize, so it will show that the
face foreground was "set" in Customize (i.e. it cheats) and it can be saved
there.

  parent reply	other threads:[~2005-06-27 22:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 15:25 Q on Text Properties popup menu - shouldn't it use the pointer position, not the cursor position? Drew Adams
2005-06-24 15:58 ` Luc Teirlinck
2005-06-24 16:37   ` Q on Text Properties popup menu - shouldn't it use the pointerposition, " Drew Adams
2005-06-24 16:48     ` Drew Adams
2005-06-24 23:08     ` Luc Teirlinck
2005-06-24 23:35       ` Q on Text Properties popup menu - shouldn't it use thepointerposition, " Drew Adams
2005-06-25 22:53       ` Drew Adams
2005-06-25 23:17         ` Luc Teirlinck
2005-06-25 23:32           ` Q on Text Properties popup menu - shouldn't it usethepointerposition, " Drew Adams
2005-06-25 23:29         ` Q on Text Properties popup menu - shouldn't it use thepointerposition, " Luc Teirlinck
2005-06-26  1:26         ` Q on Text Properties popup menu - shouldn't it usethepointerposition, " Drew Adams
2005-06-26  1:29           ` Drew Adams
2005-06-27  0:07           ` Q on Text Properties popup menu - shouldn't itusethepointerposition, " Drew Adams
2005-06-27  0:46             ` Drew Adams
2005-06-27 16:46             ` Richard M. Stallman
2005-06-27 22:35               ` Q on Text Properties popup menu - shouldn'titusethepointerposition, " Drew Adams
2005-06-27 22:41               ` Drew Adams [this message]
2005-06-28 18:43                 ` Do Re Mi (was: Q on Text Properties popup menu -shouldn'titusethepointerposition, not the cursor position?) Drew Adams
2005-06-28 18:47                 ` Do Re Mi (was: Q on Text Properties popup menu - shouldn'titusethepointerposition, " Richard M. Stallman
2005-06-28 19:53                   ` Do Re Mi (was: Q on Text Properties popup menu -shouldn'titusethepointerposition, " Drew Adams
2005-06-28 20:33                     ` Robert J. Chassell
2005-06-28 21:01                       ` Do Re Mi (was: Q on Text Properties popup menu-shouldn'titusethepointerposition, " Drew Adams
2005-06-29  0:42                         ` Robert J. Chassell
2005-06-29  3:59                     ` Do Re Mi (was: Q on Text Properties popup menu -shouldn'titusethepointerposition, " Richard M. Stallman
2005-06-29 14:52                       ` Do Re Mi (was: Q on Text Properties popup menu-shouldn'titusethepointerposition, " Drew Adams
2005-06-24 16:09 ` Q on Text Properties popup menu - shouldn't it use the pointer position, not the cursor position? Luc Teirlinck

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICKENMCJAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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 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).