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 21:28:45 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0015175cd8d2b7ebfe049e04543d X-Trace: dough.gmane.org 1299641359 7186 80.91.229.12 (9 Mar 2011 03:29:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 03:29:19 +0000 (UTC) Cc: tzz@lifelogs.com, ego111@gmail.com To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 04:29:14 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 1PxA5J-0002Xd-Mx for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2011 04:29:14 +0100 Original-Received: from localhost ([127.0.0.1]:55696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxA5J-00059w-0n for ged-emacs-devel@m.gmane.org; Tue, 08 Mar 2011 22:29:13 -0500 Original-Received: from [140.186.70.92] (port=49520 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxA5D-00059h-Mj for Emacs-devel@gnu.org; Tue, 08 Mar 2011 22:29:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxA5C-0005N4-JU for Emacs-devel@gnu.org; Tue, 08 Mar 2011 22:29:07 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:46894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxA5C-0005N0-7z for Emacs-devel@gnu.org; Tue, 08 Mar 2011 22:29:06 -0500 Original-Received: by bwz17 with SMTP id 17so420818bwz.0 for ; Tue, 08 Mar 2011 19:29:05 -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:cc:content-type; bh=YvTtGmMM9Mu89+HvWGQpb+7S1rOP7B0oJx0ZK51F8NA=; b=e0J6BBuwpqD76xJcAofwjCD0yBjhXxWLBVVDX7pyiB8o8NeAFxchixc1V5QvrPuA8e Jyx1/I++o/85PU2efW1SeVAL9vpqho0q+h3REmPJMpenX4gQODxRyvPN/1GmuDY7ZKsB DeC/rLwdkLmT2etG9PizLq3Z/Ps8G82QDTV0c= 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 :cc:content-type; b=tDo3+e/8iD/sBQUqVg4R52gQ1aCkEII3sefEv1NC/QJN0jxfsCyArh8+4pDPfx0HVW WcR74slbeUpkoOb3qJapSjUKdNvwXVP8z5aUAGtzbYhGqtFcAi0zvSVKtht7cYOruSh6 jp7AXZaInV4Pk9iJVuWE8DyMRtZ9nmsLeNG7w= Original-Received: by 10.204.136.217 with SMTP id s25mr5098654bkt.13.1299641345239; Tue, 08 Mar 2011 19:29:05 -0800 (PST) Original-Received: by 10.204.14.147 with HTTP; Tue, 8 Mar 2011 19:28:45 -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:136933 Archived-At: --0015175cd8d2b7ebfe049e04543d Content-Type: multipart/alternative; boundary=0015175cd8d2b7ebf0049e04543b --0015175cd8d2b7ebf0049e04543b Content-Type: text/plain; charset=ISO-8859-1 Hello, I have attached to this message version 3 of user-load-dir.el. This version fixes a bug in the prior version in the usage of the after-init-hook. It also incorporates some basic error handling in the load-dir function. The load-dir function has also been modified so that when a .el file has been byte-compiled, thus causing a .el and a .elc file of the same name to exist, the file is only loaded once. In addition, user-load-dir.el now works correctly when it is loaded from site-start.el (I had to deal with the fact that user-init-file is nil at that point). Finally it now works correctly in XEmacs (directory-files-no-dot-files-regexp is not defined in XEmacs). I look forward to any feedback anyone might have to offer on this implementation of the user-load-dir feature. I also look forward to a discussion about how this feature will be offered to Emacs users. --0015175cd8d2b7ebf0049e04543b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I have attached to this message version 3 of= user-load-dir.el.=A0 This version fixes a bug in the prior version in the = usage of the after-init-hook.=A0 It also incorporates some basic error hand= ling in the load-dir function.=A0 The load-dir function has also been modif= ied so that when a .el file has been byte-compiled, thus causing a .el and = a .elc file of the same name to exist, the file is only loaded once.=A0 In = addition, user-load-dir.el now works correctly when it is loaded from site-= start.el (I had to deal with the fact that user-init-file is nil at that po= int).=A0 Finally it now works correctly in XEmacs (directory-files-no-dot-f= iles-regexp is not defined in XEmacs).

I look forward to any feedback anyone might have to offer on this imple= mentation of the user-load-dir feature.=A0 I also look forward to a discuss= ion about how this feature will be offered to Emacs users.

--0015175cd8d2b7ebf0049e04543b-- --0015175cd8d2b7ebfe049e04543d 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_gl1oplm10 Ozs7IHVzZXItbG9hZC1kaXIuZWwgLS0gQSBxdWljayBhbmQgZGlydHkgaW1wbGVtZW50YXRpb24g b2YgYSB1c2VyIGxvYWQKOzs7IGRpcmVjdG9yeS4gIFRoaXMgZmlsZSBpcyBwcm92aWRlZCBhcyBh IHBvc3NpYmxlIGFuc3dlciB0by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