From 62c6d5668df376b99c1c70512e374f4b5d740a4e Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 2 Feb 2024 14:21:31 +0100 Subject: [PATCH] org-fold-core-style: Use 'overlays in Emacs >=29 * lisp/org-fold-core.el (org-fold-core-style): Set default value to 'overlays in newer Emacs versions. Newer Emacs does not have performance issues with overlays and using text-properties there is not beneficial due to numerous issues with most of Emacs code and third-party packages that assume overlay-based folding. --- lisp/org-fold-core.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el index 80d9e8a5c..610eae259 100644 --- a/lisp/org-fold-core.el +++ b/lisp/org-fold-core.el @@ -280,12 +280,13 @@ ;;; Customization -(defcustom org-fold-core-style 'text-properties +(defcustom org-fold-core-style (if (version< emacs-version "29") + 'text-properties + 'overlays) "Internal implementation detail used to hide folded text. Can be either `text-properties' or `overlays'. -The former is faster on large files, while the latter is generally -less error-prone with regard to third-party packages that haven't yet -adapted to the new folding implementation. +The former is faster on large files in Emacs <29, while the latter is +generally less error-prone with regard to third-party packages. Important: This variable must be set before loading Org." :group 'org