changeset 9443:5eaca32b6af6

(normal-top-level-add-to-load-path): New function. (normal-top-level): Load subdirs.el in each dir in load-path.
author Richard M. Stallman <rms@gnu.org>
date Tue, 11 Oct 1994 08:22:38 +0000
parents 973eafd9f349
children e21d4ebc3160
files lisp/startup.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Tue Oct 11 08:21:32 1994 +0000
+++ b/lisp/startup.el	Tue Oct 11 08:22:38 1994 +0000
@@ -160,10 +160,25 @@
 
 (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.