diff options
author | Hendrik Tews <hendrik@askra.de> | 2012-05-08 08:11:52 +0000 |
---|---|---|
committer | Hendrik Tews <hendrik@askra.de> | 2012-05-08 08:11:52 +0000 |
commit | 40c1ffb035da3c6c58e53e8190cce672e42283d3 (patch) | |
tree | 2e4c577409de920d3f62ea763561999c8df0c2bb /generic/proof-site.el | |
parent | 14f719f2b971f10d8d40c18301c77c7758de9198 (diff) |
Use proof-add-to-load-path to extend load-path. This way,
distributions with specific requirements (such as Debian with
debian-pkg-add-load-path-item) only need to patch one function.
Diffstat (limited to 'generic/proof-site.el')
-rw-r--r-- | generic/proof-site.el | 22 |
1 files changed, 17 insertions, 5 deletions
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)))))) |