all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Feature Request : autoload-form
@ 2008-03-28 20:05 paul r
  2008-03-29  4:20 ` Stefan Monnier
  0 siblings, 1 reply; 21+ messages in thread
From: paul r @ 2008-03-28 20:05 UTC (permalink / raw)
  To: Emacs Devel

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




^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-04-03  5:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 20:05 Feature Request : autoload-form paul r
2008-03-29  4:20 ` Stefan Monnier
2008-03-29  9:49   ` paul r
2008-03-29 19:40     ` Stefan Monnier
2008-03-30  5:49   ` Richard Stallman
2008-03-30 11:24     ` paul r
2008-03-30 15:03       ` Stefan Monnier
2008-03-30 22:28         ` paul r
2008-03-31  7:58           ` Levin Du
2008-03-30 19:55       ` Richard Stallman
2008-03-30 21:35       ` Mike Mattie
2008-03-31 16:24       ` Richard Stallman
2008-03-31 17:36         ` paul r
2008-03-31 21:31         ` Mike Mattie
2008-04-02  2:53           ` Richard Stallman
2008-04-02 12:44             ` paul r
2008-04-02 17:34               ` Richard Stallman
2008-04-02 19:06                 ` paul r
2008-04-02 21:07                   ` Don Armstrong
2008-04-03  4:30                     ` Stephen J. Turnbull
2008-04-03  5:01                       ` Don Armstrong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.