From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.devel Subject: RE: user-controlled load-path extension: load-dir Date: Tue, 8 Mar 2011 12:49:37 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=bcaec52d4b05308ec8049dfd1452 X-Trace: dough.gmane.org 1299610223 14563 80.91.229.12 (8 Mar 2011 18:50:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Mar 2011 18:50:23 +0000 (UTC) To: Emacs-devel@gnu.org, tzz@lifelogs.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 08 19:50:19 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 1Px1z3-0003Rg-OQ for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2011 19:50:14 +0100 Original-Received: from localhost ([127.0.0.1]:43813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Px1z2-0002VE-UP for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2011 13:50:12 -0500 Original-Received: from [140.186.70.92] (port=57252 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Px1yu-0002UB-4o for Emacs-devel@gnu.org; Tue, 08 Mar 2011 13:50:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Px1yp-000414-AN for Emacs-devel@gnu.org; Tue, 08 Mar 2011 13:50:03 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:57789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Px1yp-00040i-1P for Emacs-devel@gnu.org; Tue, 08 Mar 2011 13:49:59 -0500 Original-Received: by bwz17 with SMTP id 17so106694bwz.0 for ; Tue, 08 Mar 2011 10:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=NkSOQZdjOW8V0zTOrYETUHf7+LA8jbdDCtH5KL4jrho=; b=tTIQ9TFgLiXv9dwGQBLNzhsAFCmq5Uk/4vd4ZRoB4SL8BLJBc0T5T01nQPFjfJQVh+ 6OcZMdSg5DtyYtXjo3L0rFK0bRD41LtyOqGsreb4vcFj5LigFKuLNDozWBTGEuvIWSa4 iyQrwmStIihxtwDs92YWQuQUmQTmV6afUTmno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=NE0R3g1JqLCWVtHCtYd6FF0WIYJcFRrur0wUo6LCLtrb3dd6TBdk0BlsYhfqI2oY7t SuOPhglqANl9YejrH1xMJDDizycTlgvvoPl3l2j69/FuWJnYOrnj7gaddES1s1XA97nY 4As2ovP1MMmmpxq7BZ1QfS62LlAopcpwE0oCU= Original-Received: by 10.204.175.194 with SMTP id bb2mr4842185bkb.121.1299610197855; Tue, 08 Mar 2011 10:49:57 -0800 (PST) Original-Received: by 10.204.14.147 with HTTP; Tue, 8 Mar 2011 10:49:37 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 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:136904 Archived-At: --bcaec52d4b05308ec8049dfd1452 Content-Type: multipart/alternative; boundary=bcaec52d4b05308ebd049dfd1450 --bcaec52d4b05308ebd049dfd1450 Content-Type: text/plain; charset=ISO-8859-1 Hello, I have attached to this message version 2 of user-load-dir.el. This version incorporates the recursive load-dir function written by Evans Winner (see < http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00239.html>). It also adds two new defcustom variables, load-files-in-user-load-dir-recursively and auto-load-files-in-user-load-dir. Note that one major new feature introduced by this version is that if the .el file has been byte compiled, the byte compiled version will be loaded instead of the source version. This is a major improvement over my original version which would only load .el files. There are two remaining issues with this version. If one of the files in the user-load-dir has been byte-compiled, it will be loaded twice. Also it has no error handling. I am more than willing to continue development of this file into an Emacs package that can be included in ELPA. This would make it possible for this useful feature to be made readily available to those who want to use it without including it in Emacs itself. I have one question. What sort of error handling should I incorporate into this package? --bcaec52d4b05308ebd049dfd1450 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I have attached t= o this message version 2 of user-load-dir.el.=A0 This version incorporates = the recursive load-dir function written by Evans Winner (see <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00239= .html>).=A0 It also adds two new defcustom variables, load-files-in-= user-load-dir-recursively and auto-load-files-in-user-load-dir.

Note that one major new feature introduced by this version is that if t= he .el file has been byte compiled, the byte compiled version will be loade= d instead of the source version.=A0 This is a major improvement over my ori= ginal version which would only load .el files.

There are two remaining issues with this version.=A0 If one of the file= s in the user-load-dir has been byte-compiled, it will be loaded twice.=A0 = Also it has no error handling.

I am more than willing to continue de= velopment of this file into an Emacs package that can be included in ELPA.= =A0 This would make it possible for this useful feature to be made readily = available to those who want to use it without including it in Emacs itself.=

I have one question.=A0 What sort of error handling should I incorporat= e into this package?


--bcaec52d4b05308ebd049dfd1450-- --bcaec52d4b05308ec8049dfd1452 Content-Type: application/octet-stream; name="user-load-dir.el" Content-Disposition: attachment; filename="user-load-dir.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gl14csdz0 Ozs7IHVzZXItbG9hZC1kaXIuZWwgLS0gQSBxdWljayBhbmQgZGlydHkgaW1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