[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CVS] f7, f8 bound..

From: Alex Schroeder
Subject: Re: [CVS] f7, f8 bound..
Date: Thu, 05 Sep 2002 00:35:17 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2.90 (i686-pc-linux-gnu)

"Robert J. Chassell" <address@hidden> writes:

> As you saying that sometime recently, Emacs introduced a construction
> so that these expressions no longer go into my .emacs file (or into
> another file that is loaded from .emacs)?  If so, where are they?  How do
> I hand edit them?

It is not yet part of Emacs.  The concept of a diff-list is that a
list has a standard value, and all you want to do is add items or
remove items from the list.  This is important for large lists where
your changes are small in comparison -- complex lists and keymaps come
to mind.

This translates as follows.

Normal variable:

(setq l '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))

or use custom to save a setting to a file:

(custom-set-variables ... (l '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))

Diff List:

(add-to-list 'l 16)
(setq l (delete 4 l))

or use custom to save it:

(custom-set-variables ... (l '(diff-list (16) (4))))

I think this representation works pretty well for me.  You might have
problems, if you think about it as follows:

(setq l '(1 2 3 5 6 7 8 9 10 11 12 13 14 15 16))

is saved by custom as

(custom-set-variables ... (l '(diff-list (16) (4))))

If you think that custom-set-variables just represents a set of setq
statements, then you will be confused.

What is the benefit, you might ask.

Well, 1. we might save space in the file where the customizations are
saved, since we do not need to copy them there, and 2. the
customization will make sense even when the standard-value of a list
has changed.  Again, the example is Gnus.  Assume you have a list of
MIME types.  You want to remove text/html and add picture/jpeg.  If
the new Gnus adds signature/gpg as a MIME type, only the diff-list
solution will produce a value that contains the new signature/gpg
type, as well as picture/jpeg added by the user, and lacking text/html
removed by the user.

Ok, enough for today.  :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]