forked from mirrors/org-mode
org-element--generate-copy-script: Copy all the overlay properties
* lisp/org-element.el (org-element--generate-copy-script): In buffer copy, copy over all the overlay properties, not just 'invisible. This is needed to copy folding overlays correctly - they use more than just 'invisible property.
This commit is contained in:
parent
407a55c1c0
commit
655e97208c
|
@ -592,7 +592,7 @@ The function assumes BUFFER's major mode is `org-mode'."
|
|||
(let ((invis-prop (overlay-get ov 'invisible)))
|
||||
(when invis-prop
|
||||
(push (list (overlay-start ov) (overlay-end ov)
|
||||
invis-prop)
|
||||
(overlay-properties ov))
|
||||
ov-set))))
|
||||
ov-set))))
|
||||
(lambda ()
|
||||
|
@ -618,8 +618,10 @@ The function assumes BUFFER's major mode is `org-mode'."
|
|||
;; Current position of point.
|
||||
(goto-char pos)
|
||||
;; Overlays with invisible property.
|
||||
(pcase-dolist (`(,start ,end ,invis) ols)
|
||||
(overlay-put (make-overlay start end) 'invisible invis))
|
||||
(pcase-dolist (`(,start ,end ,props) ols)
|
||||
(let ((ov (make-overlay start end)))
|
||||
(while props
|
||||
(overlay-put ov (pop props) (pop props)))))
|
||||
;; Never write the buffer copy to disk, despite
|
||||
;; `buffer-file-name' not being nil.
|
||||
(setq write-contents-functions (list (lambda (&rest _) t))))))))
|
||||
|
|
Loading…
Reference in New Issue