From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: bug in org-babel emacs-lisp output? Date: Fri, 22 Aug 2014 12:35:40 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKrox-0001Zo-1a for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 12:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKror-0005Xv-SR for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 12:36:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:44669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKror-0005Xq-Mt for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 12:36:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XKrok-0006WG-RV for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 18:35:58 +0200 Received: from johns-air.wv.cc.cmu.edu ([128.237.166.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Aug 2014 18:35:58 +0200 Received: from jkitchin by johns-air.wv.cc.cmu.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Aug 2014 18:35:58 +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 have noticed a possible bug in the output of src blocks, especially for emacs-lisp blocks. This block works fine. #+BEGIN_SRC emacs-lisp :results raw '(nil ("a" . "b")) #+END_SRC #+RESULTS: (nil (a . b)) This block however, gives me an error that is due to nil being the first element of the list. #+BEGIN_SRC emacs-lisp '(nil ("a" . "b")) #+END_SRC #+RESULTS: gives this error: org-babel-insert-result: Args out of range: #, 0, 1 A traceback shows: Debugger entered--Lisp error: (args-out-of-range # 0 1) orgtbl-to-orgtbl((nil ("a" . "b")) (:fmt (lambda (cell) (format "%s" cell)))) org-babel-insert-result((nil ("a" . "b")) ("value" "replace") ("emacs-lisp" "'(nil (\"a\" . \"b\"))" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace value") (:session . "none") (:hlines . "yes") (:colnames . "no") (:result-type . value) (:result-params "value" "replace") (:rowname-names) (:colname-names)) "" nil 0 #) nil 0 "emacs-lisp") org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) Another example that fails: #+BEGIN_SRC emacs-lisp :results value '('(nil nil) ("a" . "b")) #+END_SRC orgtbl-format-line: Wrong type argument: listp, "b" But, this works #+BEGIN_SRC emacs-lisp :results value '((nil . "c") ("a" . "b")) #+END_SRC #+RESULTS: | (nil . c) | (a . b) | It seems like the issue is that the output does not go into a table too well, and the error is a formatting one. Maybe this error should be caught, and a default of raw should be output when a table cannot be made? right now my workaround is specifying the :results raw when I hit these situations, but it doesn't seem right. -- ----------------------------------- John Kitchin http://kitchingroup.cheme.cmu.edu