emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: [babel] Order of definition of :var makes or breaks the results [8.2.5f (release_8.2.5f-545-g630096 @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)]
@ 2014-01-21 14:17 Rainer M Krug
  2014-01-22 19:55 ` Rainer M Krug
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer M Krug @ 2014-01-21 14:17 UTC (permalink / raw)
  To: emacs-orgmode

Depending on the order in which variables are declared, the definitions
are correct or wrong.

In the example below, if DUMMY is declared first and SPECIES and
SPECIES2 are declared via :var+ there are missing rownames and / or
colnames as well as mixups (see below).

If DUMMY is declared *after the first* table (SPECIES) everything works
as expected.

I don't know if it is the same in other languages.

Example:

#+PROPERTY: rownames yes
#+PROPERTY: colnames yes
#+PROPERTY: var DUMMY="dummy"

* Species names and iespece codes
#+NAME: SPECIES
|         | fullName        | shortName | iespece | IFNName         | color |
|---------+-----------------+-----------+---------+-----------------+-------|
| fagus   | Fagus sylvatica | fagus     |       3 | fagus_sylvatica | red   |
| quercus | Quercus robur   | quercus   |       4 | quercus_robur   | green |
#+PROPERTY: var+ SPECIES=SPECIES


* And some more
#+NAME: SPECIES2
|         | fullName      | shortName | iespece | IFNName       | color |
|---------+---------------+-----------+---------+---------------+-------|
| no idea | ffff          |           |         |               |       |
| quercus | Quercus robur | quercus   |       4 | quercus_robur | green |
#+PROPERTY: var+ SPECIES2=SPECIES2


* The code
#+begin_src R :exports both :results output
SPECIES
#+end_src

#+RESULTS:
:                fullName shortName iespece         IFNName color
: no idea Fagus sylvatica     fagus       3 fagus_sylvatica   red
: quercus   Quercus robur   quercus       4   quercus_robur green


#+begin_src R :exports both :results output
SPECIES2
#+end_src

#+RESULTS:
:                     X X.1           X.2   X.3
: Quercus robur quercus   4 quercus_robur green



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------



Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
 of 2013-12-13 on Rainers-MacBook-Pro-2.local
Package: Org-mode version 8.2.5f (release_8.2.5f-545-g630096 @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)

current state:
==============
(setq
 org-src-lang-modes '(("plantuml" . plantuml) ("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist) ("asymptote" . asy)
                      ("dot" . fundamental) ("sqlite" . sql) ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++" . c++)
                      ("screen" . shell-script))
 org-hide-leading-stars t
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-ellipsis "〖 ✎ 〗"
 org-occur-hook '(org-first-headline-recenter)
 org-src-tab-acts-natively t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-src-window-setup 'current-window
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'y-or-n-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-startup-indented t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-odt-format-headline-function 'ignore
 org-from-is-user-regexp "\\<Rainer M Krug\\>"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
                 #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-odt-format-inlinetask-function 'ignore
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-plantuml-jar-path "/Users/rainerkrug/jar/plantuml.jar"
 org-latex-packages-alist '(("" "color") ("" "listings"))
 org-ctrl-k-protect-subtree "ask"
 org-babel-tangle-lang-exts '(("latex" . "tex") ("emacs-lisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-odt-format-drawer-function '(lambda (name contents) contents)
 org-latex-listings t
 org-show-siblings '((default) (isearch t) (bookmark-jump . t))
 org-html-format-headline-function 'ignore
 org-structure-template-alist '(("le" "#+end_src \n\n#+begin_src emacs-lisp" "<src lang=\"R\">\n\n</src>")
                                ("lua" "#+begin_src lua \n  ?\n#+end_src" "<src lang=\"lua\">\n\n</src>")
                                ("r" "#+begin_src R ?\n\n#+end_src" "<src lang=\"R\">\n\n</src>")
                                ("s" "#+BEGIN_SRC ?\n\n#+END_SRC" "<src lang=\"?\">\n\n</src>")
                                ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" "<example>\n?\n</example>")
                                ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE" "<quote>\n?\n</quote>")
                                ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" "<verse>\n?\n</verse>")
                                ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM" "<verbatim>\n?\n</verbatim>")
                                ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" "<center>\n?\n</center>")
                                ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" "<literal style=\"latex\">\n?\n</literal>")
                                ("L" "#+LaTeX: " "<literal style=\"latex\">?</literal>")
                                ("h" "#+BEGIN_HTML\n?\n#+END_HTML" "<literal style=\"html\">\n?\n</literal>")
                                ("H" "#+HTML: " "<literal style=\"html\">?</literal>") ("a" "#+BEGIN_ASCII\n?\n#+END_ASCII" "")
                                ("A" "#+ASCII: " "") ("i" "#+INDEX: ?" "#+INDEX: ?")
                                ("I" "#+INCLUDE: %file ?" "<include file=%file markup=\"?\">"))
 org-babel-load-languages '((R . t) (latex . t) (sh . t) (plantuml . t) (emacs-lisp . t))
 org-src-preserve-indentation t
 org-babel-post-tangle-hook '(org-babel-run-post-tangle-script org-babel-mark-file-as-tangled)
 org-html-format-inlinetask-function 'ignore
 org-agenda-files '("~/org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-confirm-babel-evaluate nil
 )
-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: [babel] Order of definition of :var makes or breaks the results [8.2.5f (release_8.2.5f-545-g630096 @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)]
  2014-01-21 14:17 Bug: [babel] Order of definition of :var makes or breaks the results [8.2.5f (release_8.2.5f-545-g630096 @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)] Rainer M Krug
@ 2014-01-22 19:55 ` Rainer M Krug
  0 siblings, 0 replies; 2+ messages in thread
From: Rainer M Krug @ 2014-01-22 19:55 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Any confirmation of this bug?

Rainer

On 01/21/14, 15:17 , Rainer M Krug wrote:
> Depending on the order in which variables are declared, the
> definitions are correct or wrong.
> 
> In the example below, if DUMMY is declared first and SPECIES and 
> SPECIES2 are declared via :var+ there are missing rownames and /
> or colnames as well as mixups (see below).
> 
> If DUMMY is declared *after the first* table (SPECIES) everything
> works as expected.
> 
> I don't know if it is the same in other languages.
> 
> Example:
> 
> #+PROPERTY: rownames yes #+PROPERTY: colnames yes #+PROPERTY: var
> DUMMY="dummy"
> 
> * Species names and iespece codes #+NAME: SPECIES |         |
> fullName        | shortName | iespece | IFNName         | color | 
> |---------+-----------------+-----------+---------+-----------------+-------|
>
> 
| fagus   | Fagus sylvatica | fagus     |       3 | fagus_sylvatica |
red   |
> | quercus | Quercus robur   | quercus   |       4 | quercus_robur
> | green | #+PROPERTY: var+ SPECIES=SPECIES
> 
> 
> * And some more #+NAME: SPECIES2 |         | fullName      |
> shortName | iespece | IFNName       | color | 
> |---------+---------------+-----------+---------+---------------+-------|
>
> 
| no idea | ffff          |           |         |               |       |
> | quercus | Quercus robur | quercus   |       4 | quercus_robur |
> green | #+PROPERTY: var+ SPECIES2=SPECIES2
> 
> 
> * The code #+begin_src R :exports both :results output SPECIES 
> #+end_src
> 
> #+RESULTS: :                fullName shortName iespece
> IFNName color : no idea Fagus sylvatica     fagus       3
> fagus_sylvatica   red : quercus   Quercus robur   quercus       4
> quercus_robur green
> 
> 
> #+begin_src R :exports both :results output SPECIES2 #+end_src
> 
> #+RESULTS: :                     X X.1           X.2   X.3 :
> Quercus robur quercus   4 quercus_robur green
> 
> 
> 
> Remember to cover the basics, that is, what you expected to happen
> and what in fact did happen.  You don't know how to make a good
> report?  See
> 
> http://orgmode.org/manual/Feedback.html#Feedback
> 
> Your bug report will be posted to the Org-mode mailing list. 
> ------------------------------------------------------------------------
>
> 
> 
> 
> Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, NS
> apple-appkit-1265.00) of 2013-12-13 on Rainers-MacBook-Pro-2.local 
> Package: Org-mode version 8.2.5f (release_8.2.5f-545-g630096 @
> /Users/rainerkrug/.emacs.d/org-mode/lisp/)
> 
> current state: ============== (setq org-src-lang-modes
> '(("plantuml" . plantuml) ("ocaml" . tuareg) ("elisp" . emacs-lisp)
> ("ditaa" . artist) ("asymptote" . asy) ("dot" . fundamental)
> ("sqlite" . sql) ("calc" . fundamental) ("C" . c) ("cpp" . c++)
> ("C++" . c++) ("screen" . shell-script)) org-hide-leading-stars t 
> org-tab-first-hook '(org-hide-block-toggle-maybe
> org-src-native-tab-command-maybe
> org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) 
> org-speed-command-hook '(org-speed-command-default-hook
> org-babel-speed-command-hook) org-ellipsis "〖 ✎ 〗" org-occur-hook
> '(org-first-headline-recenter) org-src-tab-acts-natively t 
> org-metaup-hook '(org-babel-load-in-session-maybe) 
> org-html-format-drawer-function '(lambda (name contents) contents) 
> org-src-window-setup 'current-window 
> org-latex-format-inlinetask-function 'ignore 
> org-confirm-shell-link-function 'y-or-n-p 
> org-ascii-format-inlinetask-function
> 'org-ascii-format-inlinetask-default 
> org-latex-format-headline-function
> 'org-latex-format-headline-default-function org-startup-indented t 
> org-after-todo-state-change-hook '(org-clock-out-if-current) 
> org-latex-format-drawer-function '(lambda (name contents)
> contents) org-odt-format-headline-function 'ignore 
> org-from-is-user-regexp "\\<Rainer M Krug\\>" org-src-mode-hook
> '(org-src-babel-configure-edit-buffer
> org-src-mode-configure-edit-buffer) org-agenda-before-write-hook
> '(org-agenda-add-entry-text) org-babel-pre-tangle-hook
> '(save-buffer) org-mode-hook '(#[nil "\300\301\302\303\304$\207"
> [org-add-hook change-major-mode-hook org-show-block-all append
> local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook
> change-major-mode-hook org-babel-show-result-all append local] 5] 
> org-babel-result-hide-spec org-babel-hide-all-hashes) 
> org-ascii-format-drawer-function '(lambda (name contents width)
> contents) org-odt-format-inlinetask-function 'ignore 
> org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
> org-babel-execute-safely-maybe) org-cycle-hook
> '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
> org-cycle-hide-inline-tasks org-cycle-show-empty-lines 
> org-optimize-window-after-visibility-change) org-plantuml-jar-path
> "/Users/rainerkrug/jar/plantuml.jar" org-latex-packages-alist '((""
> "color") ("" "listings")) org-ctrl-k-protect-subtree "ask" 
> org-babel-tangle-lang-exts '(("latex" . "tex") ("emacs-lisp" .
> "el")) org-confirm-elisp-link-function 'yes-or-no-p 
> org-metadown-hook '(org-babel-pop-to-session-maybe) 
> org-odt-format-drawer-function '(lambda (name contents) contents) 
> org-latex-listings t org-show-siblings '((default) (isearch t)
> (bookmark-jump . t)) org-html-format-headline-function 'ignore 
> org-structure-template-alist '(("le" "#+end_src \n\n#+begin_src
> emacs-lisp" "<src lang=\"R\">\n\n</src>") ("lua" "#+begin_src lua
> \n  ?\n#+end_src" "<src lang=\"lua\">\n\n</src>") ("r" "#+begin_src
> R ?\n\n#+end_src" "<src lang=\"R\">\n\n</src>") ("s" "#+BEGIN_SRC
> ?\n\n#+END_SRC" "<src lang=\"?\">\n\n</src>") ("e"
> "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" "<example>\n?\n</example>") 
> ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE" "<quote>\n?\n</quote>") ("v"
> "#+BEGIN_VERSE\n?\n#+END_VERSE" "<verse>\n?\n</verse>") ("V"
> "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM"
> "<verbatim>\n?\n</verbatim>") ("c"
> "#+BEGIN_CENTER\n?\n#+END_CENTER" "<center>\n?\n</center>") ("l"
> "#+BEGIN_LaTeX\n?\n#+END_LaTeX" "<literal
> style=\"latex\">\n?\n</literal>") ("L" "#+LaTeX: " "<literal
> style=\"latex\">?</literal>") ("h" "#+BEGIN_HTML\n?\n#+END_HTML"
> "<literal style=\"html\">\n?\n</literal>") ("H" "#+HTML: "
> "<literal style=\"html\">?</literal>") ("a"
> "#+BEGIN_ASCII\n?\n#+END_ASCII" "") ("A" "#+ASCII: " "") ("i"
> "#+INDEX: ?" "#+INDEX: ?") ("I" "#+INCLUDE: %file ?" "<include
> file=%file markup=\"?\">")) org-babel-load-languages '((R . t)
> (latex . t) (sh . t) (plantuml . t) (emacs-lisp . t)) 
> org-src-preserve-indentation t org-babel-post-tangle-hook
> '(org-babel-run-post-tangle-script org-babel-mark-file-as-tangled) 
> org-html-format-inlinetask-function 'ignore org-agenda-files
> '("~/org") org-clock-out-hook
> '(org-clock-remove-empty-clock-drawer) org-confirm-babel-evaluate
> nil )
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS4CJIAAoJENvXNx4PUvmC9kkH/iNVT3tJlGwZF+j/VDiTvCqA
e30wkp0UxntIu1vkKO1UuW9uJwwcI2UDKCl4bILbv1m4sxd84WnFxJz5mpw8ZR56
MZ5Qtv0G4T9AMVim3p1l9kYuRv6LH2oaB9jO5D4NAAid9qIl1zTClZvr9wW+kYrC
yAUk9i5/FANPbQaf3rA0Cw6eh0gxDo6IzVjea4N0v/ot5/xZLglUEodibKXldbRI
2K4omKPAS/Bb4wj7UqbhIJYVdb43bXUO8PW631ZKDzaZQjvUivEfEos8GKpcQupE
Xu6FC0Tom2p06SMr7Q1m1GMKXVQqzge/qiSq7zSQG6Aqqf/9r0/cl6xNzWZhD8k=
=T6J7
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-22 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 14:17 Bug: [babel] Order of definition of :var makes or breaks the results [8.2.5f (release_8.2.5f-545-g630096 @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)] Rainer M Krug
2014-01-22 19:55 ` Rainer M Krug

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).