|
@@ -4199,6 +4199,10 @@ elements.
|
|
|
Elements are accumulated into ACC."
|
|
|
(save-excursion
|
|
|
(goto-char beg)
|
|
|
+ ;; Visible only: skip invisible parts at the beginning of the
|
|
|
+ ;; element.
|
|
|
+ (when (and visible-only (org-invisible-p2))
|
|
|
+ (goto-char (min (1+ (org-find-visible)) end)))
|
|
|
;; When parsing only headlines, skip any text before first one.
|
|
|
(when (and (eq granularity 'headline) (not (org-at-heading-p)))
|
|
|
(org-with-limited-levels (outline-next-heading)))
|
|
@@ -4211,12 +4215,13 @@ Elements are accumulated into ACC."
|
|
|
(type (org-element-type element))
|
|
|
(cbeg (org-element-property :contents-begin element)))
|
|
|
(goto-char (org-element-property :end element))
|
|
|
+ ;; Visible only: skip invisible parts between siblings.
|
|
|
+ (when (and visible-only (org-invisible-p2))
|
|
|
+ (goto-char (min (1+ (org-find-visible)) end)))
|
|
|
;; Fill ELEMENT contents by side-effect.
|
|
|
(cond
|
|
|
- ;; If VISIBLE-ONLY is true and element is hidden or if it has
|
|
|
- ;; no contents, don't modify it.
|
|
|
- ((or (and visible-only (org-element-property :hiddenp element))
|
|
|
- (not cbeg)))
|
|
|
+ ;; If element has no contents, don't modify it.
|
|
|
+ ((not cbeg))
|
|
|
;; Greater element: parse it between `contents-begin' and
|
|
|
;; `contents-end'. Make sure GRANULARITY allows the
|
|
|
;; recursion, or ELEMENT is a headline, in which case going
|