Skip to content

Instantly share code, notes, and snippets.

@joelmccracken
Created September 21, 2011 19:57
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 joelmccracken/1233121 to your computer and use it in GitHub Desktop.
Save joelmccracken/1233121 to your computer and use it in GitHub Desktop.
(defun shell-cdcurr-cmd (shname cmd)
"starts a shell with given name, cd's to current directory, and runs cmd inside it"
(let ((curdir (current-buffer-directory)))
(save-excursion
(shell shname)
(insert (concat "cd " curdir)) (comint-send-input)
(insert cmd) (comint-send-input))))
(shell-cdcurr-cmd "rails-server" "rails s -p 3001 --debug")
;Debugger entered--Lisp error: (error "Marker does not point anywhere")
; ansi-color-apply-on-region(#<marker in no buffer> #<marker at 93 in rails-server>)
; ansi-color-process-output("")
; run-hook-with-args(ansi-color-process-output "")
; comint-send-input()
; (let ((curdir ...)) (shell shname) (insert (concat "cd " curdir "\n")) (insert cmd) (comint-send-input) (save-excursion))
; shell-cdcurr-cmd("rails-server" "rails s -p 3001 --debug")
; eval((shell-cdcurr-cmd "rails-server" "rails s -p 3001 --debug"))
; eval-last-sexp-1(nil)
; eval-last-sexp(nil)
; call-interactively(eval-last-sexp nil nil)
; recursive-edit()
; byte-code ("\306 @\307=\203!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment