[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: user-controlled load-path extension: load-dir

From: Jan D.
Subject: Re: user-controlled load-path extension: load-dir
Date: Wed, 09 Mar 2011 08:29:24 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv: Gecko/20101207 Thunderbird/3.1.7


What is wrong with (expand-file-name "~/emacs.d/load.d")? I don't think user-init-file can be nil either.

It is much better to explicitly check for "." and ".." than use directory-files-no-dot-files-regexp. That regexp is really really slow.

        Jan D.

Ben Key skrev 2011-03-09 07:50:

I have attached to this message version 4 of user-load-dir.el.

Several changes have been made to this version.

   1. The error handling in load-dir actually works as expected.  If one
      of the files in the user-load-dir generates an error, it is
      silently ignored and load-dir continues to load all the other
      files in the user-load-dir.
   2. Added the function byte-compile-dir to user-load-dir.el.  This
      function can be used to byte compile all files in the directory
      specified by the directory parameter.  If the optional parameter
      recurs is non-nil, this is done recursively.
   3. Added the function byte-compile-user-load-dir-files.  This
      interactive function may be used to byte compile all files in the
   4. The function load-user-load-dir-files does nothing if
      user-load-dir is nil.
   5. Modified the user-load-dir defcustom so that it is set to t
      instead of nil in the case that it cannot be initialized at load
      time due to user-init-file being nil.
   6. Modified user-load-dir-after-init-hook so that it only sets
      user-load-dir to its default value if it is equal to t.

The reason I made changes 5 and 6 is to allow for the possibility of
this feature being disabled by the user setting user-load-dir to nil.

Setting auto-load-files-in-user-load-dir to nil causes to not be called
automatically by the user-load-dir-after-init-hook but the files can
still be called by calling load-user-load-dir-files interactively.
Setting user-load-dir to nil disables load-user-load-dir-files and

reply via email to

[Prev in Thread] Current Thread [Next in Thread]