Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created December 14, 2011 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/1475099 to your computer and use it in GitHub Desktop.
Save hitode909/1475099 to your computer and use it in GitHub Desktop.
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