X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fsetup-paths.el;h=d22ba462edca32e9b7dc77f972a7782038881712;hb=f1224784443572967e8ccad31c0b3f05608f8099;hp=4b365efe805ca8dc1dbfe456c1c9343f5ae7ea9a;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/lisp/setup-paths.el b/lisp/setup-paths.el index 4b365ef..d22ba46 100644 --- a/lisp/setup-paths.el +++ b/lisp/setup-paths.el @@ -38,14 +38,21 @@ ;;; Code: -(defvar paths-load-path-depth 1 +(defvar paths-core-load-path-depth 1 "Depth of load-path searches in core Lisp paths.") +(defvar paths-site-load-path-depth 1 + "Depth of load-path searches in site Lisp paths.") + (defvar paths-default-info-directories - (list (paths-construct-path '("usr" "local" "info") - (char-to-string directory-sep-char)) - (paths-construct-path '("usr" "info") - (char-to-string directory-sep-char))) + (mapcar (function + (lambda (dirlist) + (paths-construct-path + dirlist (char-to-string directory-sep-char)))) + '(("usr" "local" "info") + ("usr" "info") + ("usr" "local" "share" "info") + ("usr" "share" "info"))) "Directories appended to the end of the info path by default.") (defun paths-find-site-lisp-directory (roots) @@ -54,12 +61,23 @@ nil configure-site-directory)) +(defun paths-find-site-module-directory (roots) + "Find the site modules directory of the XEmacs hierarchy." + (paths-find-site-directory roots "site-modules" + nil + configure-site-module-directory)) + (defun paths-find-lisp-directory (roots) "Find the main Lisp directory of the XEmacs hierarchy." (paths-find-version-directory roots "lisp" nil configure-lisp-directory)) +(defun paths-find-module-directory (roots) + "Find the main modules directory of the XEmacs hierarchy." + (paths-find-architecture-directory roots "modules" + nil configure-module-directory)) + (defun paths-construct-load-path (roots early-package-load-path late-package-load-path last-package-load-path lisp-directory @@ -72,11 +90,11 @@ (site-lisp-load-path (and site-lisp-directory (paths-find-recursive-load-path (list site-lisp-directory) - paths-load-path-depth))) + paths-site-load-path-depth))) (lisp-load-path (and lisp-directory (paths-find-recursive-load-path (list lisp-directory) - paths-load-path-depth)))) + paths-core-load-path-depth)))) (append env-load-path early-package-load-path site-lisp-load-path @@ -84,6 +102,25 @@ lisp-load-path last-package-load-path))) +(defun paths-construct-module-load-path + (root module-directory &optional site-module-directory) + "Construct the modules load path." + (let* ((envvar-value (getenv "EMACSMODULEPATH")) + (env-module-path + (and envvar-value + (paths-decode-directory-path envvar-value 'drop-empties))) + (site-module-load-path + (and site-module-directory + (paths-find-recursive-load-path (list site-module-directory) + paths-site-load-path-depth))) + (module-load-path + (and module-directory + (paths-find-recursive-load-path (list module-directory) + paths-core-load-path-depth)))) + (append env-module-path + site-module-load-path + module-load-path))) + (defun paths-construct-info-path (roots early-packages late-packages last-packages) "Construct the info path." (let ((info-path-envval (getenv "INFOPATH"))) @@ -107,28 +144,12 @@ (defun paths-find-doc-directory (roots) "Find the documentation directory." - (paths-find-architecture-directory roots "lib-src")) - -(defun paths-find-lock-directory (roots) - "Find the lock directory." - (defvar configure-lock-directory) - (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory)) - -(defun paths-find-superlock-file (lock-directory) - "Find the superlock file." - ;; #### There is no such variable configure-superlock-file! - (cond - ((null lock-directory) - nil) - ((and configure-superlock-file - (file-directory-p (file-name-directory configure-superlock-file))) - configure-superlock-file) - (t - (expand-file-name "!!!SuperLock!!!" lock-directory)))) + (paths-find-architecture-directory roots "lib-src" nil configure-doc-directory)) (defun paths-find-exec-directory (roots) "Find the binary directory." - (paths-find-architecture-directory roots "lib-src" configure-exec-directory)) + (paths-find-architecture-directory roots "lib-src" + nil configure-exec-directory)) (defun paths-construct-exec-path (roots exec-directory early-packages late-packages last-packages)