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: Sat, 19 Mar 2011 00:10:26 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=000325558c364862f1049ece14d2 X-Trace: dough.gmane.org 1300508290 29905 80.91.229.12 (19 Mar 2011 04:18:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2011 04:18:10 +0000 (UTC) To: tzz@lifelogs.com, Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 19 05:18:06 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 1Q0nYO-0007tV-8j for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2011 05:18:06 +0100 Original-Received: from localhost ([127.0.0.1]:35169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0nYE-00081W-Rm for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2011 00:14:06 -0400 Original-Received: from [140.186.70.92] (port=55895 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0nY9-0007yw-Ol for Emacs-devel@gnu.org; Sat, 19 Mar 2011 00:14:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0nY8-0005tU-H2 for Emacs-devel@gnu.org; Sat, 19 Mar 2011 00:14:01 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:55571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0nY8-0005tG-4M for Emacs-devel@gnu.org; Sat, 19 Mar 2011 00:14:00 -0400 Original-Received: by bwz17 with SMTP id 17so4323156bwz.0 for ; Fri, 18 Mar 2011 21:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=1OQR63j7fY5TohiIBRzwRCRIkd1kBRKs8zN6aKTyctc=; b=FFJao75ymrzjXdevUXewgnvXpLqQSvm7rCgMhLjPh1XWbUu1TVKTluVTMQV65UyoHR VeLYMIot9gQacZD1VbfLckEFSpgbwmjsVNCyoilGxewV434xGDAB/Q5+kwgulS/ucoUT jq787PfrOdAPwtnM1Pnq432IXSHMNmwKFxbsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=OH35LfeJelEmEl0OFmtg1Jy+gXKj9e/PuEGljvA0/1LNKd9IlkoK2+5TkHWm235RT6 z1sw7X5nMax2/NcM+PCfHbm4iN7L32YhAN9R/kcnpjdT24pmE+ebC2aOgcSoAXqpeF6V fPFFrclpkZIMnrvJjQe2nQ7ntAxQhOqCVJ+wA= Original-Received: by 10.204.19.65 with SMTP id z1mr13108bka.202.1300507847582; Fri, 18 Mar 2011 21:10:47 -0700 (PDT) Original-Received: by 10.204.130.65 with HTTP; Fri, 18 Mar 2011 21:10:26 -0700 (PDT) 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:137414 Archived-At: --000325558c364862f1049ece14d2 Content-Type: multipart/alternative; boundary=000325558c364862ea049ece14d0 --000325558c364862ea049ece14d0 Content-Type: text/plain; charset=ISO-8859-1 Hello, I have attached to this message an updated version of load-dir.el. In this version, I have made several basic improvements. 1. Each of the defcustom items now has a require property. The main benefit of this is that a user may now simply place load-dir.el in their load path, use M-x load-library to load 'load-dir' and then do a M-x customize-group to customize the 'load-dir' group, customize load-dirs, and restart Emacs. There is no need to also manually edit their .emacs file to add a '(require 'load-dir)' in order to actually cause Emacs to load load-dir.el. 2. Modified the load-dirs defcustom so that it can now accept several types via the "Value Menu" customize feature. 1. nil, the default value, effectively causes load-dir.el to do nothing. 2. t causes the default directory of ~/.emacs.d/load.d to be used (saves typing). 3. A single directory causes files in that directory to be loaded. 4. A list of directories causes all files in every directory in the list to be loaded. Note that the error handling code does not appear to be working as expected. I set load-dir-ignore-errors to t. I then placed a file error.el in my load-dir directory that contains a deliberate error. The expected behavior is for Emacs initialization to complete with perhaps a message telling me about the error. Instead, Emacs initialization halts at the error and the "*GNU Emacs*" buffer is never displayed. I will look into this latter. I hope that you find this changes useful. --000325558c364862ea049ece14d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I have attached to this message an updated v= ersion of load-dir.el.=A0 In this version, I have made several basic improv= ements.
  1. Each of the defcustom items now = has a require property.=A0 The main benefit of this is that a user may now = simply place load-dir.el in their load path, use M-x load-library to load &= #39;load-dir' and then do a M-x customize-group to customize the 'l= oad-dir' group, customize load-dirs, and restart Emacs.=A0 There is no = need to also manually edit their .emacs file to add a '(require 'lo= ad-dir)' in order to actually cause Emacs to load load-dir.el.
  2. Modified the load-dirs = defcustom so that it can now accept several types via the = "Value Menu" customize feature.
    1. nil, the default value, effectively causes load-dir.el to do nothing.
    2. t causes the default directory of ~/.emacs.d/load.d to= be used (saves typing).
    3. A single directory= causes files in that directory to be loaded.
    4. A list of directories causes all files in every directory in the list to= be loaded.
Note that the error handling code does not appea= r to be working as expected.=A0 I set load-dir-ignore-errors to t.=A0 I the= n placed a file error.el in my load-dir directory that contains a deliberat= e error.=A0 The expected behavior is for Emacs initialization to complete w= ith perhaps a message telling me about the error.=A0 Instead, Emacs initial= ization halts at the error and the "*GNU Emacs*" buffer is never = displayed.=A0 I will look into this latter.

I hope that you find this changes useful.

--000325558c364862ea049ece14d0-- --000325558c364862f1049ece14d2 Content-Type: application/octet-stream; name="load-dir.el" Content-Disposition: attachment; filename="load-dir.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_glfzmo9n0 Ozs7IGxvYWQtZGlyLmVsIC0tLSBsb2FkIGFsbCBFbWFjcyBMaXNwIGZpbGVzIGluIGdpdmVuIGRp cmVjdG9yaWVzCgo7OyBDb3B5cmlnaHQgKEMpIDIwMTEgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9u LCBJbmMKCjs7IEF1dGhvcnM6IFRlb2RvciBabGF0YW5vdiA8dHp6QGxpZmVsb2dzLmNvbT4sCjs7 ICAgICAgICAgIEJlbiBLZXkgPGJrZXk3NkBnbWFpbC5jb20+Cjs7IFdpdGgtSGVscC1Gcm9tOiBF dmFucyBXaW5uZXIgPGVnbzExMUBnbWFpbC5jb20+LCBQSiBXZWlzYmVyZyA8cGpAaXJyZWd1bGFy ZXhwcmVzc2lvbnMubmV0Pgo7OyBWZXJzaW9uOiAwLjAuMQo7OyBLZXl3b3JkczogbGlzcCwgZmls ZXMsIGNvbnZlbmllbmNlCgo7OyBUaGlzIGZpbGUgaXMgcGFydCBvZiBHTlUgRW1hY3MuCgo7OyBH TlUgRW1hY3MgaXMgZnJlZSBzb2Z0d2FyZTogeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29y IG1vZGlmeQo7OyBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBM aWNlbnNlIGFzIHB1Ymxpc2hlZCBieQo7OyB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBl aXRoZXIgdmVyc2lvbiAzIG9mIHRoZSBMaWNlbnNlLCBvcgo7OyAoYXQgeW91ciBvcHRpb24pIGFu eSBsYXRlciB2ZXJ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1wIGYpKQog ICAgICAgICAgICAgICAgIChtZW1iZXIgKGZpbGUtbmFtZS1leHRlbnNpb24gZiB0KSBzdWZmaXhl cykpCiAgICAgICAgKHNldHEgZiAoZmlsZS1uYW1lLXNhbnMtZXh0ZW5zaW9uIGYpKQogICAgICAg IChpZiAobWVtYmVyIGYgbG9hZC1kaXItbG9hZGVkKQogICAgICAgICAgICAobG9hZC1kaXItZGVi dWcgIlNraXBwaW5nICVzLCBpdCdzIGFscmVhZHkgbG9hZGVkLiIgZikKICAgICAgICAgIChpZiBs b2FkLWRpci1pZ25vcmUtZXJyb3JzCiAgICAgICAgICAgICAgKHdpdGgtZGVtb3RlZC1lcnJvcnMg KGxvYWQgZikpCiAgICAgICAgICAgIChsb2FkIGYpKQogICAgICAgICAgKGFkZC10by1saXN0ICds b2FkLWRpci1sb2FkZWQgZikpKSkKCiAgICAod2hlbiBsb2FkLWRpci1yZWN1cnNpdmUKICAgICAg KGRvbGlzdCAoZiAoZGlyZWN0b3J5LWZpbGVzIGRpciB0KSkKICAgICAgICAod2hlbiAoZmlsZS1k aXJlY3RvcnktcCBmKQogICAgICAgICAgKGxvYWQtZGlyLW9uZSBmKSkpKSkpCgooZGVmdW4gbG9h ZC1kaXItZGVidWcgKCZyZXN0IGFyZ3MpCiAgIlByaW50IGEgZGVidWcgbWVzc2FnZSBsaWtlIGBt ZXNzYWdlJyBpZiBgbG9hZC1kaXItZGVidWcnIGlzIHNldC4iCiAgKHdoZW4gbG9hZC1kaXItZGVi dWcKICAgIChhcHBseSAnbWVzc2FnZSBhcmdzKSkpCgo7OzsjIyNhdXRvbG9hZAooYWRkLWhvb2sg J2FmdGVyLWluaXQtaG9vayAnbG9hZC1kaXJzKQoKKHByb3ZpZGUgJ2xvYWQtZGlyKQo7OzsgbG9h ZC1kaXIuZWwgZW5kcyBoZXJlCg== --000325558c364862f1049ece14d2--