From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.devel Subject: Re: user-controlled load-path extension: load-dir Date: Wed, 16 Mar 2011 21:42:17 -0700 Message-ID: References: <87oc5kax8l.fsf@stupidchicken.com> <8739mwnj3v.fsf@lifelogs.com> <87oc5kjarb.fsf@stupidchicken.com> <87pqprw3px.fsf@lifelogs.com> <87lj0eu8tj.fsf@lifelogs.com> <87fwqm4dym.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1300336958 4884 80.91.229.12 (17 Mar 2011 04:42:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2011 04:42:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 17 05:42:34 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q052f-00074E-NC for ged-emacs-devel@m.gmane.org; Thu, 17 Mar 2011 05:42:33 +0100 Original-Received: from localhost ([127.0.0.1]:57735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q052f-0004LS-AK for ged-emacs-devel@m.gmane.org; Thu, 17 Mar 2011 00:42:33 -0400 Original-Received: from [140.186.70.92] (port=39021 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q052W-0004Ia-3s for emacs-devel@gnu.org; Thu, 17 Mar 2011 00:42:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q052U-0004C9-QO for emacs-devel@gnu.org; Thu, 17 Mar 2011 00:42:23 -0400 Original-Received: from p3plsmtpa01-10.prod.phx3.secureserver.net ([72.167.82.90]:35737) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q052U-0004BL-KI for emacs-devel@gnu.org; Thu, 17 Mar 2011 00:42:22 -0400 Original-Received: (qmail 11934 invoked from network); 17 Mar 2011 04:42:19 -0000 Original-Received: from unknown (209.85.161.41) by p3plsmtpa01-10.prod.phx3.secureserver.net (72.167.82.90) with ESMTP; 17 Mar 2011 04:42:19 -0000 Original-Received: by fxm18 with SMTP id 18so2645549fxm.0 for ; Wed, 16 Mar 2011 21:42:17 -0700 (PDT) Original-Received: by 10.223.112.83 with SMTP id v19mr874591fap.122.1300336937563; Wed, 16 Mar 2011 21:42:17 -0700 (PDT) Original-Received: by 10.223.98.207 with HTTP; Wed, 16 Mar 2011 21:42:17 -0700 (PDT) In-Reply-To: <87fwqm4dym.fsf@lifelogs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 72.167.82.90 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137329 Archived-At: 2011/3/16 Ted Zlatanov : > On Wed, 16 Mar 2011 22:13:24 -0400 Stefan Monnier wrote: > >>>>> Chong, Stefan, can I take this and the lack of new posts in this thre= ad >>>>> to mean it's OK to commit an experimental implementation of the load-= dir >>>>> idea? > SM> Adding a load-directory function is OK, yes. =A0But 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