From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel 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 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1119913151 10429 80.91.229.2 (27 Jun 2005 22:59:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Jun 2005 22:59:11 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 28 00:59:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dn2Z1-0005Py-5J for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2005 00:58:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dn2gj-00046C-Qc for ged-emacs-devel@m.gmane.org; Mon, 27 Jun 2005 19:06:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dn2e7-0003eK-1B for emacs-devel@gnu.org; Mon, 27 Jun 2005 19:04:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dn2bQ-0003Q2-T1 for emacs-devel@gnu.org; Mon, 27 Jun 2005 19:01:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dn2bM-0003I1-1Q for emacs-devel@gnu.org; Mon, 27 Jun 2005 19:01:16 -0400 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Dn2MS-0006LI-Nh for emacs-devel@gnu.org; Mon, 27 Jun 2005 18:45:52 -0400 Original-Received: from agminet01.oracle.com (localhost [127.0.0.1]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j5RMfPDY003052 for ; Mon, 27 Jun 2005 17:41:25 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j5RMfOIt003037 for ; Mon, 27 Jun 2005 17:41:25 -0500 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j5RMfOgS019826 for ; Mon, 27 Jun 2005 16:41:24 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id j5RMfNVT019819 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 27 Jun 2005 16:41:24 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39699 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39699 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.