fix(org): invisible inline images in org-tree-slide-mode
Our method of hiding meta lines (like '#+attr_org: ...') was too effective; it ended up hiding the following image as well! Fix #5524
This commit is contained in:
parent
5f1a26290c
commit
c92937f890
1 changed files with 8 additions and 11 deletions
|
@ -15,13 +15,6 @@
|
|||
(remove-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode
|
||||
'local)))
|
||||
|
||||
(defun +org-present--make-invisible (beg end)
|
||||
(unless (assq '+org-present buffer-invisibility-spec)
|
||||
(add-to-invisibility-spec '(+org-present)))
|
||||
(let ((overlay (make-overlay beg (1+ end))))
|
||||
(push overlay +org-present--overlays)
|
||||
(overlay-put overlay 'invisible '+org-present)))
|
||||
|
||||
|
||||
;;
|
||||
;;; Hooks
|
||||
|
@ -32,9 +25,10 @@
|
|||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^[[:space:]]*\\(#\\+\\)\\(\\(?:BEGIN\\|END\\|ATTR\\)[^[:space:]]+\\).*" nil t)
|
||||
(+org-present--make-invisible
|
||||
(match-beginning 1)
|
||||
(match-end 0)))))
|
||||
(org-flag-region (match-beginning 1)
|
||||
(match-end 0)
|
||||
org-tree-slide-mode
|
||||
t))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present-hide-leading-stars-h ()
|
||||
|
@ -42,7 +36,10 @@
|
|||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^\\(\\*+\\)" nil t)
|
||||
(+org-present--make-invisible (match-beginning 1) (match-end 1)))))
|
||||
(org-flag-region (match-beginning 1)
|
||||
(match-end 1)
|
||||
org-tree-slide-mode
|
||||
t))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-present-remove-overlays-h ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue