0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:00:49 +00:00

Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2012-11-23 23:49:19 +01:00
commit ce8819f18d
2 changed files with 19 additions and 8 deletions

View file

@ -4676,18 +4676,22 @@ and :post-blank properties."
(funcall (intern (format "org-element-%s-parser"
(car closest-cand))))))
(cbeg (org-element-property :contents-begin object))
(cend (org-element-property :contents-end object)))
(cend (org-element-property :contents-end object))
(obj-end (org-element-property :end object)))
(cond
;; ORIGIN is after OBJECT, so skip it.
((< (org-element-property :end object) origin)
(goto-char (org-element-property :end object)))
;; ORIGIN is within a non-recursive object or at an
;; object boundaries: Return that object.
((<= obj-end origin)
(if (/= obj-end end) (goto-char obj-end)
(throw 'exit
(org-element-put-property
object :parent parent))))
;; ORIGIN is within a non-recursive object or at
;; an object boundaries: Return that object.
((or (not cbeg) (> cbeg origin) (< cend origin))
(throw 'exit
(org-element-put-property object :parent parent)))
;; Otherwise, move within current object and restrict
;; search to the end of its contents.
;; Otherwise, move within current object and
;; restrict search to the end of its contents.
(t (goto-char cbeg)
(org-element-put-property object :parent parent)
(setq parent object

View file

@ -2677,7 +2677,14 @@ Paragraph \\alpha."
(org-test-with-temp-text "Some *bold* text"
(progn (search-forward "bold")
(org-element-type
(org-element-property :parent (org-element-context))))))))
(org-element-property :parent (org-element-context)))))))
;; Between two objects, return the second one.
(should
(eq 'macro
(org-test-with-temp-text "<<target>>{{{test}}}"
(progn (search-forward "{")
(backward-char)
(org-element-type (org-element-context)))))))
(provide 'test-org-element)