From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: linuxfever Newsgroups: gmane.emacs.help Subject: Re: Pipe bash file contents to shell Date: Thu, 30 Jun 2011 14:52:16 -0700 (PDT) Message-ID: <31968924.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309486070 1506 80.91.229.12 (1 Jul 2011 02:07:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 02:07:50 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 01 04:07:39 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcT8t-0008DX-Be for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jul 2011 04:07:39 +0200 Original-Received: from localhost ([::1]:50515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcT8r-0004l4-RQ for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jun 2011 22:07:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcP9m-00040T-Ly for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 17:52:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcP9l-0003rg-2y for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 17:52:18 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:50636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcP9k-0003rc-Qr for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 17:52:16 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QcP9k-000732-9b for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 14:52:16 -0700 X-Nabble-From: linuxfever@yahoo.gr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Thu, 30 Jun 2011 21:57:00 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81464 Archived-At: I managed to create a part of the lisp function as follows: (defun pipe-region-to-shell () (interactive) (process-send-string "shell" (format "cd %s\n" (file-name-directory (buffer-file-name)))) (process-send-region "shell" (region-beginning) (region-end))) The first line makes the shell go to the directory where the bash script is, and the second one sends the highlighted region to the shell. And all these happen in the background as I need. The only problem is that the function assumes that a buffer named "shell" exists. -- View this message in context: http://old.nabble.com/Pipe-bash-file-contents-to-shell-tp31963679p31968924.html Sent from the Emacs - Help mailing list archive at Nabble.com.