]> git.eshelyaron.com Git - emacs.git/commitdiff
(normal-top-level-add-to-load-path): New function.
authorRichard M. Stallman <rms@gnu.org>
Tue, 11 Oct 1994 08:22:38 +0000 (08:22 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 11 Oct 1994 08:22:38 +0000 (08:22 +0000)
(normal-top-level): Load subdirs.el in each dir in load-path.

lisp/startup.el

index e71792f724fa285a161a4c41b7657107929cda1f..081b3aed126946c2db4cb874deb709a1521d9dc0 100644 (file)
@@ -160,10 +160,25 @@ specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
 
 (defvar init-file-had-error nil)
 
+;; This function is called from the subdirs.el file.
+(defun normal-top-level-add-to-load-path (dirs)
+  (let ((tail (member default-directory load-path)))
+    (setcdr tail (append (mapcar 'expand-file-name dirs) (cdr tail)))))
+
 (defun normal-top-level ()
   (if command-line-processed
       (message "Back to top level.")
     (setq command-line-processed t)
+    ;; Look in each dir in load-path for a subdirs.el file.
+    ;; If we find one, load it, which will add the appropriate subdirs
+    ;; of that dir into load-path,
+    (let ((tail load-path)
+         new)
+      (while tail
+       (setq new (cons (car tail) new))
+       (let ((default-directory (car tail)))
+         (load (expand-file-name "subdirs.el" (car tail)) t t t))
+       (setq tail (cdr tail))))
     (if (not (eq system-type 'vax-vms))
        (progn
          ;; If the PWD environment variable isn't accurate, delete it.