Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
quickrun.elをcompileで動かすやつ
;; 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