[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org aba51fb584 1/3: org-fold-core-save-visibili
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org aba51fb584 1/3: org-fold-core-save-visibility: Fix macro expansion |
Date: |
Sat, 10 Dec 2022 04:57:54 -0500 (EST) |
branch: externals-release/org
commit aba51fb5848d80083ae1c7cb011813e93a64f032
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-fold-core-save-visibility: Fix macro expansion
* lisp/org-fold-core.el (org-fold-core-save-visibility): Calculate
folds on runtime, not during macro expansion.
* testing/lisp/test-org.el (test-org/org-ctrl-c-ctrl-c): Add test
ensuring that outline visibility is preserved upon refreshing Org
setup.
Reported-by: Matt Lundin <mdl@imapmail.org>
Link: https://orgmode.org/list/87wn70tlcn.fsf@fastmail.fm
---
lisp/org-fold-core.el | 2 +-
testing/lisp/test-org.el | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 8a451a82b2..ffa689d4fa 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -1063,7 +1063,7 @@ means that the buffer should stay alive during the
operation,
because otherwise all these markers will point to nowhere."
(declare (debug (form body)) (indent 1))
(org-with-gensyms (regions)
- `(let* ((,regions ,(org-fold-core-get-regions :with-markers use-markers)))
+ `(let* ((,regions (org-fold-core-get-regions :with-markers ,use-markers)))
(unwind-protect (progn ,@body)
(org-fold-core-regions ,regions :override t :clean-markers t)))))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 32026b74ed..3f61b83657 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -3581,6 +3581,21 @@ SCHEDULED: <2017-05-06 Sat>
(kill-buffer buffer))
t)))
+(ert-deftest test-org/org-ctrl-c-ctrl-c ()
+ "Test `org-ctrl-c-ctrl-c' specifications."
+ ;; FIXME: Improve coverage.
+ ;; Preserve visibility after refreshing Org setup.
+ (org-test-with-temp-text
+ "#+TITLE: Test
+* Heading<point>
+text"
+ (org-overview)
+ (should (org-fold-folded-p (point) 'outline))
+ (save-excursion
+ (goto-char (point-min))
+ (org-ctrl-c-ctrl-c))
+ (should (org-fold-folded-p (point) 'outline))))
+
;;; Navigation