From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [BABEL] Editing dot blocks with org-exp-blocks Date: Wed, 09 Feb 2011 16:14:41 +0000 Message-ID: References: <87hbcd1t94.fsf@pinto.chemeng.ucl.ac.uk> <87k4h9xpro.fsf@pinto.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=46703 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnCgu-0005nr-7J for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 11:14:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnCgr-0001U9-T1 for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 11:14:51 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:42563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnCgr-0001Tt-LR for emacs-orgmode@gnu.org; Wed, 09 Feb 2011 11:14:49 -0500 Received: by wyj26 with SMTP id 26so352420wyj.0 for ; Wed, 09 Feb 2011 08:14:49 -0800 (PST) In-Reply-To: (Chris Maier's message of "Wed, 9 Feb 2011 10:39:01 -0500") 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: Chris Maier Cc: emacs-orgmode Chris Maier writes: > I fixed my problem... had to dig around in the source of ob-dot.el, > though, since it doesn't appear to be on the website [1]. There are > some additional undocumented header parameters that ob-dot adds to the > standard Babel params. > > With org-exp-blocks you do this: > > #+begin_dot foo.png -Tpng > ... dot code ... > #+end_dot > > With plain old Babel, you do this: > > #+begin_src dot :file foo.png :cmdline -Tpng > ... dot code ... > #+end_src > > Knowing this now, I'd argue for deprecating org-exp-blocks, too. > > Now my question changes slightly. With the src block configured as > above, I can export and execute the code fine, but when I type C-c ' > to edit the Dot code in a separate buffer, it goes into fundamental > mode, even though I have graphviz-dot-mode [2] installed and working > fine. I suspect it might be because it's called "graphviz-dot-mode" > instead of just "dot-mode" (that's just speculation on my part, > though). > > Is there a way to explicitly associate an major mode with a particular > kind of language block? Hi Chris, Yes, see the variable org-src-lang-modes. Use customize, or something like this: #+begin_src emacs-lisp (aput 'org-src-lang-modes "dot" 'graphviz-dot) #+end_src (Elisp question: I can't remember why we don't use aput in org-mode? What's the idiomatic org way of doing that? This #+begin_src emacs-lisp (setq org-src-lang-modes (append '(("dot" . graphviz-dot)) (delq (assoc "dot" org-src-lang-modes) org-src-lang-modes))) #+end_src doesn't work if there's already more than one entry for "dot") Dan > > Thanks, > Chris > > [1] http://orgmode.org/worg/org-contrib/babel/languages.html > [2] http://users.skynet.be/ppareit/projects/graphviz-dot-mode/graphviz-do= t-mode.html > > On Wed, Feb 9, 2011 at 10:14 AM, Dan Davison wrot= e: >> Eric S Fraga writes: >> >>> Chris Maier writes: >>> >>>> The begin_dot is part of org-exp-blocks, as I understand it, and >>>> appears required to make it evaluate the Dot code, create the image >>>> file, and then incorporate that into the exported document (LaTeX, >>>> HTML, etc.) >>>> >>>> Thanks, >>>> Chris >>>> >>>> On Wed, Feb 9, 2011 at 3:56 AM, Eric S Fraga wrote: >>>>> Chris Maier writes: >>>>> >>>>>> In "normal" Org code blocks (e.g. #+begin_src clojure .... #+end_src) >>>>>> it's possible to hit C-c ' and edit the block code in a separate >>>>>> buffer with the appropriate mode. =C2=A0This doesn't appear to work = when >>>>>> using org-exp-blocks to edit a "begin_dot" block. >>>>>> >>>>>> Is there a command to do this? >>>>> >>>>> No idea but what about using #+begin_src dot ... #+end_src? >>>>> -- >>>>> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 >>>>> : using Org-mode version 7.4 (release_7.4.324.gca7a) >>>>> >>> >>> Yes, I know; I used to use begin_dot and begin_ditaa quite a bit. =C2= =A0My >>> understanding is that babel knows about dot and therefore provides the >>> same functionality, albeit in a different way, >> >> I vote for removing / deprecating the dot and ditaa functionality of >> org-exp-blocks. >> >> >>> possibly more confusing >>> but definitely more customisable and hence more powerful. =C2=A0babel g= ives >>> you access to features such as fontification, mode specific editing, >>> caching. >>> >>> I am not sure what the intended long term development for these special >>> export blocks might be? =C2=A0org's long term growth (development of >>> features) is organic and responsive, not planned per se (and I mean this >>> in a positive way as planned software projects seldom achieve their >>> goals...) =C2=A0so it may be that nobody can answer this question! >>> >>> In any case, I didn't mean to imply that you cannot continue using these >>> specific export blocks or that they don't do the job they were intended >>> for. =C2=A0Simply that maybe babel is the route to go if you want to be= able >>> to use mode specific editing. >> > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode