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.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-28 21:24:39 +02:00
parent e86964fe81
commit 5f564c2b45
2 changed files with 36 additions and 1 deletions

View file

@ -6,4 +6,14 @@
(c++-mode . ((c-default-style . "gnu")
(indent-tab-mode . t)
(tab-width . 8)
(fill-column . 70))))
(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)))))))