summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleh Krehel <ohwoeowho@gmail.com>2013-12-22 18:48:29 +0100
committerOleh Krehel <ohwoeowho@gmail.com>2013-12-22 18:48:29 +0100
commitfa2e39148f42e295f7d0b59dd5a63d66ac936212 (patch)
tree72e0125dd06097fb9c091db549712dcd2420e9f0
parentb291cdbe6d4f90bd8643c01acab46089f9877069 (diff)
downloadorg-mode-fa2e39148f42e295f7d0b59dd5a63d66ac936212.tar.gz
lisp/ob-J.el (obj-string-match-m): add missing function
-rw-r--r--lisp/ob-J.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ob-J.el b/lisp/ob-J.el
index 617b4b5..f57f5a5 100644
--- a/lisp/ob-J.el
+++ b/lisp/ob-J.el
@@ -39,7 +39,7 @@ PROCESSED-PARAMS isn't used yet."
(defun org-babel-J-interleave-echos-except-functions (body)
"Interleave echo'' between source lines of BODY that aren't functions."
- (if (string-match-m "\\(?:^\\|\n\\)[^\n]*\\(?:1\\|2\\|3\\|4\\) : 0\n.*)" body)
+ (if (obj-string-match-m "\\(?:^\\|\n\\)[^\n]*\\(?:1\\|2\\|3\\|4\\) : 0\n.*)" body)
(let ((s1 (substring body 0 (match-beginning 0)))
(s2 (match-string 0 body))
(s3 (substring body (match-end 0))))
@@ -121,6 +121,13 @@ This function is called by `org-babel-execute-src-block'"
(and (string-match "^ *\\([^ ].*\\)" s)
(match-string 1 s)))
+(defun obj-string-match-m (regexp string &optional start)
+ "Like `sting-match', only .* includes newlines too."
+ (string-match
+ (replace-regexp-in-string "\\.\\*" "[\0-\377[:nonascii:]]*" regexp)
+ string
+ start))
+
(defun org-babel-j-initiate-session (&optional session)
"Initiate a J session.
SESSION is a parameter given by org-babel."