From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: Re: [babel] demonstration mode-switching between code blocks Date: Wed, 4 Nov 2009 10:42:30 +0000 Message-ID: <20091104104230.GK32187@atlantic.linksys.moosehall> References: <200911041503.51029.torsten.wagner@googlemail.com> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5dK4-0001BQ-6S for emacs-orgmode@gnu.org; Wed, 04 Nov 2009 05:42:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5dJy-00019N-85 for emacs-orgmode@gnu.org; Wed, 04 Nov 2009 05:42:38 -0500 Received: from [199.232.76.173] (port=33107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5dJy-00019I-4s for emacs-orgmode@gnu.org; Wed, 04 Nov 2009 05:42:34 -0500 Received: from arctic.adamspiers.org ([212.13.194.176]:54927) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5dJx-00017X-Qu for emacs-orgmode@gnu.org; Wed, 04 Nov 2009 05:42:33 -0500 Received: from localhost (dsl-217-155-199-114.zen.co.uk [217.155.199.114]) by arctic.adamspiers.org (Postfix) with ESMTP id A0B732401C for ; Wed, 4 Nov 2009 10:42:32 +0000 (UTC) Content-Disposition: inline In-Reply-To: <200911041503.51029.torsten.wagner@googlemail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Torsten Wagner (torsten.wagner@gmail.com) wrote: > Hi everybody, > > Abstract: This is a very quick (and I assume very dirty) hack, how to switch > between org-mode and any other mode which you like to use in the source code > blocks. It is far from being addable to org-babel yet but might be a good > starting point. [snipped] > Solution: I found on emacs-wiki the minor-mode two-mode-mode.el [1] from David > N. Welton. I was able to modify it with a minimum to allow switching between > org-mode and python-mode. However, other (multiple) modes should be possible > as well. Thanks for sharing. Just for reference, there are few major modes out there implementing this kind of approach: http://www.emacswiki.org/emacs/MultipleModes For example I have used mmm-mode to good effect in the past, to auto-switch between HTML and Perl: http://mmm-mode.sourceforge.net/