From 0730f1e1acefd0345cb5e0eab6dbe696397d5723 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 1 May 2022 09:21:51 -0500 Subject: Add +compile-dispatch At some point I probably should add a +recompile .. or something, I'm not sure how the compile flow works in Emacs. --- init.el | 2 ++ lisp/+compile.el | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lisp/+compile.el diff --git a/init.el b/init.el index a19b517..524fdce 100644 --- a/init.el +++ b/init.el @@ -264,6 +264,8 @@ (:option diary-file (private/ "diary"))) (setup compile + (:require +compile) + (:+key "" #'+compile-dispatch) (:option compilation-always-kill t compilation-ask-about-save nil compilation-scroll-output t)) diff --git a/lisp/+compile.el b/lisp/+compile.el new file mode 100644 index 0000000..b20ae4d --- /dev/null +++ b/lisp/+compile.el @@ -0,0 +1,19 @@ +;;; +compile.el --- Extras for compile -*- lexical-binding: t; -*- + +;;; Commentary: + +;;; Code: + +(defcustom +compile-function nil + "Function to run to \"compile\" a buffer." + :type 'function + :local t) + +(defun +compile-dispatch (&optional arg) + "Run `+compile-function', if bound, or `compile'. +Any prefix ARG is passed to that function." + (interactive "P") + (call-interactively (or +compile-function #'compile))) + +(provide '+compile) +;;; +compile.el ends here -- cgit 1.4.1-21-gabe81