mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-26 05:02:53 +00:00
org-fold-core-get-folding-spec: Fix edge case
* lisp/org-fold-core.el (org-fold-core-get-folding-spec): When SPEC is nil, do not rely upon 'invisible property value to determine the fold. Examine unique property set by `org-fold-region' instead.
This commit is contained in:
parent
655e97208c
commit
8bac4d386a
|
@ -784,19 +784,16 @@ corresponding folding spec (if the text is folded using that spec)."
|
|||
(when (and spec (not (eq spec 'all))) (org-fold-core--check-spec spec))
|
||||
(org-with-point-at pom
|
||||
(cond
|
||||
((eq spec 'all)
|
||||
(let ((result))
|
||||
(dolist (spec (org-fold-core-folding-spec-list))
|
||||
(let ((val (if (eq org-fold-core-style 'text-properties)
|
||||
(get-text-property (point) (org-fold-core--property-symbol-get-create spec nil t))
|
||||
(get-char-property (point) (org-fold-core--property-symbol-get-create spec nil t)))))
|
||||
(when val (push val result))))
|
||||
(reverse result)))
|
||||
((null spec)
|
||||
(let ((result (if (eq org-fold-core-style 'text-properties)
|
||||
(get-text-property (point) 'invisible)
|
||||
(get-char-property (point) 'invisible))))
|
||||
(when (org-fold-core-folding-spec-p result) result)))
|
||||
((or (null spec) (eq spec 'all))
|
||||
(catch :single-spec
|
||||
(let ((result))
|
||||
(dolist (lspec (org-fold-core-folding-spec-list))
|
||||
(let ((val (if (eq org-fold-core-style 'text-properties)
|
||||
(get-text-property (point) (org-fold-core--property-symbol-get-create lspec nil t))
|
||||
(get-char-property (point) (org-fold-core--property-symbol-get-create lspec nil t)))))
|
||||
(when (and val (null spec)) (throw :single-spec val))
|
||||
(when val (push val result))))
|
||||
(reverse result))))
|
||||
(t (if (eq org-fold-core-style 'text-properties)
|
||||
(get-text-property (point) (org-fold-core--property-symbol-get-create spec nil t))
|
||||
(get-char-property (point) (org-fold-core--property-symbol-get-create spec nil t))))))))
|
||||
|
|
Loading…
Reference in a new issue