quickrun.elをcompileで動かすやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; quickrun.elをcompileで動かすやつ | |
(defun my-quickrun () | |
"Run commands quickly for current buffer" | |
(interactive) | |
(quickrun-common (point-min) (point-max))) | |
(defun my-quickrun-common (start end) | |
(let* ((src (file-name-nondirectory (buffer-file-name))) | |
(lang (quickrun/decide-file-type src)) | |
(cmd-key (or (and current-prefix-arg (quickrun/prompt)) | |
quickrun-option-cmdkey | |
(quickrun/get-command-key lang) | |
(quickrun/prompt))) | |
(cmd-info-hash (save-excursion (quickrun/fill-templates cmd-key src)))) | |
(setq quickrun-last-lang cmd-key) | |
(unless quickrun/compile-only-flag | |
(compile (gethash :exec cmd-info-hash))))) | |
(defun my-quickrun-with-arg (arg) | |
"Run commands quickly for current buffer with arguments" | |
(interactive | |
(list (read-string "QuickRun Arg: "))) | |
(let ((quickrun-option-args arg)) | |
(my-quickrun))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment