aboutsummaryrefslogtreecommitdiff
path: root/generic/proof-utils.el
diff options
context:
space:
mode:
Diffstat (limited to 'generic/proof-utils.el')
-rw-r--r--generic/proof-utils.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el
index 531b7fa0..24988a7c 100644
--- a/generic/proof-utils.el
+++ b/generic/proof-utils.el
@@ -15,6 +15,39 @@
;;
(require 'proof-site) ; basic vars
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Give Emacs version mismatch error here.
+;;
+;; This file is loaded early, and may be first compiled file
+;; loaded if proof-site.el is loaded instead of proof-site.elc.
+;;
+(eval-and-compile
+ (defun pg-emacs-version-cookie ()
+ (format (if (string-match "XEmacs" emacs-version)
+ ;; (featurep 'xemacs) gets optimised!!
+ "XEmacs %d.%d" "GNU Emacs %d.%d")
+ emacs-major-version emacs-minor-version))
+
+ (defconst pg-compiled-for
+ (eval-when-compile (pg-emacs-version-cookie))
+ "Version of Emacs we're compiled for (or running on, if interpreted)."))
+
+(if (or (not (boundp 'emacs-major-version))
+ (< emacs-major-version 21))
+ (error "Proof General is not compatible with Emacs %s" emacs-version))
+
+(unless (equal pg-compiled-for (pg-emacs-version-cookie))
+ (error
+ "Proof General was compiled for %s but running on %s: please run \"make clean; make\""
+ pg-compiled-for (pg-emacs-version-cookie)))
+
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
(require 'proof-compat) ; for pg-defface-window-systems
(require 'proof-config) ; config vars
(require 'bufhist) ; bufhist