From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: [Babel] (wrong-type-argument char-or-string-p nil) when shell error Date: Fri, 15 Oct 2010 16:58:24 +0200 Message-ID: <807hhj8pv3.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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-b= uffer temp-buffer (write-region nil nil temp-file nil 0))) (unwind-protect (prog1 (with-current-buffer temp-buffer ...) (with-curren= t-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-bab= el-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-fr= om-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 resu= lt-params) (org-babel-pick-name (nth 4 processed-params) (cdr ...)) (org-ba= bel-pick-name (nth 5 processed-params) (cdr ...))) (let* ((processed-params ...) (session ...) (result-params ...) (full-bod= y ...)) (org-babel-reassemble-table (org-babel-sh-evaluate session full-bod= y 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") (:resul= ts . "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 (g= oto-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 (fbound= p cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... n= ew-hash ...) (save-excursion ... ... ... ... ... result) (message "executin= g %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-in= sert-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--) (f= makunbound ...))) (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (p= rogn ... ... ...) (if --cl-letf-bound-- ... ...))) (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute func= tion for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ...= ... ... result) (message "executing %s code block%s..." ... ...) (setq res= ult ...) (if ... ...) (org-babel-insert-result result result-params info ne= w-hash indent lang) (run-hooks ...) result)) (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute fun= ction for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ..= . ... ... result) (message "executing %s code block%s..." ... ...) (setq re= sult ...) (if ... ...) (org-babel-insert-result result result-params info n= ew-hash indent lang) (run-hooks ...) result)) (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error "No or= g-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-e= xcursion ... ... ... ... ... result) (message "executing %s code block%s...= " ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result r= esult-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) (un= wind-protect (flet ... ... ...) (setq call-process-region ...))) (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (un= wind-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") (:nowe= b . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tang= le . "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) (fu= ncall org-speed-command)) ((and org-speed-command ...) (eval org-speed-comm= and)) (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-c= luster-for-undo ...))) org-self-insert-command(1) call-interactively(org-self-insert-command nil nil) #+end_src Best regards, Seb --=20 S=C3=A9bastien 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