From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: update on missing :parameters in code blocks Date: Sun, 21 Sep 2014 18:31:10 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVpfN-0007T5-HT for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 18:31:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVpfF-000083-DZ for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 18:31:37 -0400 Received: from plane.gmane.org ([80.91.229.3]:48076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVpfF-00006O-7Y for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 18:31:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XVpf9-0005md-BA for emacs-orgmode@gnu.org; Mon, 22 Sep 2014 00:31:23 +0200 Received: from c-24-3-17-30.hsd1.pa.comcast.net ([24.3.17.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Sep 2014 00:31:23 +0200 Received: from jkitchin by c-24-3-17-30.hsd1.pa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Sep 2014 00:31: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 I did some more digging on the missing :parameters during export, and it seems that the src block itself is different during export than in the buffer. Below illustrates what I mean. In the buffer, if I look at the contents of the code block using output from org-element-at-point, it looks as I expect, with the complete header. But, using the same method in the export, it is clear that the header args are not there. I have not figured out where they disappear yet. * Bug report 2 for org-mode Here is a named table #+tblname: tbl-data | x | y | |---+---| | 1 | 1 | | 2 | 4 | | 3 | 9 | Here is a named src-block with a defined var #+name: print-table #+BEGIN_SRC python :var data=tbl-data :results value return data #+END_SRC Now, we illustrate that the src-block does have :parameters. #+name: get-properties #+BEGIN_SRC emacs-lisp (save-excursion (re-search-backward "#\\+name: print-table") (buffer-substring (org-element-property :begin (org-element-at-point)) (org-element-property :end (org-element-at-point)))) #+END_SRC #+RESULTS: get-properties : #+name: print-table : #+BEGIN_SRC python :var data=tbl-data :results value : return data : #+END_SRC : : In the export machinery, though it appears the src-block is not the same. #+BEGIN_SRC emacs-lisp :results output :exports none (defun my-src-block (src-block contents info) (princ (buffer-substring (org-element-property :begin src-block) (org-element-property :end src-block))) (org-export-format-code-default src-block info)) (org-export-define-derived-backend 'my-html 'html :translate-alist '((src-block . my-src-block))) (org-export-to-file 'my-html "custom-src-table-export.html") #+END_SRC #+RESULTS: #+begin_example #+name: print-table #+BEGIN_SRC python return data #+END_SRC #+name: get-properties #+BEGIN_SRC emacs-lisp (save-excursion (re-search-backward "#\\+name: print-table") (buffer-substring (org-element-property :begin (org-element-at-point)) (org-element-property :end (org-element-at-point)))) #+END_SRC #+end_example The parameters seem to be gone in the python block. -- ----------------------------------- John Kitchin http://kitchingroup.cheme.cmu.edu