all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>, help-gnu-emacs@gnu.org
Subject: Re: Evaluating python code blocks in python-mode
Date: Sun, 21 Jun 2015 18:18:06 +0200	[thread overview]
Message-ID: <5586E3BE.8080502@thregr.org> (raw)
In-Reply-To: <558657BE.5090207@easy-emacs.de>

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.




  parent reply	other threads:[~2015-06-21 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 10:50 Evaluating python code blocks in python-mode Yuri D'Elia
2015-06-20 19:09 ` Andreas Röhler
2015-06-21  6:20   ` Andreas Röhler
2015-06-21 16:17     ` Yuri D'Elia
2015-06-21 16:18     ` Yuri D'Elia [this message]
2015-06-21 16:35       ` Yuri D'Elia
2015-06-21 18:52         ` Andreas Röhler
2015-06-25 10:25           ` Yuri D'Elia
2015-06-25 10:25           ` Yuri D'Elia
2015-06-25 11:21             ` Andreas Röhler
2015-06-25 12:33               ` Yuri D'Elia

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=5586E3BE.8080502@thregr.org \
    --to=wavexx@thregr.org \
    --cc=andreas.roehler@easy-emacs.de \
    --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.