doomemacs/modules/lang/org/contrib/present.el
Henrik Lissner a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00

45 lines
1.3 KiB
EmacsLisp

;;; lang/org/contrib/present.el -*- lexical-binding: t; -*-
;;;###if (featurep! +present)
(defvar +org-present-text-scale 7
"The `text-scale-amount' for `org-tree-slide-mode'.")
(after! ox
(add-to-list 'org-export-backends 'beamer))
;;
;;; Packages
(use-package! ox-reveal
:after ox
:init
;; Fix #1127, where ox-reveal adds an errant entry to
;; `org-structure-template-alist'
(setq org-reveal-note-key-char nil)
:config
(setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js@3/"
org-reveal-mathjax t))
(use-package! org-tree-slide
:commands org-tree-slide-mode
:config
(org-tree-slide-simple-profile)
(setq org-tree-slide-skip-outline-level 2
org-tree-slide-activate-message " "
org-tree-slide-deactivate-message " "
org-tree-slide-modeline-display nil)
(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-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)
(advice-add #'org-tree-slide--display-tree-with-narrow
:around #'+org-present*narrow-to-subtree))