]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-sh.el
* lisp/simple.el (save-mark-and-excursion): Add declare forms.
[gnu-emacs] / lisp / org / ob-sh.el
index 4984ff9bf45c87f5a7b82906418cc4459026b110..b6f0404bbcdd6db2e7d4c49bba8a735f6cb143cb 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ob-sh.el --- org-babel functions for shell evaluation
 
-;; Copyright (C) 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 (require 'shell)
 (eval-when-compile (require 'cl))
 
-(declare-function org-babel-comint-in-buffer "ob-comint" (buffer &rest body))
 (declare-function org-babel-comint-wait-for-output "ob-comint" (buffer))
 (declare-function org-babel-comint-buffer-livep "ob-comint" (buffer))
-(declare-function org-babel-comint-with-output "ob-comint" (meta &rest body))
-(declare-function orgtbl-to-generic "org-table" (table params))
+(declare-function orgtbl-to-generic "org-table"
+                  (table params &optional backend))
 
 (defvar org-babel-default-header-args:sh '())
 
@@ -123,7 +122,13 @@ Emacs-lisp table, otherwise return the results as a string."
   (when (and session (not (string= session "none")))
     (save-window-excursion
       (or (org-babel-comint-buffer-livep session)
-          (progn (shell session) (get-buffer (current-buffer)))))))
+          (progn
+           (shell session)
+           ;; Needed for Emacs 23 since the marker is initially
+           ;; undefined and the filter functions try to use it without
+           ;; checking.
+           (set-marker comint-last-output-start (point))
+           (get-buffer (current-buffer)))))))
 
 (defvar org-babel-sh-eoe-indicator "echo 'org_babel_sh_eoe'"
   "String to indicate that evaluation has completed.")