Created
February 24, 2012 19:27
-
-
Save alexott/1903146 to your computer and use it in GitHub Desktop.
example of code for http://stackoverflow.com/questions/9420270/how-to-define-an-alternate-command-for-emacs-eshell
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 string-join-accum (joiner strings accum) | |
(cond ((not strings) accum) | |
((not (cdr strings)) (concat accum (car strings))) | |
(t (string-join-accum joiner (cdr strings) | |
(concat accum (car strings) joiner))))) | |
(defun string-join (joiner strings) | |
(string-join-accum joiner strings "")) | |
(defun invoke-bash (command) | |
(let ((invoke-bash-cmd (concat "bash -c \"" command " " | |
(string-join " " eshell-last-arguments) "\""))) | |
(message invoke-bash-cmd) | |
(throw 'eshell-replace-command (eshell-parse-command invoke-bash-cmd)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment