From f0e5683a120fbd4acf722218e19022f13e7990c7 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 12 Mar 2014 18:56:24 +0100 Subject: [PATCH] org-src.el (org-edit-src-find-region-and-lang): Check if we are in a table.el table last * org-src.el (org-edit-src-find-region-and-lang): Check if we are in a table.el table last. Thanks to zwz and Thomas Holst for reporting this. --- lisp/org-src.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 6ded5e602..4ca123df5 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -577,14 +577,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 (1- (point-at-bol))) - (throw 'exit (list beg end 'table.el nil nil 0))) (while (setq entry (pop re-list)) (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry) single (nth 3 entry)) @@ -615,7 +607,15 @@ 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 (1- (point-at-bol))) + (throw 'exit (list beg end 'table.el nil nil 0)))))) (defun org-edit-src-get-lang (lang) "Extract the src language."