lisp/org.el (org-copy-visible): Fix when using overlays for folding

This commit is contained in:
Ihor Radchenko 2024-02-02 16:24:16 +01:00
parent 83bc81b750
commit 844bd9f1f1
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 12 deletions

View File

@ -17716,18 +17716,11 @@ this numeric value."
(interactive "r")
(let ((result ""))
(while (/= beg end)
(if (eq org-fold-core-style 'text-properties)
(progn
(while (org-invisible-p beg)
(setq beg (org-fold-next-visibility-change beg end)))
(let ((next (org-fold-next-visibility-change beg end)))
(setq result (concat result (buffer-substring beg next)))
(setq beg next)))
(when (invisible-p beg)
(setq beg (next-single-char-property-change beg 'invisible nil end)))
(let ((next (next-single-char-property-change beg 'invisible nil end)))
(setq result (concat result (buffer-substring beg next)))
(setq beg next))))
(while (org-invisible-p beg)
(setq beg (org-fold-next-visibility-change beg end)))
(let ((next (org-fold-next-visibility-change beg end)))
(setq result (concat result (buffer-substring beg next)))
(setq beg next)))
;; Prevent Emacs from adding full selected text to `kill-ring'
;; when `select-enable-primary' is non-nil. This special value of
;; `deactivate-mark' only works since Emacs 29.