[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: user-controlled load-path extension: load-dir
From: |
PJ Weisberg |
Subject: |
Re: user-controlled load-path extension: load-dir |
Date: |
Wed, 16 Mar 2011 21:42:17 -0700 |
2011/3/16 Ted Zlatanov <address@hidden>:
> On Wed, 16 Mar 2011 22:13:24 -0400 Stefan Monnier <address@hidden> wrote:
>
>>>>> Chong, Stefan, can I take this and the lack of new posts in this thread
>>>>> to mean it's OK to commit an experimental implementation of the load-dir
>>>>> idea?
> SM> Adding a load-directory function is OK, yes. But please send the
> SM> corresponding patch for review first.
>
>>> First, the library.
>
> SM> Sounds like this is a package, which I'd be happy to see in ELPA, but
> SM> in core.
>
...
>
> If you and Chong don't want that, then I'll put it in the ELPA.
I only saw Stefan say to go ahead with a load-directory function,
which I assumed would live in files.el next to load-file and look
something like this:
(defun load-directory (dir recursive)
"Load all Lisp files in DIR. If RECURSIVE is non-nil,
recursively call load-directory for all subdirectories of dir."
(interactive "DLoad Dir: \nP")
(dolist (file (directory-files dir t ".*\\.el$"))
;; Cut off the .el so load will pick up the .elc version if it's there
(setq file (substring file 0 -3))
(load file))
(when recursive
(dolist (file (directory-files dir t))
(if (and (file-directory-p file)
(not (string-match "/\\.\\.?$" file)))
(load-directory file recursive)))))
If I'm not mistaken that's about 90% of what you want, and makes using
your own load-dir at least as easy as using your own custom-file.
-PJ
- Re: user-controlled load-path extension: load-dir, (continued)
- Re: user-controlled load-path extension: load-dir, Ted Zlatanov, 2011/03/11
- Re: user-controlled load-path extension: load-dir, Ted Zlatanov, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Stefan Monnier, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Ted Zlatanov, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Stefan Monnier, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Ted Zlatanov, 2011/03/16
- Re: user-controlled load-path extension: load-dir,
PJ Weisberg <=
- Re: user-controlled load-path extension: load-dir, Evans Winner, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Ted Zlatanov, 2011/03/16
- Re: user-controlled load-path extension: load-dir, Stefan Monnier, 2011/03/09
Re: user-controlled load-path extension: load-dir, Ben Key, 2011/03/17