aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-10-11 08:22:38 +0000
committerRichard M. Stallman <[email protected]>1994-10-11 08:22:38 +0000
commite87a730999bf986dae66de6c4ac020efc40dd57d (patch)
tree48218a73e99b59e2ce167029e5d065caed2616af /lisp
parente4636528820a1c44a287199b85683aeb7d1871e6 (diff)
(normal-top-level-add-to-load-path): New function.
(normal-top-level): Load subdirs.el in each dir in load-path.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/startup.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index e71792f724..081b3aed12 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -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.