unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <11106@debbugs.gnu.org>
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	[thread overview]
Message-ID: <54253A206B4248F99B4AD830266E374C@us.oracle.com> (raw)
In-Reply-To: <7134C9FED9064A64BCE682995B981BB6@us.oracle.com>

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	other threads:[~2012-03-28  0:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 23:57 bug#11106: 24.0.94; enhancement request: have autoload treat faces like it does options Drew Adams
2012-03-28  0:31 ` Drew Adams [this message]
2012-03-28 12:41   ` Stefan Monnier
2012-03-28 13:39     ` Drew Adams
2012-03-28 15:50       ` Stefan Monnier
2012-03-28 17:08         ` Drew Adams
2012-03-28 18:45           ` Stefan Monnier
2016-04-28 14:17             ` Lars Ingebrigtsen

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=54253A206B4248F99B4AD830266E374C@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=11106@debbugs.gnu.org \
    /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).