unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: [comp.emacs] Announcing Easymacs: an all-in-one Emacs configuration for newbies
Date: Fri, 1 Jul 2005 13:36:00 +0000 (UTC)	[thread overview]
Message-ID: <m1DoLgW-0004QkC@rattlesnake.com> (raw)
In-Reply-To: <85y88r6kf2.fsf@lola.goethe.zz> (message from David Kastrup on Fri, 01 Jul 2005 09:43:29 +0200)

David Kastrup <dak@gnu.org> 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

  reply	other threads:[~2005-07-01 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01  7:43 [comp.emacs] Announcing Easymacs: an all-in-one Emacs configuration for newbies David Kastrup
2005-07-01 13:36 ` Robert J. Chassell [this message]
2005-07-01 14:21 ` Luc Teirlinck
2005-07-01 14:55   ` Lennart Borgman
2005-07-01 15:36     ` Luc Teirlinck
2005-07-01 15:51       ` Luc Teirlinck
2005-07-01 16:58       ` Robert J. Chassell

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=m1DoLgW-0004QkC@rattlesnake.com \
    --to=bob@rattlesnake.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).