diff options
-rw-r--r-- | generic/proof-auxmodes.el | 6 | ||||
-rw-r--r-- | generic/proof-site.el | 22 | ||||
-rw-r--r-- | lib/pg-dev.el | 10 |
3 files changed, 27 insertions, 11 deletions
diff --git a/generic/proof-auxmodes.el b/generic/proof-auxmodes.el index 20ced2a4..a6f06479 100644 --- a/generic/proof-auxmodes.el +++ b/generic/proof-auxmodes.el @@ -23,10 +23,8 @@ (or (featurep 'mmm-auto) (progn ;; put bundled version on load path - (setq load-path - (cons - (concat proof-home-directory "contrib/mmm/") - load-path)) + (proof-add-to-load-path + (concat proof-home-directory "contrib/mmm/")) ;; *should* always succeed unless bundled version broken (proof-try-require 'mmm-auto))) ;; Load prover-specific config in <foo>-mmm.el diff --git a/generic/proof-site.el b/generic/proof-site.el index 1e313f99..47fa651a 100644 --- a/generic/proof-site.el +++ b/generic/proof-site.el @@ -138,9 +138,22 @@ You can use customize to set this variable." :type 'directory :group 'proof-general-internals) -;; Extend load path for the generic and library files. -(add-to-list 'load-path (concat proof-home-directory "generic/")) -(add-to-list 'load-path (concat proof-home-directory "lib/")) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; load path. Have one function that adds elements to load-path. +;; Distributions having specific requirements (such as using +;; debian-pkg-add-load-path-item on Debian) only need to change +;; this function. +;; + +(defun proof-add-to-load-path (dir) + "Add DIR to `load-path' if not contained already" + (add-to-list 'load-path dir)) + +(proof-add-to-load-path (concat proof-home-directory "generic/")) +(proof-add-to-load-path (concat proof-home-directory "lib/")) + ;; Declare some global variables and autoloads @@ -277,8 +290,7 @@ If ASSISTANT-NAME is omitted, look up in `proof-assistant-table'." (setq proof-mode-for-goals (proof-ass-sym goals-mode)) (setq proof-mode-for-script (proof-ass-sym mode)) ;; Extend the load path if necessary - (if (not (member ,loadpath-elt load-path)) - (setq load-path (cons ,loadpath-elt load-path))) + (proof-add-to-load-path ,loadpath-elt) ;; Run hooks for late initialisation (run-hooks 'proof-ready-for-assistant-hook)))))) diff --git a/lib/pg-dev.el b/lib/pg-dev.el index b791b155..1d1c0e66 100644 --- a/lib/pg-dev.el +++ b/lib/pg-dev.el @@ -16,6 +16,12 @@ (require 'whitespace) +(eval-when-compile + (require 'cl)) + +(eval-when (compile) + (require 'proof-site)) + (with-no-warnings (setq proof-general-debug t)) @@ -77,8 +83,8 @@ (defun pg-loadpath () (interactive) - (add-to-list 'load-path "../generic/") - (add-to-list 'load-path "../lib/")) + (proof-add-to-load-path "../generic/") + (proof-add-to-load-path "../lib/")) ;;; |