Created
October 29, 2012 15:30
-
-
Save jorgenschaefer/3974192 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 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