aboutsummaryrefslogtreecommitdiffhomepage
path: root/.dir-locals.el
diff options
context:
space:
mode:
authorGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-10-23 12:31:28 +0000
committerGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-10-23 12:31:28 +0000
commit40b00efff7e47b22c80c677514f9d689c918383c (patch)
treecab9f53cefe0e9e5ef04fc643f5d20cdaf2576fc /.dir-locals.el
parent06a07009d7b83fa924ca3e30f6335fba1288c370 (diff)
the new .dir-locals.el thanks to Pierre Courtieu
As it says : Set default directory to coq root ONLY IF variable coq-project-find-file is non nil. This should remain a user preference and not be set by default. This setting is redundant with compile-command above as M-x compile always CD's to default directory. To enable it add this to your emacs config: (setq coq-project-find-file t) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15924 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to '.dir-locals.el')
-rw-r--r--.dir-locals.el39
1 files changed, 31 insertions, 8 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 1de1655dd..092973c39 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,8 +1,31 @@
-((nil . ((eval . (setq default-directory (locate-dominating-file
- buffer-file-name
- ".dir-locals.el")
- tags-file-name (concat default-directory
- "TAGS")
- camldebug-command-name (concat
- default-directory "dev/ocamldebug-coq")
-))))) \ No newline at end of file
+;; EMACS CONFIGURATION FOR COQ DEVELOPPERS This configuration will be
+;; executed for each opened file under coq root directory.
+((nil
+ . ((eval
+ . (progn
+ ;; coq root directory (ending with slash)
+ (let ((coq-root-directory (locate-dominating-file buffer-file-name
+ ".dir-locals.el"))
+ (coq-project-find-file
+ (and (boundp 'coq-project-find-file) coq-project-find-file)))
+ ;; coq tags file and coq debugger executable
+ (setq tags-file-name (concat coq-root-directory "TAGS")
+ camldebug-command-name (concat coq-root-directory
+ "dev/ocamldebug-coq"))
+
+ ;; Setting the compilation directory to coq root. This is
+ ;; mutually exclusive with the setting of default-directory
+ ;; below.
+ (unless coq-project-find-file
+ (setq compile-command (concat "make -C " coq-root-directory)))
+
+ ;; Set default directory to coq root ONLY IF variable
+ ;; coq-project-find-file is non nil. This should remain a
+ ;; user preference and not be set by default. This setting
+ ;; is redundant with compile-command above as M-x compile
+ ;; always CD's to default directory. To enable it add this
+ ;; to your emacs config: (setq coq-project-find-file t)
+ (when coq-project-find-file
+ (setq default-directory coq-root-directory))))
+ ))
+ ))