Merge branch 'maint'
This commit is contained in:
commit
1f3d1f55fe
|
@ -1742,9 +1742,15 @@ containing `:begin', `:end', `:contents-begin' and
|
||||||
|
|
||||||
Assume point is at the beginning of the paragraph."
|
Assume point is at the beginning of the paragraph."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((contents-begin (point))
|
(let* (;; INNER-PAR-P is non-nil when paragraph is at the
|
||||||
(keywords (org-element--collect-affiliated-keywords))
|
;; beginning of an item or a footnote reference. In that
|
||||||
(begin (car keywords))
|
;; case, we mustn't look for affiliated keywords since they
|
||||||
|
;; belong to the container.
|
||||||
|
(inner-par-p (/= (point-at-bol) (point)))
|
||||||
|
(contents-begin (point))
|
||||||
|
(keywords (unless inner-par-p
|
||||||
|
(org-element--collect-affiliated-keywords)))
|
||||||
|
(begin (if inner-par-p contents-begin (car keywords)))
|
||||||
(before-blank
|
(before-blank
|
||||||
(let ((case-fold-search t))
|
(let ((case-fold-search t))
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
|
@ -1803,7 +1809,7 @@ Assume point is at the beginning of the paragraph."
|
||||||
;; If paragraph has no affiliated keywords, it may not begin
|
;; If paragraph has no affiliated keywords, it may not begin
|
||||||
;; at beginning of line if it starts an item.
|
;; at beginning of line if it starts an item.
|
||||||
(nconc
|
(nconc
|
||||||
(list :begin (if (cadr keywords) begin contents-begin)
|
(list :begin begin
|
||||||
:end end
|
:end end
|
||||||
:contents-begin contents-begin
|
:contents-begin contents-begin
|
||||||
:contents-end contents-end
|
:contents-end contents-end
|
||||||
|
|
|
@ -1188,7 +1188,20 @@ e^{i\\pi}+1=0
|
||||||
(org-test-with-temp-text "#+BEGIN: \nParagraph"
|
(org-test-with-temp-text "#+BEGIN: \nParagraph"
|
||||||
(let ((elem (org-element-at-point)))
|
(let ((elem (org-element-at-point)))
|
||||||
(and (eq (org-element-type elem) 'paragraph)
|
(and (eq (org-element-type elem) 'paragraph)
|
||||||
(= (point-max) (org-element-property :end elem)))))))
|
(= (point-max) (org-element-property :end elem))))))
|
||||||
|
;; Include incomplete latex environments.
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text "\begin{equation}\nParagraph"
|
||||||
|
(let ((elem (org-element-at-point)))
|
||||||
|
(and (eq (org-element-type elem) 'paragraph)
|
||||||
|
(= (point-max) (org-element-property :end elem))))))
|
||||||
|
;; Do not steal affiliated keywords from container.
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text "#+ATTR_LATEX: test\n- item 1"
|
||||||
|
(let ((elem (progn (search-forward "item") (org-element-at-point))))
|
||||||
|
(and (eq (org-element-type elem) 'paragraph)
|
||||||
|
(not (org-element-property :attr_latex elem))
|
||||||
|
(/= (org-element-property :begin elem) 1))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Plain List
|
;;;; Plain List
|
||||||
|
|
Loading…
Reference in New Issue