summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-03-12 09:08:37 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-03-12 09:08:37 +0100
commit2f60dfc1b357cc78b2cb1c94272d2ab90ffcead3 (patch)
tree27fe4ae79ab1207929ff787ab02741122e53a3c9
parent081abcd6529e42e726d5518f18a09bdb19b12479 (diff)
parentcb22a0355f1ccbe13a535df77efe40244a0d1094 (diff)
downloadorg-mode-2f60dfc1b357cc78b2cb1c94272d2ab90ffcead3.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-element.el4
-rw-r--r--testing/lisp/test-org-element.el8
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 4cfb209..38a25ed 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5742,8 +5742,8 @@ Providing it allows for quicker computation."
;; At an headline or inlinetask, objects are in title.
((memq type '(headline inlinetask))
(goto-char (org-element-property :begin element))
- (skip-chars-forward "* ")
- (if (and (>= origin (point)) (< origin (line-end-position)))
+ (skip-chars-forward "*")
+ (if (and (> origin (point)) (< origin (line-end-position)))
(narrow-to-region (point) (line-end-position))
(throw 'objects-forbidden element)))
;; At a paragraph, a table-row or a verse block, objects are
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 99f820d..650ac06 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -3050,7 +3050,13 @@ Paragraph \\alpha."
(org-test-with-temp-text "Some *text with _underline_ text*"
(progn
(search-forward "under")
- (org-element-type (org-element-context (org-element-at-point))))))))
+ (org-element-type (org-element-context (org-element-at-point)))))))
+ ;; Special case: bold object at the beginning of a headline.
+ (should
+ (eq 'bold
+ (org-test-with-temp-text "* *bold*"
+ (search-forward "bo")
+ (org-element-type (org-element-context))))))