diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-05-10 08:52:16 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-05-10 17:52:16 -0700 |
commit | e8436e8603924a11cf311d03b0f220998fa33175 (patch) | |
tree | f2ad047a3649a38f6c79c2f581c84ad9e1fc6d54 /.emacs.d | |
parent | 58de1ee32de6e2e14796d64a3baff71514859849 (diff) | |
download | dotfiles-e8436e8603924a11cf311d03b0f220998fa33175.tar.gz |
replace spw/compile-or-maybe-recompile with mode-local binding
I don't use the `recompile' support, so can rely on just this and C-x p c.
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/init.el | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 5831168f..a8885f86 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1724,24 +1724,6 @@ The ideas behind these behaviours are as follows. nil (expand-file-name "~/doc"))) (global-set-key "\C-cog" #'spw/git-grep-docs) -;; For safety we shouldn't have a key bound to `recompile', so have this. -;; Complements C-x p c, for the case where we want to compile an individual -;; file with a custom `compile-command', like my papers typeset with pandoc. -(defun spw/compile-or-maybe-recompile () - (interactive) - (if-let ((compilation-windows - (cl-remove-if-not (lambda (window) - (with-current-buffer (window-buffer window) - (eq major-mode 'compilation-mode))) - (window-list)))) - (with-current-buffer (window-buffer (car compilation-windows)) - (call-interactively 'recompile)) - ;; (delete-other-windows) - (call-interactively 'compile))) -(spw/feature-define-keys - ((nil prog-mode-map) (nil special-mode-map) (esh-mode eshell-mode-map)) - "\C-z\C-c" spw/compile-or-maybe-recompile) - ;; this is called by .dir-locals.el in ~/doc/{pres,papers} (defun spw/set-pandoc-compile-command (&rest exts) (setq-local compile-command @@ -1754,7 +1736,8 @@ The ideas behind these behaviours are as follows. "." ext))) (or exts '("pdf")) - " ")))) + " "))) + (local-set-key "\C-z\C-c" #'compile)) (defun spw/all-programming-projects () (call-process "src-register-all") |