From 844bd9f1f1f79bbe0719f89916b89be6283e89cf Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 2 Feb 2024 16:24:16 +0100 Subject: [PATCH] lisp/org.el (org-copy-visible): Fix when using overlays for folding --- lisp/org.el | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2f8a9a9ca..65a1de597 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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.