all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sayth Renshaw <flebber.crue@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: select a section of text and run it into another process?
Date: Wed, 1 Apr 2015 04:16:28 -0700 (PDT)	[thread overview]
Message-ID: <84f3539d-ac50-4217-be7f-48d42b22e6a5@googlegroups.com> (raw)
In-Reply-To: <c3ad0973-0926-4449-a7c8-d1076a6c8ec2@googlegroups.com>

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



  parent reply	other threads:[~2015-04-01 11:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-04-01 12:08   ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84f3539d-ac50-4217-be7f-48d42b22e6a5@googlegroups.com \
    --to=flebber.crue@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.