Eric Schulte 13 лет назад
Родитель
Сommit
10f26fb805
4 измененных файлов с 17 добавлено и 6 удалено
  1. 5 4
      lisp/ob-exp.el
  2. 5 1
      lisp/ob.el
  3. 2 1
      lisp/org-src.el
  4. 5 0
      testing/examples/ob-screen-test.org

+ 5 - 4
lisp/ob-exp.el

@@ -164,7 +164,11 @@ options are taken from `org-babel-default-header-args'."
   (interactive)
   (interactive)
   (save-excursion
   (save-excursion
     (goto-char start)
     (goto-char start)
-    (while (and (< (point) end)
+    (unless (markerp end)
+      (let ((m (make-marker)))
+	(set-marker m end (current-buffer))
+	(setq end m)))
+    (while (and (< (point) (marker-position end))
 		(re-search-forward org-babel-lob-one-liner-regexp end t))
 		(re-search-forward org-babel-lob-one-liner-regexp end t))
       (unless (org-babel-in-example-or-verbatim)
       (unless (org-babel-in-example-or-verbatim)
 	(let* ((lob-info (org-babel-lob-get-info))
 	(let* ((lob-info (org-babel-lob-get-info))
@@ -186,9 +190,6 @@ options are taken from `org-babel-default-header-args'."
 						     (butlast lob-info) " ")))))
 						     (butlast lob-info) " ")))))
 			       "" nil (car (last lob-info)))
 			       "" nil (car (last lob-info)))
 			 'lob)))))
 			 'lob)))))
-	  (setq end (+ end (- (length rep)
-			      (- (length (match-string 0))
-				 (length (or (match-string 11) ""))))))
 	  (if inlinep
 	  (if inlinep
 	      (save-excursion
 	      (save-excursion
 		(goto-char inline-start)
 		(goto-char inline-start)

+ 5 - 1
lisp/ob.el

@@ -477,7 +477,10 @@ the header arguments specified at the front of the source code
 block."
 block."
   (interactive)
   (interactive)
   (let ((info (or info (org-babel-get-src-block-info))))
   (let ((info (or info (org-babel-get-src-block-info))))
-    (when (org-babel-confirm-evaluate info)
+    (when (org-babel-confirm-evaluate
+	   (let ((i info))
+	     (setf (nth 2 i) (org-babel-merge-params (nth 2 info) params))
+	     i))
       (let* ((lang (nth 0 info))
       (let* ((lang (nth 0 info))
 	     (params (if params
 	     (params (if params
 			 (org-babel-process-params
 			 (org-babel-process-params
@@ -905,6 +908,7 @@ buffer."
 	 (goto-char (point-min))
 	 (goto-char (point-min))
 	 (while (re-search-forward ,rx nil t)
 	 (while (re-search-forward ,rx nil t)
 	   (goto-char (match-beginning 1))
 	   (goto-char (match-beginning 1))
+	   (when (looking-at org-babel-inline-src-block-regexp)(forward-char 1))
 	   (save-match-data ,@body)
 	   (save-match-data ,@body)
 	   (goto-char (match-end 0))))
 	   (goto-char (match-end 0))))
        (unless visited-p (kill-buffer to-be-removed))
        (unless visited-p (kill-buffer to-be-removed))

+ 2 - 1
lisp/org-src.el

@@ -153,7 +153,8 @@ but which mess up the display of a snippet in Org exported files.")
 (defcustom org-src-lang-modes
 (defcustom org-src-lang-modes
   '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
   '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
     ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
     ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
-    ("calc" . fundamental) ("C" . c) ("cpp" . c++))
+    ("calc" . fundamental) ("C" . c) ("cpp" . c++)
+    ("screen" . shell-script))
   "Alist mapping languages to their major mode.
   "Alist mapping languages to their major mode.
 The key is the language name, the value is the string that should
 The key is the language name, the value is the string that should
 be inserted as the name of the major mode.  For many languages this is
 be inserted as the name of the major mode.  For many languages this is

+ 5 - 0
testing/examples/ob-screen-test.org

@@ -0,0 +1,5 @@
+#+Title: a collection of examples for ob-screen tests
+#+begin_src screen :session create-tmpdir
+  mkdir -p $TMPDIR
+  cd $TMPDIR
+#+end_src