From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Robert J. Chassell" Newsgroups: gmane.emacs.devel Subject: Re: [comp.emacs] Announcing Easymacs: an all-in-one Emacs configuration for newbies Date: Fri, 1 Jul 2005 13:36:00 +0000 (UTC) Message-ID: References: <85y88r6kf2.fsf@lola.goethe.zz> Reply-To: bob@rattlesnake.com NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1120224785 1033 80.91.229.2 (1 Jul 2005 13:33:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2005 13:33:05 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 01 15:33:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DoLdP-0007fX-Mo for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2005 15:32:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DoLlr-0003W5-Ql for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2005 09:41:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DoLic-0001w9-0V for emacs-devel@gnu.org; Fri, 01 Jul 2005 09:38:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DoLiU-0001qY-K1 for emacs-devel@gnu.org; Fri, 01 Jul 2005 09:38:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DoLiU-0001po-Dd for emacs-devel@gnu.org; Fri, 01 Jul 2005 09:38:02 -0400 Original-Received: from [69.168.108.225] (helo=rattlesnake.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DoLle-0007a1-EU for emacs-devel@gnu.org; Fri, 01 Jul 2005 09:41:18 -0400 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.115) Fri, 1 Jul 2005 13:36:00 +0000 (UTC) Original-To: emacs-devel@gnu.org In-reply-to: <85y88r6kf2.fsf@lola.goethe.zz> (message from David Kastrup on Fri, 01 Jul 2005 09:43:29 +0200) 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:40030 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40030 David Kastrup writes The following announcement seems like an excellent reason to get custom themes working. ... Yes. The advantages of a customize theme command are two fold: writing customizations becomes more usual for those who have learned differently than writing simple expressions. And loading the resulting libraries becomes simpler. As Luc Teirlinck pointed out, for loading, the current custom theme files use custom-theme-set-variables and custom-theme-set-faces. This is not necessary. There is an alternative way to load and unload the current custom theme libraries. This means writing one new function (which may be hard). The other part of customization, the part that uses the existing cus-*.el libraries, is fine for people who have not learned or do not wish to learn to write customizations in the normal way. For loading, the current custom theme methods is very inconvenient for those who have 20 year old custom theme libraries and load them frequently (well, I mean, load the current version of the library). That is because the regular customization libraries must be rewritten using custom-theme-set-variables and custom-theme-set-faces. On the other hand, the new method is advantageous to those who wish to specify the name of a custom theme inside a library instead of making the name of the library be the name of the theme. I think we should drop the loading method in the current set up and use the conventional loading method. The latter works fine to load `custom-set-faces' and `custom-set-variables' expressions; they can be set however you want. To load and unload custom themes we only need two functions, one of which has been around since the beginning and one of which is new. The first function is `load-library'. It loads an existing custom theme file, such as a .emacs file with a `custom-set-faces' expression in it. The second function does not exist. It is `unload-libraries'. This function should unbind every customized or user-modified symbol in an instance of Emacs and rebind those symbols to whose which come with emacs -q --no-site-file (Well, the function should be named `unload-library' and should only unload a specified library and return only those bindings to their defaults; but I think that is harder.) Thus, to offer an Emacs theme that has my personal theme plus a theme with a white background (useful for sitting in the sun), type M-x load-library RET .emacs RET M-x load-library RET .emacs-white-background RET To return to a default instance of Emacs, type M-x unload-libraries RET The disadvantage is that each theme is specified by a named file. In addition, you cannot put different themes into the same file. Also, you cannot substract one theme from another, since `unload-libraries' rebinds all symbols to whose which come with come with `emacs -q --no-site-file'. I do not know how unload one or more non-default libraries and return an instance of Emacs to a default. A function using `makunbound' is not what we want since `makunbound' does not rebind a symbol to the default value. It makes the symbol be void. As for `unload-feature', I cannot figure out how to call the name of a file, such as "~/.emacs-white-background" a `feature' that means the rest of the library must be loaded or unloaded. (I hope the capability is there and that I am just being foolish.) In any event, like everyone, I customize my instances of Emacs all the time using various .emacs files. However, instead of unloading such customizations, I simply start a new instance with `-q -l ' and the name of a different file to load. Thus, if the customization file exists, I could start Easymacs with emacs -q -l .emacs-easymacs With the new function, I could start an instance of Emacs of my own and then type M-x unload-libraries RET M-x load-library RET .emacs-easymacs RET For me, the first is easier, but for many, the second would be easier. As for settings that go into a customization file: that capability can be left as is. Some variables, like `inhibit-startup-message', should be set with `setq' with the expression written into the customization file. On the other hand, to specify faces, it is often best to use the `custom-set-faces' function. When the face is new and you are working interactively, the function automatically writes the expression into the initialization file. But you need not work interactively; for previously set faces, you can change the expression in your .emacs file. This can be very convenient. This is a scheme that works for both novices and experts: use the old loading function, one new unloading function, and the current setting mechanisms. -- Robert J. Chassell bob@rattlesnake.com GnuPG Key ID: 004B4AC8 http://www.rattlesnake.com http://www.teak.cc