aboutsummaryrefslogtreecommitdiffhomepage
path: root/dev/tools
diff options
context:
space:
mode:
authorGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-02-13 15:24:10 +0100
committerGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-02-13 15:33:28 +0100
commit9997f9aec01abdb59852ec5706ef36ce56311109 (patch)
tree20704854f50d433e0358e76aedb8b00165a2c79e /dev/tools
parent20e654c5b1995e04d103e099bc806d27f797b640 (diff)
coqdev.el: stop using when-let for emacs<25 compatibility.
Diffstat (limited to 'dev/tools')
-rw-r--r--dev/tools/coqdev.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/dev/tools/coqdev.el b/dev/tools/coqdev.el
index 31cde7584..20613a4cf 100644
--- a/dev/tools/coqdev.el
+++ b/dev/tools/coqdev.el
@@ -31,17 +31,15 @@
;;; Code:
-(require 'subr-x)
-
(defun coqdev-default-directory ()
"Return the Coq repository containing `default-directory'."
- (when-let ((dir (locate-dominating-file default-directory "META.coq")))
- (expand-file-name dir)))
+ (let ((dir (locate-dominating-file default-directory "META.coq")))
+ (when dir (expand-file-name dir))))
(defun coqdev-setup-compile-command ()
"Setup `compilate-command' for Coq development."
- (when-let ((dir (coqdev-default-directory)))
- (setq-local compile-command (concat "make -C " dir))))
+ (let ((dir (coqdev-default-directory)))
+ (when dir (setq-local compile-command (concat "make -C " dir)))))
(add-hook 'hack-local-variables-hook #'coqdev-setup-compile-command)
(defvar camldebug-command-name) ; from camldebug.el (caml package)
@@ -50,15 +48,18 @@
"Setup ocamldebug for Coq development.
Specifically `camldebug-command-name' and `ocamldebug-command-name'."
- (when-let ((dir (coqdev-default-directory)))
- (setq-local camldebug-command-name (concat dir "dev/ocamldebug-coq"))
- (setq-local ocamldebug-command-name (concat dir "dev/ocamldebug-coq"))))
+ (let ((dir (coqdev-default-directory)))
+ (when dir
+ (setq-local camldebug-command-name
+ (concat dir "dev/ocamldebug-coq"))
+ (setq-local ocamldebug-command-name
+ (concat dir "dev/ocamldebug-coq")))))
(add-hook 'hack-local-variables-hook #'coqdev-setup-camldebug)
(defun coqdev-setup-tags ()
"Setup `tags-file-name' for Coq development."
- (when-let ((dir (coqdev-default-directory)))
- (setq-local tags-file-name (concat dir "TAGS"))))
+ (let ((dir (coqdev-default-directory)))
+ (when dir (setq-local tags-file-name (concat dir "TAGS")))))
(add-hook 'hack-local-variables-hook #'coqdev-setup-tags)
(defvar coq-prog-args)
@@ -74,12 +75,14 @@ Specifically `camldebug-command-name' and `ocamldebug-command-name'."
"Setup Proofgeneral variables for Coq development.
Note that this function is executed before _Coqproject is read if it exists."
- (when-let ((dir (coqdev-default-directory)))
- (unless coq-prog-args ; In case there are file-local variables
- (setq coq-prog-args `("-coqlib" ,dir
- "-R" ,(concat dir "plugins") "Coq"
- "-R" ,(concat dir "theories") "Coq")))
- (setq-local coq-prog-name (concat dir "bin/coqtop"))))
+ (let ((dir (coqdev-default-directory)))
+ (when dir
+ (unless coq-prog-args
+ (setq coq-prog-args
+ `("-coqlib" ,dir "-R" ,(concat dir "plugins")
+ "Coq" "-R" ,(concat dir "theories")
+ "Coq")))
+ (setq-local coq-prog-name (concat dir "bin/coqtop")))))
(add-hook 'hack-local-variables-hook #'coqdev-setup-proofgeneral)
;; This Elisp snippet adds a regexp parser for the format of Anomaly