From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri D'Elia Newsgroups: gmane.emacs.help Subject: Re: Evaluating python code blocks in python-mode Date: Sun, 21 Jun 2015 18:18:06 +0200 Message-ID: <5586E3BE.8080502@thregr.org> References: <5585BA55.8090205@easy-emacs.de> <558657BE.5090207@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1434903521 20363 80.91.229.3 (21 Jun 2015 16:18:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2015 16:18:41 +0000 (UTC) To: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 18:18:36 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z6hx4-00053z-6i for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 18:18:34 +0200 Original-Received: from localhost ([::1]:36743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6hx3-0007Q5-IQ for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 12:18:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6hwn-0007Pn-Py for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 12:18:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6hwh-0005D1-LD for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 12:18:17 -0400 Original-Received: from e.thregr.org ([80.68.88.20]:43218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6hwh-0005By-FL for help-gnu-emacs@gnu.org; Sun, 21 Jun 2015 12:18:11 -0400 Original-Received: from [2a02:27e8:20:9049:8edc:d4ff:fed6:5d5b] by e.thregr.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.85) (envelope-from ) id 1Z6hwd-0003xs-6Q; Sun, 21 Jun 2015 18:18:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 Original-Newsgroups: gmane.emacs.help In-Reply-To: <558657BE.5090207@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 80.68.88.20 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:105060 Archived-At: On 06/21/2015 08:20 AM, Andreas Röhler wrote: >> IIUC in question are arbitrary chunks of code. >> What about something like that: <...> > > (defun py-send-section () > (interactive) > (save-excursion > (let ((start (progn (unless (looking-at py-section-start) > (search-backward py-section-start) > (point))))) > (if (and (looking-at py-section-start)(search-forward > py-section-end)) > (py-execute-region start (point)) > (error "Can't see boundaries of py-section"))))) Yes, this is what I had in mind, however I was hoping there was a more general established approach for this sort of thing. Since I'm also using many other languages with an interpreter (ess-mode, tuareg to mention two that I regularly use), I'd like a general approach. For example, if we change py-section-start/end to use syntax-table, we can define a general approach to defining code "chunks" using delimited comments. I was hoping there was already a global minor mode that does something similar to delimit code chunks.