From 98afe0046f5fa383b65ffd5ae6847ace68142dc8 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Fri, 19 Sep 2014 11:52:30 +0200 Subject: [PATCH] ob-sh: compatibility fix for "Marker does not point anywhere" errors in Emacs 23 * lisp/ob-sh.el (org-babel-sh-initiate-session): After initiating a session, initialize the marker `comint-last-output-start' since it is going to be used by the ANSI color filter without further checks in Emacs 23 and throws an error. --- lisp/ob-sh.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ob-sh.el b/lisp/ob-sh.el index 96f275bc8..856c7a01c 100644 --- a/lisp/ob-sh.el +++ b/lisp/ob-sh.el @@ -123,7 +123,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.") -- 2.11.4.GIT