org--string-from-props: Fix handling folds in Emacs <28

* lisp/org-macs.el (org--string-from-props): Respect
`char-property-alias-alist' when querying for `invisible' text
property.
This commit is contained in:
Ihor Radchenko 2022-01-29 18:28:11 +08:00
parent 444d1c50ac
commit 87babca898
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 4 additions and 5 deletions

View File

@ -903,14 +903,13 @@ delimiting S."
(cursor beg)) (cursor beg))
(while (setq beg (text-property-not-all beg end property nil s)) (while (setq beg (text-property-not-all beg end property nil s))
(let* ((next (next-single-property-change beg property s end)) (let* ((next (next-single-property-change beg property s end))
(props (text-properties-at beg s)) (spec (get-text-property beg property s))
(spec (plist-get props property))
(value (value
(pcase property (pcase property
(`invisible (`invisible
;; If `invisible' property in PROPS means text is to ;; If `invisible' property means text is to be
;; be invisible, return 0. Otherwise return nil so ;; invisible, return 0. Otherwise return nil so as
;; as to resume search. ;; to resume search.
(and (or (eq t buffer-invisibility-spec) (and (or (eq t buffer-invisibility-spec)
(assoc-string spec buffer-invisibility-spec)) (assoc-string spec buffer-invisibility-spec))
0)) 0))