Created
August 20, 2014 14:31
-
-
Save lamdor/73918608a373c1e7a3f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defun mine-command-line-tool (command &optional history history-symbol) | |
(let* ((rest-of-command (read-from-minibuffer (concat command " ") (car history) nil nil history-symbol)) | |
(command-with-args (append (split-string command) (split-string rest-of-command))) | |
(args (cdr command-with-args)) | |
(command (car command-with-args)) | |
(name (mapconcat 'identity command-with-args " ")) | |
(buffer-name (concat "*" name "*")) | |
(buffer (get-buffer-create buffer-name))) | |
(switch-to-buffer buffer) | |
(apply 'make-comint-in-buffer name buffer command nil args))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment