* [Babel] (wrong-type-argument char-or-string-p nil) when shell error
@ 2010-10-15 14:58 Sébastien Vauban
2010-10-15 15:25 ` Eric Schulte
0 siblings, 1 reply; 2+ messages in thread
From: Sébastien Vauban @ 2010-10-15 14:58 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Eric and Dan,
* Getting messages from stderr
#+begin_src sh
ls NoSuchFileOrDirectory.txt
#+end_src
results in
: ls: cannot access NoSuchFileOrDirectory.txt: No such file or directory
in *Org-Babel Error Output*, and
#+begin_src emacs-lisp
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
insert(nil)
(save-current-buffer (set-buffer temp-buffer) (insert results))
(with-current-buffer temp-buffer (insert results))
(prog1 (with-current-buffer temp-buffer (insert results)) (with-current-buffer temp-buffer (write-region nil nil temp-file nil 0)))
(unwind-protect (prog1 (with-current-buffer temp-buffer ...) (with-current-buffer temp-buffer ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(let ((temp-file tmp-file) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...)))
(with-temp-file tmp-file (insert results))
(let ((tmp-file ...)) (with-temp-file tmp-file (insert results)) (org-babel-import-elisp-from-file tmp-file))
(if (or (member "scalar" result-params) (member "output" result-params)) results (let (...) (with-temp-file tmp-file ...) (org-babel-import-elisp-from-file tmp-file)))
(lambda (results) (if (or ... ...) results (let ... ... ...)))(nil)
org-babel-sh-evaluate(nil "ls NoSuchFileOrDirectory.txt\n\n\n" ("replace"))
(org-babel-reassemble-table (org-babel-sh-evaluate session full-body result-params) (org-babel-pick-name (nth 4 processed-params) (cdr ...)) (org-babel-pick-name (nth 5 processed-params) (cdr ...)))
(let* ((processed-params ...) (session ...) (result-params ...) (full-body ...)) (org-babel-reassemble-table (org-babel-sh-evaluate session full-body result-params) (org-babel-pick-name ... ...) (org-babel-pick-name ... ...)))
org-babel-execute:sh("ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
funcall(org-babel-execute:sh "ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
(setq result (funcall cmd body params))
(if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq result ...) (message ...) result) (message "executing %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (funcall cmd body params)) (if (eq result-type ...) (setq result ...)) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)
(progn (fset (quote call-process-region) (function* ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
(unwind-protect (progn (fset ... ...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
(let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
(letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
(letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
(flet ((call-process-region ... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
(unwind-protect (flet (...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (setq call-process-region (quote org-babel-call-process-region-original)))
(let* ((lang ...) (params ...) (new-hash ...) (old-hash ...) (body ...) (result-params ...) (result-type ...) (cmd ...) (dir ...) (default-directory ...) (org-babel-call-process-region-original ...) (indent ...) result) (unwind-protect (flet ... ... ...) (setq call-process-region ...)))
(progn (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
(if (org-babel-confirm-evaluate info) (progn (let* ... ...)))
(when (org-babel-confirm-evaluate info) (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
(let ((info ...)) (when (org-babel-confirm-evaluate info) (let* ... ...)))
org-babel-execute-src-block(nil ("sh" "ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
(progn (org-babel-execute-src-block current-prefix-arg info) t)
(if info (progn (org-babel-execute-src-block current-prefix-arg info) t) nil)
(let ((info ...)) (if info (progn ... t) nil))
org-babel-execute-src-block-maybe()
(or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
org-babel-execute-maybe()
call-interactively(org-babel-execute-maybe)
(cond ((commandp org-speed-command) (setq this-command org-speed-command) (call-interactively org-speed-command)) ((functionp org-speed-command) (funcall org-speed-command)) ((and org-speed-command ...) (eval org-speed-command)) (t (let ... ...)))
(cond ((and org-use-speed-commands ...) (cond ... ... ... ...)) ((and ... ... ... ...) (let ... ... ... ... ...)) (t (setq org-table-may-need-update t) (self-insert-command N) (org-fix-tags-on-the-fly) (if org-self-insert-cluster-for-undo ...)))
org-self-insert-command(1)
call-interactively(org-self-insert-command nil nil)
#+end_src
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Babel] (wrong-type-argument char-or-string-p nil) when shell error
2010-10-15 14:58 [Babel] (wrong-type-argument char-or-string-p nil) when shell error Sébastien Vauban
@ 2010-10-15 15:25 ` Eric Schulte
0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2010-10-15 15:25 UTC (permalink / raw)
To: Sébastien Vauban; +Cc: emacs-orgmode
Tested and Fixed. Thanks -- Eric
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
> Hi Eric and Dan,
>
> * Getting messages from stderr
>
> #+begin_src sh
> ls NoSuchFileOrDirectory.txt
> #+end_src
>
> results in
>
> : ls: cannot access NoSuchFileOrDirectory.txt: No such file or directory
>
> in *Org-Babel Error Output*, and
>
> #+begin_src emacs-lisp
> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
> insert(nil)
> (save-current-buffer (set-buffer temp-buffer) (insert results))
> (with-current-buffer temp-buffer (insert results))
> (prog1 (with-current-buffer temp-buffer (insert results)) (with-current-buffer temp-buffer (write-region nil nil temp-file nil 0)))
> (unwind-protect (prog1 (with-current-buffer temp-buffer ...) (with-current-buffer temp-buffer ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
> (let ((temp-file tmp-file) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...)))
> (with-temp-file tmp-file (insert results))
> (let ((tmp-file ...)) (with-temp-file tmp-file (insert results)) (org-babel-import-elisp-from-file tmp-file))
> (if (or (member "scalar" result-params) (member "output" result-params)) results (let (...) (with-temp-file tmp-file ...) (org-babel-import-elisp-from-file tmp-file)))
> (lambda (results) (if (or ... ...) results (let ... ... ...)))(nil)
> org-babel-sh-evaluate(nil "ls NoSuchFileOrDirectory.txt\n\n\n" ("replace"))
> (org-babel-reassemble-table (org-babel-sh-evaluate session full-body result-params) (org-babel-pick-name (nth 4 processed-params) (cdr ...)) (org-babel-pick-name (nth 5 processed-params) (cdr ...)))
> (let* ((processed-params ...) (session ...) (result-params ...) (full-body ...)) (org-babel-reassemble-table (org-babel-sh-evaluate session full-body result-params) (org-babel-pick-name ... ...) (org-babel-pick-name ... ...)))
> org-babel-execute:sh("ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
> funcall(org-babel-execute:sh "ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
> (setq result (funcall cmd body params))
> (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq result ...) (message ...) result) (message "executing %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (funcall cmd body params)) (if (eq result-type ...) (setq result ...)) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)
> (progn (fset (quote call-process-region) (function* ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
> (unwind-protect (progn (fset ... ...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
> (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
> (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
> (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
> (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
> (unwind-protect (flet (...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (setq call-process-region (quote org-babel-call-process-region-original)))
> (let* ((lang ...) (params ...) (new-hash ...) (old-hash ...) (body ...) (result-params ...) (result-type ...) (cmd ...) (dir ...) (default-directory ...) (org-babel-call-process-region-original ...) (indent ...) result) (unwind-protect (flet ... ... ...) (setq call-process-region ...)))
> (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
> (if (org-babel-confirm-evaluate info) (progn (let* ... ...)))
> (when (org-babel-confirm-evaluate info) (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
> (let ((info ...)) (when (org-babel-confirm-evaluate info) (let* ... ...)))
> org-babel-execute-src-block(nil ("sh" "ls NoSuchFileOrDirectory.txt\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
> (progn (org-babel-execute-src-block current-prefix-arg info) t)
> (if info (progn (org-babel-execute-src-block current-prefix-arg info) t) nil)
> (let ((info ...)) (if info (progn ... t) nil))
> org-babel-execute-src-block-maybe()
> (or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
> org-babel-execute-maybe()
> call-interactively(org-babel-execute-maybe)
> (cond ((commandp org-speed-command) (setq this-command org-speed-command) (call-interactively org-speed-command)) ((functionp org-speed-command) (funcall org-speed-command)) ((and org-speed-command ...) (eval org-speed-command)) (t (let ... ...)))
> (cond ((and org-use-speed-commands ...) (cond ... ... ... ...)) ((and ... ... ... ...) (let ... ... ... ... ...)) (t (setq org-table-may-need-update t) (self-insert-command N) (org-fix-tags-on-the-fly) (if org-self-insert-cluster-for-undo ...)))
> org-self-insert-command(1)
> call-interactively(org-self-insert-command nil nil)
> #+end_src
>
> Best regards,
> Seb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-15 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 14:58 [Babel] (wrong-type-argument char-or-string-p nil) when shell error Sébastien Vauban
2010-10-15 15:25 ` Eric Schulte
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.