summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-02-04 00:30:00 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-02-04 00:30:00 +0100
commit248bc9631b17c6b56a44dc0aedc50bc31607e27f (patch)
tree95836fa74c4b7bc91dc2f920c1554c8b652fd0b8
parent19dcbab6f06437f6b4fc85de593c5c44e29afcc3 (diff)
downloadorg-mode-248bc9631b17c6b56a44dc0aedc50bc31607e27f.tar.gz
org-element: Revert regexp change for inline source blocks and babel calls
* lisp/org-element.el (org-element-inline-babel-call-parser): (org-element-inline-src-block-parser): Revert commit 7efa0f2879226695ad9b309c9263a4d1b5d79e89. * testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): * testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser): Update tests. Reported-by: Greg Minshall <minshall@acm.org> <http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00002.html>
-rw-r--r--lisp/org-element.el4
-rw-r--r--testing/lisp/test-ob-exp.el2
-rw-r--r--testing/lisp/test-org-element.el7
3 files changed, 6 insertions, 7 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 51c777b..c39195a 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2849,7 +2849,7 @@ Assume point is at the beginning of the babel call."
(save-excursion
(catch :no-object
(when (let ((case-fold-search nil))
- (looking-at "call_\\([^ \t\n[(]+\\)[([]"))
+ (looking-at "\\<call_\\([^ \t\n[(]+\\)[([]"))
(goto-char (match-end 1))
(let* ((begin (match-beginning 0))
(call (match-string-no-properties 1))
@@ -2903,7 +2903,7 @@ Assume point is at the beginning of the inline src block."
(save-excursion
(catch :no-object
(when (let ((case-fold-search nil))
- (looking-at "src_\\([^ \t\n[{]+\\)[{[]"))
+ (looking-at "\\<src_\\([^ \t\n[{]+\\)[{[]"))
(goto-char (match-end 1))
(let ((begin (match-beginning 0))
(language (match-string-no-properties 1))
diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el
index 63dd6b2..3129e9b 100644
--- a/testing/lisp/test-ob-exp.el
+++ b/testing/lisp/test-ob-exp.el
@@ -231,7 +231,7 @@ Here is one at the end of a line. {{{results(=2=)}}}
(org-babel-exp-process-buffer))
(buffer-string))))
(should
- (equal "foosrc_emacs-lisp[]{(+ 1 1)}"
+ (equal "foosrc_emacs-lisp[:exports code]{(+ 1 1)}"
(org-test-with-temp-text
"foosrc_emacs-lisp[:exports code]{(+ 1 1)}"
(let ((org-babel-inline-result-wrap "=%s=")
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index ee455d8..5dc455d 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -1210,10 +1210,6 @@ Some other text
(should
(org-test-with-temp-text "src_emacs-lisp{(+ 1 1)}"
(org-element-map (org-element-parse-buffer) 'inline-src-block 'identity)))
- ;; With prefix.
- (should
- (org-test-with-temp-text "foosrc_emacs-lisp[]{(+ 1 1)}"
- (org-element-map (org-element-parse-buffer) 'inline-src-block 'identity)))
;; With switches.
(should
(org-test-with-temp-text "src_emacs-lisp[:foo bar]{(+ 1 1)}"
@@ -1229,6 +1225,9 @@ Some other text
(should-not
(org-test-with-temp-text "src_emacs-lisp[]foo{(+ 1 1)}"
(org-element-map (org-element-parse-buffer) 'inline-src-block 'identity)))
+ (should-not
+ (org-test-with-temp-text "foosrc_emacs-lisp[]{(+ 1 1)}"
+ (org-element-map (org-element-parse-buffer) 'inline-src-block 'identity)))
;; Invalid language name
(should-not
(org-test-with-temp-text "src_emacs-\tlisp{(+ 1 1)}"