[Top][All Lists]

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

bug#11106: 24.0.94; enhancement request: have autoload treat faces like

From: Drew Adams
Subject: bug#11106: 24.0.94; enhancement request: have autoload treat faces like it does options
Date: Tue, 27 Mar 2012 17:31:42 -0700

I wasn't as clear as I could have been.  Maybe this will help.

There are I guess two requests here: 

1. Handle faces (deffaces) similarly to how options (defcustoms) are handled.

2. Have function `autoload' handle both faces and options via its TYPE arg.

#2 would mean that the face attributes (hereafter default "value" of the face)
and the option default value would not be computed by function `autoload'.
Instead, that function would just cause the proper Lisp file to be loaded
whenever the face or option was first accessed.  If something tries to use the
face or option, and it is not yet defined, the autoload would kick in and the
file would be loaded to define it.

#2 is helpful (to me) because it means that actually assigning a value would be
done only when the library is loaded, not when the autoload form is created.
For example,

;;;###autoload (autoload 'a-face "a-file" nil 'face)

would put in place the triggers that would cause file "a-file.el[c]" to be
loaded when face `a-face' is first accessed (is still undefined).  That load
would then cause the face to be defined, by evaluating its default "value" sexp.
Similarly for user options.

What I'm describing is in effect what happens for autoloaded functions (IIUC).
It is the loading of the file that actually defines the functions (not the
creation of the autoloads or the loading of a file of autoloads).

I fear I'm not being clear enough.  Perhaps because it's still fuzzy to me.  But
maybe it will make sense to someone.

reply via email to

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