From 0650cbd359b64d086de091548ff88fa70b0c5e29 Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Wed, 30 Apr 2014 16:19:23 -0700 Subject: [PATCH] Check Emacs version at start I ran into this when I tried to use ghc-mod with Emacs 24.2, and got a mysterious error telling me that defvar-local was not defined. --- elisp/ghc.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/elisp/ghc.el b/elisp/ghc.el index 75043e5..50b3146 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -20,6 +20,14 @@ ;;; Code: +;; defvar-local was introduced in 24.3 +(let* ((major 24) + (minor 3)) + (if (or (< emacs-major-version major) + (and (= emacs-major-version major) + (< emacs-minor-version minor))) + (error "ghc-mod requires at least Emacs %d.%d" major minor))) + (defconst ghc-version "4.1.0") ;; (eval-when-compile