From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: (Maybe) enhance `org-element-src-block-interpreter'? Date: Wed, 06 Aug 2014 10:19:02 +0200 Message-ID: <87fvha81zd.fsf@gmail.com> References: <87tx5qvrl4.fsf@gmail.com> <87oavywal0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEwRg-00026j-AW for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEwRY-0001gv-Qf for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:19:40 -0400 Received: from plane.gmane.org ([80.91.229.3]:33620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEwRY-0001gp-KK for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:19:32 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XEwRP-00074g-Oj for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 10:19:23 +0200 Received: from g231111166.adsl.alicedsl.de ([92.231.111.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 10:19:23 +0200 Received: from tjolitz by g231111166.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 10:19:23 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Aaron Ecay writes: > Hi Thorsten, > > 2014ko abuztuak 5an, Thorsten Jolitz-ek idatzi zuen: > > [...] > >> >> Parse this src-block (with point at beg of block): >> >> ,---- >> | M-: (setq ptree (org-element-at-point)) >> `---- >> >> #+header: :results raw >> #+begin_src emacs-lisp >> (message "hello world") >> #+end_src >> >> #+results: >> hello world >> >> Then evaluate >> >> #+begin_src emacs-lisp >> (org-element-src-block-interpreter ptree nil) >> #+end_src >> >> #+results: >> : #+BEGIN_SRC emacs-lisp >> : (message "hello world") >> : #+END_SRC >> >> #+begin_src emacs-lisp >> (tj/src-block-interpreter ptree nil) >> #+end_src >> >> #+results: >> : #+HEADER: :results raw >> : #+BEGIN_SRC emacs-lisp >> : (message "hello world") >> : #+END_SRC > > Indeed this seems like an improvement on the status quo. But other > elements of org syntax (not just src blocks) can have a valid #+header > (and indeed other affiliated keywords, like #+attr_latex), so the fix > probably should be more general. Yes, there are other elements and more affiliated keywords. The parser (or rather the interpreter(s)) and parts of Org Babel do not always deal with them yet. This was more a 'constructive bug report', not so much an attempt of a general fix. I just (partly) fixed this function for myself because I needed it ... -- cheers, Thorsten