[Top][All Lists]

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

Re: customize-rouge output with emacs -q --no-site-file

From: Luc Teirlinck
Subject: Re: customize-rouge output with emacs -q --no-site-file
Date: Fri, 4 Feb 2005 17:48:54 -0600 (CST)

The list of variables we are talking about may depend on the operating
system, the environment variables the user has set, the user's X
customization settings (usually in .Xdefaults) and of course, also
changes over time as Emacs' code changes.  So you would need to use
mapatoms, as in the patch below.

I do _not_ believe that this patch is the right solution to the
problems.  It solves the problem I described.  But as I said, this was
just an example of the very large and very varied group of problems
that are involved.

Here is a second problem, which the patch does not solve.  The warning
is now gone.  So the user happily customizes one of these hook (or
alist or list) variables.  He thereby hardwires environment and
.Xdefaults settings into his .emacs, which is bad, but not the worst
problem.  If we now make changes to Emacs that require adding other
elements to these hooks, lists or alists, or removing elements, the
user does not get those values, because he hardwired the old value in
his .emacs.

One small example.  I proposed calling vc-find-file-hook directly from
after-find-file.  If we do that and if anybody made changes to
find-file-hook and saved them to .emacs, vc-find-file hook is
probably in the saved value and gets called twice, once from
after-find-file and once from the saved value of find-file-hook.
This double calling is probably just a slight inefficiency rather than
a disaster, but other things could make Emacs completely malfunction.
There is nothing we can do about that, we have to be able to make
changes in Emacs.

The "Changed outside Custom" warning for a variable should stay unless
we make _all aspects_ of customizing the variable completely safe.

It is _not_ safe, not even after the patch you proposed, to customize
any of the involved hooks, lists or alists using Custom.  It is safe
to customize them in your .emacs as long as you use add-hook (for
hooks) or push (for lists) and do not use setq.  If you use setq, you
get into exactly the same problem I described above for Custom, but
most people realize that you should normally not use setq for hooks
and something in the docstrings of the lists or alists should make it
clear that you should not use setq.

The second problem I described above is a second _example_ of the
problems involved.  There is worse.  I pointed out a third example
before.  And that is not the last one either.

The patch below is intended _for experimentation purposes only_.  It
is interesting to build a version of Emacs with it and experiment.
Why, after the patch `paragraph-ignore-fill-prefix' and
`parse-sexp-ignore-comments' are considered rogue variables in `emacs -q'
beats me.  Their values are correct and nothing seems wrong with them.

===File ~/startup-diff======================================
*** startup.el  28 Dec 2004 09:50:38 -0600      1.337
--- startup.el  04 Feb 2005 15:47:50 -0600      
*** 785,790 ****
--- 785,796 ----
                   (cdr tool-bar-lines)
                   (not (eq 0 (cdr tool-bar-lines)))))))
+   (mapatoms
+    (lambda (symbol)
+      (and (boundp symbol)
+         (get symbol 'standard-value)
+         (put symbol 'standard-value (list symbol)))))
    (let ((old-scalable-fonts-allowed scalable-fonts-allowed)
        (old-font-list-limit font-list-limit)
        (old-face-ignored-fonts face-ignored-fonts))

reply via email to

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