Skip to content

Instantly share code, notes, and snippets.

@jorgenschaefer
Created October 29, 2012 15:30
Show Gist options
  • Select an option

  • Save jorgenschaefer/3974192 to your computer and use it in GitHub Desktop.

Select an option

Save jorgenschaefer/3974192 to your computer and use it in GitHub Desktop.
(defun fc/comint-send-as-input (buffer input)
"Send INPUT to the comint process in BUFFER."
(with-current-buffer buffer
(let* ((process (get-buffer-process buffer))
(beg (process-mark process))
(end (point-max))
(old (buffer-substring beg end)))
(delete-region beg end)
(goto-char beg)
(insert input)
(comint-send-input)
(insert old))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment