mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-26 01:32:53 +00:00
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
This commit is contained in:
parent
76a725317e
commit
aba51fb584
|
@ -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)))))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue