Merge branch 'maint'
This commit is contained in:
commit
3f71612fb7
|
@ -4781,11 +4781,18 @@ first element of current section."
|
||||||
;; into elements with an explicit ending, but
|
;; into elements with an explicit ending, but
|
||||||
;; return that element instead.
|
;; return that element instead.
|
||||||
(and (= cend origin)
|
(and (= cend origin)
|
||||||
(memq type
|
(or (memq type
|
||||||
'(center-block
|
'(center-block
|
||||||
drawer dynamic-block inlinetask item
|
drawer dynamic-block inlinetask
|
||||||
plain-list property-drawer quote-block
|
property-drawer quote-block
|
||||||
special-block))))
|
special-block))
|
||||||
|
;; Corner case: if a list ends at the
|
||||||
|
;; end of a buffer without a final new
|
||||||
|
;; line, return last element in last
|
||||||
|
;; item instead.
|
||||||
|
(and (memq type '(item plain-list))
|
||||||
|
(progn (goto-char cend)
|
||||||
|
(or (bolp) (not (eobp))))))))
|
||||||
(throw 'exit (if keep-trail trail element))
|
(throw 'exit (if keep-trail trail element))
|
||||||
(setq parent element)
|
(setq parent element)
|
||||||
(case type
|
(case type
|
||||||
|
|
|
@ -2865,6 +2865,13 @@ Paragraph \\alpha."
|
||||||
(org-test-with-temp-text "- Para1\n- Para2\n\nPara3"
|
(org-test-with-temp-text "- Para1\n- Para2\n\nPara3"
|
||||||
(progn (forward-line 2)
|
(progn (forward-line 2)
|
||||||
(org-element-type (org-element-at-point))))))
|
(org-element-type (org-element-at-point))))))
|
||||||
|
;; Special case: when a list ends at the end of buffer and there's
|
||||||
|
;; no final newline, return last element in last item.
|
||||||
|
(should
|
||||||
|
(eq 'paragraph
|
||||||
|
(org-test-with-temp-text "- a"
|
||||||
|
(end-of-line)
|
||||||
|
(org-element-type (org-element-at-point)))))
|
||||||
;; With an optional argument, return trail.
|
;; With an optional argument, return trail.
|
||||||
(should
|
(should
|
||||||
(equal '(paragraph center-block)
|
(equal '(paragraph center-block)
|
||||||
|
|
Loading…
Reference in New Issue