emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: :results pp and code not working with multiple expressions for Emacs Lisp [9.0.9 (release_9.0.9-647-g0c9feb @ /Users/xcy/src/org-mode/lisp/)]
@ 2017-07-16 16:01 Chunyang Xu
  2017-07-23 17:23 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Chunyang Xu @ 2017-07-16 16:01 UTC (permalink / raw)
  To: emacs-orgmode

The following Emacs Lisp code block has multiple expressions. When I try
to execute it, it fails and says "princ: Invalid function: (a b c)".

#+BEGIN_SRC emacs-lisp :results value pp
  (setq my-list '(a b c))
  my-list
#+END_SRC

Is it intended?

---
Here is the Backtrace:

Debugger entered--Lisp error: (invalid-function (a b c))
  (a b c)(40)
  princ("(a b c)\n" (a b c))
  pp((a b c) (a b c))
  (progn (pp (setq my-list (quote (a b c))) my-list))
  eval((progn (pp (setq my-list (quote (a b c))) my-list)) nil)
  (let* ((lexical (cdr (assq :lexical params))) (result (eval (read (format (if (member "output" ...) "(with-output-to-string %s)" "(progn %s)") (org-babel-expand-body:emacs-lisp body params))) (if (listp lexical) lexical (member lexical (quote ("yes" "t"))))))) (let ((--params (cdr (assq :result-params params)))) (if (member "none" --params) nil (if (or (member "scalar" --params) (member "verbatim" --params) (member "html" --params) (member "code" --params) (member "pp" --params) (member "file" --params) (and (or (member "output" --params) (member "raw" --params) (member "org" --params) (member "drawer" --params)) (not (member "table" --params)))) (let ((print-level nil) (print-length nil)) (if (or (member "scalar" ...) (member "verbatim" ...)) (format "%S" result) (format "%s" result))) (org-babel-reassemble-table result (org-babel-pick-name (cdr (assq :colname-names params)) (cdr (assq :colnames params))) (org-babel-pick-name (cdr (assq :rowname-names params)) (cdr (assq :rownames params))))))))
  (progn (let* ((lexical (cdr (assq :lexical params))) (result (eval (read (format (if ... "(with-output-to-string %s)" "(progn %s)") (org-babel-expand-body:emacs-lisp body params))) (if (listp lexical) lexical (member lexical (quote ...)))))) (let ((--params (cdr (assq :result-params params)))) (if (member "none" --params) nil (if (or (member "scalar" --params) (member "verbatim" --params) (member "html" --params) (member "code" --params) (member "pp" --params) (member "file" --params) (and (or ... ... ... ...) (not ...))) (let ((print-level nil) (print-length nil)) (if (or ... ...) (format "%S" result) (format "%s" result))) (org-babel-reassemble-table result (org-babel-pick-name (cdr ...) (cdr ...)) (org-babel-pick-name (cdr ...) (cdr ...))))))))
  (unwind-protect (progn (let* ((lexical (cdr (assq :lexical params))) (result (eval (read (format ... ...)) (if (listp lexical) lexical (member lexical ...))))) (let ((--params (cdr (assq :result-params params)))) (if (member "none" --params) nil (if (or (member "scalar" --params) (member "verbatim" --params) (member "html" --params) (member "code" --params) (member "pp" --params) (member "file" --params) (and ... ...)) (let (... ...) (if ... ... ...)) (org-babel-reassemble-table result (org-babel-pick-name ... ...) (org-babel-pick-name ... ...))))))) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let* ((lexical (cdr (assq :lexical params))) (result (eval (read ...) (if ... lexical ...)))) (let ((--params (cdr ...))) (if (member "none" --params) nil (if (or ... ... ... ... ... ... ...) (let ... ...) (org-babel-reassemble-table result ... ...)))))) (set-window-configuration wconfig)))
  org-babel-execute:emacs-lisp("(setq my-list '(a b c))\nmy-list" ((:colname-names) (:rowname-names) (:result-params "replace" "value" "pp") (:result-type . value) (:results . "replace value pp") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:lexical . "no")))
  org-babel-execute-src-block(nil ("emacs-lisp" "(setq my-list '(a b c))\nmy-list" ((:colname-names) (:rowname-names) (:result-params "pp" "value" "replace") (:result-type . value) (:results . "pp value replace") (:exports . "code") (:lexical . "no") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 5500 "(ref:%s)"))
  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)


Emacs  : GNU Emacs 25.2.1 (x86_64-apple-darwin16.6.0, Carbon Version 157 AppKit 1504.83)
 of 2017-07-10
Package: Org mode version 9.0.9 (release_9.0.9-647-g0c9feb @ /Users/xcy/src/org-mode/lisp/)

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

end of thread, other threads:[~2017-07-23 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-16 16:01 Bug: :results pp and code not working with multiple expressions for Emacs Lisp [9.0.9 (release_9.0.9-647-g0c9feb @ /Users/xcy/src/org-mode/lisp/)] Chunyang Xu
2017-07-23 17:23 ` Nicolas Goaziou

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).