Skip to content

Instantly share code, notes, and snippets.

@lagagain
Created November 19, 2018 16:33
Show Gist options
  • Save lagagain/e98ee7052b073549e7f0a437ceaa9ee6 to your computer and use it in GitHub Desktop.
Save lagagain/e98ee7052b073549e7f0a437ceaa9ee6 to your computer and use it in GitHub Desktop.
[practice] emacs elisp send-regrion-to-term
(defun send-region-to-term nil
(interactive)
(send-string "*terminal*" (buffer-substring-no-properties (region-beginning) (region-end)))
(send-string "*terminal*" "\n"))
(local-set-key (kbd "C-c C-r")
'send-region-to-term)
;;; try
(term "/bin/bash") ;; open *terminal*
;; send under string to *termianl* with C-c C-r or M-x send-region-to-term
python3
print ("Hello")
exit ()
@lagagain
Copy link
Author

A good place for learning elisp site: elisp learning

@lagagain
Copy link
Author

lagagain commented Dec 4, 2018

more complete project at send-term

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment