From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alex Schroeder Newsgroups: gmane.emacs.devel Subject: Re: color-theme.el Date: Sun, 25 Aug 2002 15:38:57 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <874rdjf47i.fsf_-_@emacswiki.org> References: <20020824043224.GC20524@reactor-core.org> <200208250527.g7P5RSs12119@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030282736 22024 127.0.0.1 (25 Aug 2002 13:38:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2002 13:38:56 +0000 (UTC) Cc: krooger@debian.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17ixbS-0005j7-00 for ; Sun, 25 Aug 2002 15:38:54 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17iy5n-0004Jk-00 for ; Sun, 25 Aug 2002 16:10:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ixcd-0003tD-00; Sun, 25 Aug 2002 09:40:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17ixaT-0003iT-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 09:37:53 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17ixaQ-0003iG-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 09:37:52 -0400 Original-Received: from relay02.cablecom.net ([62.2.33.102]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ixaK-0003gA-00; Sun, 25 Aug 2002 09:37:44 -0400 Original-Received: from smtp.swissonline.ch (mail-4.swissonline.ch [62.2.32.85]) by relay02.cablecom.net (8.12.5/8.12.5/SOL/AWF/MXRELAY/20020820) with ESMTP id g7PDbIWs074914; Sun, 25 Aug 2002 15:37:18 +0200 (CEST) (envelope-from alex@emacswiki.org) Original-Received: from confusibombus (dclient217-162-239-43.hispeed.ch [217.162.239.43]) by smtp.swissonline.ch (8.11.6/8.11.6/SMTPSOL/AWF/2002040101) with ESMTP id g7PDbAH06597; Sun, 25 Aug 2002 15:37:10 +0200 (MEST) Original-Received: from alex by confusibombus with local (Exim 3.35 #1 (Debian)) id 17ixbV-00006t-00; Sun, 25 Aug 2002 15:38:57 +0200 Original-To: rms@gnu.org X-Face: ^BC$`[IcggstLPyen&dqF+b2'zyK#r.mU*'Nms}@&4zw%SJ#5!/7SMVjBS7'lb;QK)|IPU5U'o1'522W4TyzB3Ab*IBo^iw]l4|kUbdZuUDO6=Um-.4IzhNiV'B"@K#jy_(wW|Zbk[34flKY^|PrQ?$u2\fKg^]AY>wOX#H32i In-Reply-To: <200208250527.g7P5RSs12119@wijiji.santafe.edu> (Richard Stallman's message of "Sat, 24 Aug 2002 23:27:28 -0600 (MDT)") Original-Lines: 229 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2.90 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6870 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6870 Richard Stallman writes: > May I also take this time to ask that color-theme.el be added to the > Emacs distribution. > > What does this do, and how can I talk with the author? I am the author. :) Basically, it provides around 50 elisp functions that will change lots of faces, frame-parameters, and variables, such as to change the look of Emacs completely. Since all 50 functions redefine lots of faces, the source file is VERY large: ~/WWW/home/tuning $ ls -l ~/elisp/color-theme total 635 drwxrwxr-x 2 alex alex 4096 Aug 10 20:58 CVS -rw-rw-r-- 1 alex alex 4195 Apr 30 00:32 color-theme-maker.el -rw-rw-r-- 1 alex alex 634752 Aug 10 20:57 color-theme.el -rw-rw-r-- 1 alex alex 569761 Aug 25 15:31 color-theme.elc -rw-rw-r-- 1 alex alex 3097 Sep 1 2001 make-theme.el The color-theme-maker.el allows you to combine several color themes into new themes, by example taking all faces definitions of faces starting with "gnus-" from theme A and all other faces from theme B. make-theme.el allows you to split the color-theme.el file automatically into an "engine" and on file per theme function. We could make only the engine part of Emacs, and let people distribute themes by themselves. Here is a very short example -- my favorite theme. It installs color-theme-gnome2, and then it does some slight modifications. It also illustrates that many themes include faces for packages that are not part of Emacs. I would not go through the trouble of removing these, since I depend on theme contributions by users. (defun color-theme-robin-hood () "`color-theme-gnome2' with navajo white on green." (interactive) (color-theme-gnome2) (let ((color-theme-is-cumulative t)) (color-theme-install '(color-theme-robin-hood ((foreground-color . "navajo white") (background-color . "#304020")) ((CUA-mode-read-only-cursor-color . "white")) (default ((t (nil)))) (fringe ((t (:background "#003700")))) (header-line ((t (:background "#030" :foreground "#AA7")))) (ido-subdir-face ((t (:foreground "MediumSlateBlue")))) (menu ((t (:background "#304020" :foreground "navajo white")))) (modeline ((t (:background "dark olive green" :foreground "wheat")))) (semantic-dirty-token-face ((t (:background "grey22")))) (tool-bar ((t (:background "#304020" :foreground "wheat" :box (:line-width 1 :style released-button))))) (tooltip ((t (:background "lemon chiffon" :foreground "black")))))))) The color theme selection buffer looks something like this: [Reset] Undo changes, if possible. [Quit] Bury this buffer. Aalto Dark Jari Aalto Aalto Light Jari Aalto Alice Blue Girish Bharadwaj Arjen Arjen Wiersma Bharadwaj Girish Bharadwaj Billw Bill White BlackOnGray Sudhir Bhojwani Blipp Blopp Thomas Sicheritz-Ponten Black Jonadab Blue Mood Nelson Loyola Blue Sea Alex Schroeder Cheap Goldenrod Alex Schroeder etc. As you can see, we would need assignments by all the authors. Since their email addresses are part of the source, however, this should be easy to get. Alex. PS: Here is the commentary of color-theme.el. ;;; Commentary: ;; Sharing your current color setup: ;; ;; Use `color-theme-submit'. If you have already invested time in ;; customizing Emacs faces, please consider sharing your current setup. ;; Make sure that color-theme.el is in your `load-path'. Type M-x ;; load-library RET color-theme RET to load all the functions. Type M-x ;; color-theme-submit RET and mail the result to the maintainer of this ;; package (see above for mail addres). ;; ;; If you want to make sure that all your customization was exported, ;; type M-x list-faces-display RET to get a list of all faces currently ;; defined. This is the list of faces that `color-theme-print' uses. ;; Installing a color theme: ;; ;; Make sure that color-theme.el is in your `load-path'. Type M-x ;; load-library RET color-theme RET to load all the functions. ;; ;; The main function to call is color-theme-select. Type M-x ;; color-theme-select RET. That creates a Color Theme Selection ;; buffer. Press RET or `i' on a color theme to install it for the ;; rest of your session. ;; ;; If you want to install the color theme as soon as Emacs is started ;; up, read the description of the theme you like and remember the ;; name of the color theme function. Press `d' on a color theme in ;; the Color Theme Selection buffer to read the description. Assuming ;; you like the Gnome2 theme, you'll find that the function to use is ;; called `color-theme-gnome2'. Add the following to the end of your ;; .emacs (removing the leading `;;'). ;; ;; (require 'color-theme) ;; (color-theme-gnome2) ;; Changing menu colors: ;; ;; In Emacs 21 on X, you can set the menu colors and font using the ;; menu face. Example for your .emacs file: ;; ;; (set-face-font 'menu "7x14") ;; (set-face-foreground 'menu "white"). ;; ;; If are using X, you can set the menu foreground and background using ;; a resource file, usually .Xdefaults or .Xresources. Usually ;; .Xdefaults is used when you start your session using a display ;; manager such as xdm or gdm. .Xresources is usually used when you ;; start X directly via a shell script such as startx. If you set ;; Emacs*Background and Emacs*Foreground in such a resource file, the ;; foreground and background of Emacs including the menu will be set. ;; If your .emacs then loads a color theme, the foreground and ;; background are changed -- with the exception of the menu. There is ;; no way to manipulate the menu foreground and background color from ;; elisp. You can also set more specific menu resources for Emacs in ;; the resource file. Here is a sample entry for your resource file: ;; ;; Emacs*Background: DarkSlateGray ;; Emacs*Foreground: wheat ;; Creating your own color theme: ;; ;; Use M-x customize-face and customize the faces. Make sure to "Set ;; for Current Session" -- you don't want to save these using custom! ;; When you are done, call M-x color-theme-print to produce the elisp ;; code required to recreate your theme. Better yet, use M-x ;; color-theme-submit to mail it to the maintainer. That way it will be ;; added to future versions of color-theme.el. ;; ;; For more information on the elisp format of a color theme, start with ;; the documentation of `color-theme-install' using C-h f ;; color-theme-install. ;; ;; When your color theme is just a variation of an existing color theme, ;; take a look at `color-theme-robin-hood' in order to see an example of ;; how to do it. Essentially you want to call all the parent color ;; themes before installing your changes. For all but the first parent ;; color theme, you need to make sure that `color-theme-is-cumulative' ;; is bound to t. If you don't do that, users that set ;; `color-theme-is-cumulative' to nil will only install your changes ;; without the parent color themes. ;; Making a color theme work for both Emacs and XEmacs: ;; ;; The most important thing is to add missing faces for the other ;; editor. These are the most important faces to check: ;; ;; In Emacs In XEmacs ;; `font-lock-builtin-face' `font-lock-reference-face' ;; `font-lock-doc-face' `font-lock-doc-string-face' ;; `font-lock-constant-face' `font-lock-preprocessor-face' ;; `modeline' `modeline-buffer-id' ;; `modeline' `modeline-mousable' ;; `modeline' `modeline-mousable-minor-mode' ;; `region' `primary-selection' ;; `region' `zmacs-region' ;; `font-lock-string-face' `dired-face-boring' ;; `font-lock-function-name-face' `dired-face-directory' ;; `default' `dired-face-executable' ;; `font-lock-warning-face' `dired-face-flagged' ;; `font-lock-warning-face' `dired-face-marked' ;; `default' `dired-face-permissions' ;; `default' `dired-face-setuid' ;; `default' `dired-face-socket' ;; `font-lock-keyword-face' `dired-face-symlink' ;; ;; Further comments: ;; ;; In Emacs 21 `modeline' is just an alias for `mode-line'. I recommend ;; the use of `modeline' until further notice. ;; ;; The support for :foreground and :background attributes works for ;; Emacs 20 and 21 as well as for XEmacs. :inverse-video is taken care ;; of while printing color themes. ;; ;; I don't recommend making font sizes part of a color theme. Most ;; users would be surprised to see their font sizes change when they ;; install a color-theme. Therefore, remove all :height attributes if ;; the value is an integer. If the value is a float, this is ok -- the ;; value is relative to the default height. One notable exceptions is ;; for a color-theme created for visually impaired people. These *must* ;; use a larger font in order to be usable. ;; ;; The tool-bar should not be part of the frame-parameters, since it ;; should not appear or disappear depending on the color theme. The ;; apppearance of the toolbar, however, can be changed by the color ;; theme. For Emacs 21, use the `tool-bar' face. The easiest way to do ;; this is to give it the default fore- and background colors. This can ;; be achieved using (tool-bar ((t (nil)))) in the theme. Usually it ;; makes more sense, however, to provide the same colors as used in the ;; `menu' face, and to specify a :box attribute. In order to alleviate ;; potential Emacs/XEmacs incompatibilities, `toolbar' will be defined ;; as an alias for `tool-bar' if it does not exist, and vice-versa. ;; This is done eventhough the face `toolbar' seems to have no effect on ;; XEmacs. If you look at XEmacs lisp/faces.el, however, you will find ;; that it is in fact referenced for XPM stuff. ;; ;; Similarly, the `fringe' face defines what the left and right borders ;; of the frame look like in Emacs 21. To give them default fore- and ;; background colors, use (fringe ((t (nil)))) in your color theme. ;; Usually it makes more sense to choose a color slightly lighter or ;; darker from the default background.