Update & fix org-tree-slide-mode integration
This commit is contained in:
parent
abe297b6fc
commit
047ea8dab5
3 changed files with 61 additions and 58 deletions
|
@ -1,7 +1,7 @@
|
|||
;;; lang/org/contrib/present.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +present)
|
||||
|
||||
(defvar +org-present-text-scale 7
|
||||
(defvar +org-present-text-scale 6
|
||||
"The `text-scale-amount' for `org-tree-slide-mode'.")
|
||||
|
||||
(after! ox
|
||||
|
@ -24,31 +24,37 @@
|
|||
(setq org-tree-slide-skip-outline-level 2
|
||||
org-tree-slide-activate-message " "
|
||||
org-tree-slide-deactivate-message " "
|
||||
org-tree-slide-modeline-display nil)
|
||||
org-tree-slide-modeline-display nil
|
||||
org-tree-slide-heading-emphasis t)
|
||||
|
||||
(map! :map org-tree-slide-mode-map
|
||||
:n [right] #'org-tree-slide-move-next-tree
|
||||
:n [left] #'org-tree-slide-move-previous-tree)
|
||||
(add-hook 'org-tree-slide-mode-after-narrow-hook #'org-display-inline-images)
|
||||
(add-hook! 'org-tree-slide-mode-hook
|
||||
#'+org-present-hide-blocks-h
|
||||
#'+org-present-prettify-slide-h)
|
||||
|
||||
(add-hook! 'org-tree-slide-mode-after-narrow-hook
|
||||
#'+org-present-detect-slide-h
|
||||
#'+org-present-add-overlays-h
|
||||
#'org-display-inline-images)
|
||||
|
||||
(add-hook 'org-tree-slide-mode-hook #'+org-present-init-org-tree-window-h)
|
||||
(when (featurep! :editor evil)
|
||||
(map! :map org-tree-slide-mode-map
|
||||
:n [C-right] #'org-tree-slide-move-next-tree
|
||||
:n [C-left] #'org-tree-slide-move-previous-tree)
|
||||
(add-hook 'org-tree-slide-mode-hook #'evil-normalize-keymaps))
|
||||
|
||||
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
||||
"Narrow to the target subtree when you start the presentation."
|
||||
:around #'org-tree-slide--display-tree-with-narrow
|
||||
(cl-letf (((symbol-function #'org-narrow-to-subtree)
|
||||
(lambda () (save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn (org-back-to-heading t)
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
||||
(point)))))))))
|
||||
(lambda ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point)))))))))
|
||||
(apply orig-fn args))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue