spot/.dir-locals.el
Alexandre Duret-Lutz 5f564c2b45 emacs config: Make C-c C-c execute the current test through ./run
* .dir-locals.el: Redefine C-c C-c in sh-mode and python-mode for
the tests/ subdirectory.c
* HACKING: Mention it.
2017-03-28 21:34:40 +02:00

19 lines
1,002 B
EmacsLisp

((nil . ((whitespace-action auto-cleanup)
(whitespace-style face empty trailing lines-tail)
(require-final-newline . t)
(mode . global-whitespace)
(magit-branch-adjust-remote-upstream-alist ("origin/next" . "/"))))
(c++-mode . ((c-default-style . "gnu")
(indent-tab-mode . t)
(tab-width . 8)
(fill-column . 70)))
("tests" . ((nil . ((eval . (defun spot/execute-test ()
"execute the current file through ../run"
(interactive)
(shell-command (concat "cd ..; ./run "
(buffer-file-name)
" &"))))))
(sh-mode . ((eval . (local-set-key
(kbd "C-c C-c") #'spot/execute-test))))
(python-mode . ((eval . (local-set-key (kbd "C-c C-c")
#'spot/execute-test)))))))