help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: select a section of text and run it into another process?


From: Sayth Renshaw
Subject: Re: select a section of text and run it into another process?
Date: Wed, 1 Apr 2015 04:16:28 -0700 (PDT)
User-agent: G2/1.0

On Tuesday, 31 March 2015 22:16:00 UTC+11, Sayth Renshaw  wrote:
> 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

Actually  think I found a solution there a some modes python.el already has an 
implementation.

There is isend-mode http://showterm.io/2b2a4b6759004598de4ee#slow which can be 
configured for any language. https://github.com/ffevotte/isend-mode.el



reply via email to

[Prev in Thread] Current Thread [Next in Thread]