branch: externals/load-dir
commit 6e2bb9e4df79c16531e15f7551c33bc31ed8a2e3
Author: Stefan Monnier <monn...@iro.umontreal.ca>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    * load-dir.el (after-init-hook): Don't load `load-dir` unnecessarily
---
 load-dir.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/load-dir.el b/load-dir.el
index 463c6cd7b5..c41b0fb7db 100644
--- a/load-dir.el
+++ b/load-dir.el
@@ -1,6 +1,6 @@
-;;; load-dir.el --- Load all Emacs Lisp files in a given directory
+;;; load-dir.el --- Load all Emacs Lisp files in a given directory  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2011, 2017 Free Software Foundation, Inc
+;; Copyright (C) 2011-2022  Free Software Foundation, Inc
 
 ;; Authors: Teodor Zlatanov <t...@lifelogs.com>,
 ;;          Ben Key <bke...@gmail.com>
@@ -145,7 +145,8 @@ Recurses into subdirectories if `load-dir-recursive' is t."
     (apply 'message args)))
 
 ;;;###autoload
-(add-hook 'after-init-hook 'load-dirs)
+(add-hook 'after-init-hook
+          (lambda () (if (bound-and-true-p load-dirs) (load-dirs))))
 
 (provide 'load-dir)
 ;;; load-dir.el ends here

Reply via email to