浏览代码

Don't mistake ditaa figures for tables

Patch by Dan Davison, after a report by Bernt Hansen.
Carsten Dominik 15 年之前
父节点
当前提交
008dbe15ec
共有 2 个文件被更改,包括 13 次插入10 次删除
  1. 3 0
      lisp/ChangeLog
  2. 10 10
      lisp/org-src.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2010-04-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-src.el (org-edit-src-find-region-and-lang): Test for
+	table.el as late as possible.
+
 	* org-colview-xemacs.el: Make sure this file is never loaded into
 	Emacs.  Remove all tests for XEmacs.
 

+ 10 - 10
lisp/org-src.el

@@ -459,15 +459,6 @@ the language, a switch telling if the content should be in a single line."
 	(pos (point))
 	re1 re2 single beg end lang lfmt match-re1 ind entry)
     (catch 'exit
-      (when (org-at-table.el-p)
-	(re-search-backward "^[\t]*[^ \t|\\+]" nil t)
-	(setq beg (1+ (point-at-eol)))
-	(goto-char beg)
-	(or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
-	    (progn (goto-char (point-max)) (newline)))
-	(setq end (point-at-bol))
-	(setq ind (org-edit-src-get-indentation beg))
-	(throw 'exit (list beg end 'table.el nil nil ind)))
       (while (setq entry (pop re-list))
 	(setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
 	      single (nth 3 entry))
@@ -498,7 +489,16 @@ the language, a switch telling if the content should be in a single line."
 			(throw 'exit
 			       (list (match-end 0) end
 				     (org-edit-src-get-lang lang)
-				     single lfmt ind))))))))))))
+				     single lfmt ind)))))))))
+      (when (org-at-table.el-p)
+	(re-search-backward "^[\t]*[^ \t|\\+]" nil t)
+	(setq beg (1+ (point-at-eol)))
+	(goto-char beg)
+	(or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
+	    (progn (goto-char (point-max)) (newline)))
+	(setq end (point-at-bol))
+	(setq ind (org-edit-src-get-indentation beg))
+	(throw 'exit (list beg end 'table.el nil nil ind))))))
 
 (defun org-edit-src-get-lang (lang)
   "Extract the src language."