瀏覽代碼

Merge branch 'maint'

Nicolas Goaziou 12 年之前
父節點
當前提交
7c40e0c6ba
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 1 0
      lisp/org-element.el
  2. 4 0
      testing/lisp/test-org-element.el

+ 1 - 0
lisp/org-element.el

@@ -2617,6 +2617,7 @@ LIMIT bounds the search.
 Return value is a cons cell whose CAR is `inline-babel-call' and
 CDR is beginning position."
   (save-excursion
+    (unless (bolp) (backward-char))
     (when (re-search-forward org-babel-inline-src-block-regexp limit t)
       (cons 'inline-src-block (match-beginning 1)))))
 

+ 4 - 0
testing/lisp/test-org-element.el

@@ -831,6 +831,10 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] =>  0:01"
   "Test `inline-src-block' parser."
   (should
    (org-test-with-temp-text "src_emacs-lisp{(+ 1 1)}"
+     (org-element-map (org-element-parse-buffer) 'inline-src-block 'identity)))
+  ;; Test parsing at the beginning of an item.
+  (should
+   (org-test-with-temp-text "- src_emacs-lisp{(+ 1 1)}"
      (org-element-map (org-element-parse-buffer) 'inline-src-block 'identity))))