unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* select a section of text and run it into another process?
@ 2015-03-31 11:15 Sayth Renshaw
  2015-03-31 12:10 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sayth Renshaw @ 2015-03-31 11:15 UTC (permalink / raw)
  To: help-gnu-emacs

My emacs is going well, but something I would like to be able to do is run a section of code in a file and send it to an eshell process of python/ipython to evaluated.

How do I do this, I am not sure how to select the text without using the mouse, there are a lot of people guessing on this SO question (http://stackoverflow.com/questions/657672/how-to-select-or-highlight-a-block-in-emacs) but can anyone provide a solid answer? 

In the emacs manual it shows this article for sending to process http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-to-Processes.html

which means I assume I could make a keybinding adaption if this

(process-send-string "shell<1>" "ls\n")

(process-send-string "eshell<ipython>" "some version of selected text")

Any ideas or is there a plugin that already does this? I would like to be able to do this with multiple file types but python is where I am starting.

Thanks

Sayth


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-01 14:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31 11:15 select a section of text and run it into another process? Sayth Renshaw
2015-03-31 12:10 ` Eli Zaretskii
2015-03-31 16:02 ` Barry Margolin
2015-04-01  8:15   ` Sayth Renshaw
2015-04-01 14:30     ` Eli Zaretskii
2015-04-01  8:20   ` Sayth Renshaw
2015-04-01 11:16 ` Sayth Renshaw
2015-04-01 12:08   ` Eric Abrahamsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).