emacs-devel
[Top][All Lists]
Advanced

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

Feature Request : autoload-form


From: paul r
Subject: Feature Request : autoload-form
Date: Fri, 28 Mar 2008 21:05:09 +0100

Dear list,

autoload is a very convenient feature to pseudo-defun a function until
it is called for real for the first time. I have been using it happily
until today, when I came accross a need I can not suit with autoload.
Here is why :
There is a file B that does some (require ...) and some (load ...). In
one of the loaded files, function F will be defined.
There is a file A that changes the load-path, which is required before
loading B.
B does not depend on a predefined A file, therefore I can not put a
(load A) in B.
The only way I have to carry a proper load is to do (load A)(load B).
After that, I'm sure F will be defined the way I want. I can really
not do that with a single file.
Hence my need : I think it would be convenient to have a variant of
autoload, let's call it 'autoload-form'.
Its look would be :
(autoload-form function form &optional docstring interactive type)
IOW, exactly the same as autoload, except that FILE becomes FORM.
It is a kind a generalization of autoload, in which it is up to FORM
to do what is needed to provide a side-effect of having FUNCTION
defined. To make sure I am clear, the following two lines have the
same effect
(autoload foo "bar.el")
(autoload-form foo (load-file "bar.el"))

With that, I could do a (autoload-form F (load-file "A")(load-file "B"))
Without, the only alternative I see is to write  (load-file
"A")(load-file "B") in a dummy file, then register it with autoload.

I really want to do that myself, but autoload belongs to the C part of
emacs, and I lack knowledge to change anything in it. I do not know
how to do this in emacs lisp, whenever it is possible.

I would like to know what you think about that. If you think I can do
something clean in lisp, please give me some hints, I do not know
where to start.

Regards,


-- Paul




reply via email to

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