From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao-Yong Jin Subject: Re: Literate Programming in Org-Mode Date: Fri, 22 Jun 2007 13:34:43 -0400 Message-ID: <878xabdhak.fsf@presario.homelinux.org> References: <87k5twey4y.fsf@leonardo.iesahin.net> 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 1I1n27-00048c-LH for emacs-orgmode@gnu.org; Fri, 22 Jun 2007 13:34:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1n25-00047a-KJ for emacs-orgmode@gnu.org; Fri, 22 Jun 2007 13:34:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1n25-00047W-HY for emacs-orgmode@gnu.org; Fri, 22 Jun 2007 13:34:53 -0400 Received: from serrano.cc.columbia.edu ([128.59.29.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I1n25-00064O-0R for emacs-orgmode@gnu.org; Fri, 22 Jun 2007 13:34:53 -0400 Received: from presario.homelinux.org (dyn-carl-202-52.dyn.columbia.edu [160.39.202.52]) (user=xj2106 mech=PLAIN bits=0) by serrano.cc.columbia.edu (8.13.7/8.13.6) with ESMTP id l5MHYlML013849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 22 Jun 2007 13:34:48 -0400 (EDT) In-Reply-To: <87k5twey4y.fsf@leonardo.iesahin.net> (Emre Sahin's message of "Fri\, 22 Jun 2007 19\:45\:33 +0300") 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 Emre Sahin writes: > [... Haskell literals ...] > > In Literate Haskell, program lines start with a >. If it's not used, > than the line is considered as a comment line, hence making org-mode > useful in folding, maintainin TODOs etc. (This message is already a > Literate Haskell program.) Currently, one can use Literate Haskell > major mode during compilation and writing codes and org-mode during > general overview for the program. Writing first the documentation and > pseudocode of the program in org-mode and then filling the "gaps" with > code may result in better programs. (You can see > http://www.haskell.org/onlinereport/literate.html for literate > comments in Haskell.) > > This can give an idea how org-mode can be employed for writing > programs. Developing some functionality to consider lines starting > with > (or any other character) as a code line and syntax highlighting > and feeding these to a compiler may ease things. Currently one can > switch back and forth to the language major mode and org-mode (or use > multiple major mode packs, but I didn't try them) but a support for > code lines (for any programming language) may result in one of the > best Literate Programming tools out there, I think. (Ability to use > LaTeX in org-mode already makes it very useful for LP.) > > I don't know if anybody considered this, but using org-mode as a > "super mode" for programming major modes seems a good idea. This certainly is very interesting. Probably org-mode can just ask other mode to deal with some specific marked-up text. In this Haskell case, line starting with '>' or lines sandwiched with \begin{code} main = print "We love org-mode!" \end{code} may play well with haskell-mode. Or as the case in C/C++, it may be feasible to make org-mode deal with comment lines, which is like /* org-mode region */, or better /* * This code doing nothing */ int main (void) { /* ** Show we love org-mode */ printf ("We love org-mode!\n"); /* ** Some thing useful One can put some useful code here. */ /* ** Tell shell we are happy She likes 0. */ return 0; } Probably it's too wild? Cheers, Xiao-Yong > > Best regards, > > Emre > Sorry Emre, I incidentally replied to your email. -- c/* __o/* <\ * (__ */\ <