emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [Babel] (wrong-type-argument char-or-string-p nil) when sh


From: Eric Schulte
Subject: Re: [Orgmode] [Babel] (wrong-type-argument char-or-string-p nil) when shell error
Date: Fri, 15 Oct 2010 09:25:59 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Tested and Fixed.  Thanks -- Eric

Sébastien Vauban <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]