forked from mirrors/org-mode
org-export: Fix exporting visible when org-fold-core-style is 'text-properties
* lisp/org-fold-core.el (org-fold-core--update-buffer-folds): New function updating buffer folds in copied text for current buffer. (org-fold-core-decouple-indirect-buffer-folds): Use the new function. * lisp/org-element.el (org-element--generate-copy-script): Synchronize folds.
This commit is contained in:
parent
fef873b1cf
commit
87c9f9b5db
|
@ -551,6 +551,8 @@ The resulting function can be evaluated at a later time, from
|
|||
another buffer, effectively cloning the original buffer there.
|
||||
|
||||
The function assumes BUFFER's major mode is `org-mode'."
|
||||
(declare-function org-fold-core--update-buffer-folds "org-fold-core" ())
|
||||
(require 'org-fold-core)
|
||||
(with-current-buffer buffer
|
||||
(let ((str (unless drop-contents (org-with-wide-buffer (buffer-string))))
|
||||
(narrowing
|
||||
|
@ -622,6 +624,8 @@ The function assumes BUFFER's major mode is `org-mode'."
|
|||
(let ((ov (make-overlay start end)))
|
||||
(while props
|
||||
(overlay-put ov (pop props) (pop props)))))
|
||||
;; Text property folds.
|
||||
(unless drop-visibility (org-fold-core--update-buffer-folds))
|
||||
;; Never write the buffer copy to disk, despite
|
||||
;; `buffer-file-name' not being nil.
|
||||
(setq write-contents-functions (list (lambda (&rest _) t))))))))
|
||||
|
|
|
@ -634,6 +634,10 @@ unless RETURN-ONLY is non-nil."
|
|||
text-property-default-nonsticky
|
||||
full-prop-list))))))))))))))
|
||||
|
||||
(defun org-fold-core--update-buffer-folds ()
|
||||
"Copy folding state in a new buffer with text copied from old buffer."
|
||||
(org-fold-core--property-symbol-get-create (car (org-fold-core-folding-spec-list))))
|
||||
|
||||
(defun org-fold-core-decouple-indirect-buffer-folds ()
|
||||
"Copy and decouple folding state in a newly created indirect buffer.
|
||||
This function is mostly intended to be used in
|
||||
|
@ -641,7 +645,7 @@ This function is mostly intended to be used in
|
|||
(when (and (buffer-base-buffer)
|
||||
(eq org-fold-core-style 'text-properties)
|
||||
(not (memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers)))
|
||||
(org-fold-core--property-symbol-get-create (car (org-fold-core-folding-spec-list)))))
|
||||
(org-fold-core--update-buffer-folds)))
|
||||
|
||||
;;; API
|
||||
|
||||
|
|
Loading…
Reference in New Issue