Skip to content

Instantly share code, notes, and snippets.

@alexott
Created February 24, 2012 19:27
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 alexott/1903146 to your computer and use it in GitHub Desktop.
Save alexott/1903146 to your computer and use it in GitHub Desktop.
(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