Remove app/present
This has effectively been replaced by org/org-present, tools/impatient-mode (later), and doom-big-font-mode in core.
This commit is contained in:
parent
d2d4166b42
commit
ea4e3e3c77
4 changed files with 0 additions and 217 deletions
|
@ -118,7 +118,6 @@
|
|||
:app
|
||||
email ; Emacs as an email client
|
||||
irc ; how neckbeards socialize
|
||||
present ; showing off presentations in emacs
|
||||
rss ; emacs as an RSS reader
|
||||
twitter ; twitter client https://twitter.com/vnought
|
||||
write ; emacs as a word processor (latex + org + markdown)
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
;;; app/present/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; --- impatient-mode -------------------------------------------------------------
|
||||
|
||||
;;;###autoload
|
||||
(defun +present/impatient-mode ()
|
||||
(interactive)
|
||||
(require 'simple-httpd)
|
||||
(unless (process-status "httpd")
|
||||
(httpd-start))
|
||||
(impatient-mode)
|
||||
(if impatient-mode
|
||||
(add-hook 'kill-buffer-hook '+present--cleanup-impatient-mode)
|
||||
(+present--cleanup-impatient-mode)))
|
||||
|
||||
(defun +present--cleanup-impatient-mode ()
|
||||
(unless (cl-loop for buf in (doom-buffer-list)
|
||||
if (buffer-local-value 'impatient-mode buf)
|
||||
return t)
|
||||
(httpd-stop)
|
||||
(remove-hook 'kill-buffer-hook '+present--cleanup-impatient-mode)))
|
||||
|
||||
|
||||
;; --- org tree slides ------------------------------------------------------------
|
||||
|
||||
(defvar +present--overlays-list nil)
|
||||
|
||||
;;;###autoload
|
||||
(defun +present/org-tree-slides ()
|
||||
(interactive)
|
||||
(unless (derived-mode-p 'org-mode)
|
||||
(error "Not in an org buffer"))
|
||||
(call-interactively 'org-tree-slide-mode)
|
||||
(add-hook 'kill-buffer-hook '+present--cleanup-org-tree-slides-mode))
|
||||
|
||||
;;;###autoload
|
||||
(defun +present|add-overlays ()
|
||||
(add-to-invisibility-spec '(+present))
|
||||
(save-excursion
|
||||
;; hide org-mode options starting with #+
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^[[:space:]]*\\(#\\+\\)\\(\\(?:BEGIN\\|END\\|ATTR\\)[^[:space:]]+\\).*" nil t)
|
||||
(+present--make-invisible
|
||||
(match-beginning 1)
|
||||
(match-end 0)))
|
||||
;; hide stars in headings
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^\\(\\*+\\s-\\)" nil t)
|
||||
(+present--make-invisible (match-beginning 1) (match-end 1)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +present|remove-overlays ()
|
||||
(mapc #'delete-overlay +present--overlays-list)
|
||||
(remove-from-invisibility-spec '(+present)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +present|detect-slide ()
|
||||
(outline-show-all)
|
||||
(if (member "title" (org-get-tags-at))
|
||||
(text-scale-set 10)
|
||||
(text-scale-set +present-scale)))
|
||||
|
||||
(defun +present--cleanup-org-tree-slides-mode ()
|
||||
(unless (cl-loop for buf in (doom-buffers-in-mode 'org-mode)
|
||||
if (buffer-local-value 'org-tree-slide-mode buf)
|
||||
return t)
|
||||
(org-tree-slide-mode -1)
|
||||
(remove-hook 'kill-buffer-hook #'+present--cleanup-org-tree-slides-mode)))
|
||||
|
||||
(defun +present--make-invisible (beg end)
|
||||
(let ((overlay (make-overlay beg end)))
|
||||
(push overlay +present--overlays-list)
|
||||
(overlay-put overlay 'invisible '+present)))
|
||||
|
||||
|
||||
|
||||
|
||||
;; --- misc -----------------------------------------------------------------------
|
||||
|
||||
(defvar +present--original-font +doom-font)
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode +present/big-mode
|
||||
"A global mode that resizes the font, for streams, screen-sharing and
|
||||
presentations."
|
||||
:init-value nil
|
||||
:lighter " BIG"
|
||||
:global t
|
||||
(if +present/big-mode
|
||||
(set-frame-font +present-big-font t t)
|
||||
(set-frame-font +present--original-font t t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +present/resize-frame-for-stream ()
|
||||
"Resize the frame pixelwise, so that it fits directly into my livecoding.tv
|
||||
streaming layout."
|
||||
(interactive)
|
||||
(set-frame-width (selected-frame) 1325 nil t)
|
||||
(set-frame-height (selected-frame) 1080 nil t))
|
|
@ -1,109 +0,0 @@
|
|||
;;; app/present/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Sometimes you just get that urge to show off. I don't have a fancy car, so
|
||||
;; my code or Emacs will have to do.
|
||||
;;
|
||||
;; Sometimes I stream my work on liveedu.tv, or record it on youtube, or peer
|
||||
;; program over skype/teamviewer, or present at talks -- for all of this, Emacs
|
||||
;; is my solution.
|
||||
;;
|
||||
;; + `impatient-mode' lets me show off code, as I write it, in real-time over
|
||||
;; HTTP (see `+present/buffer')
|
||||
;; + `ox-reveal' adds a reveal.js exporter to org-mode
|
||||
;; + `org-tree-slide' for presenting org buffers as slides, plus some hacks to
|
||||
;; unclutter them.
|
||||
;; + and `+present/big-mode' lets me toggle big fonts for streams or
|
||||
;; screen-sharing
|
||||
|
||||
(defvar +present-big-font (font-spec :family "Fira Mono" :size 18)
|
||||
"Font to use when `+present/big-mode' is enabled.")
|
||||
|
||||
(defvar +present-scale 7
|
||||
"The `text-scale-amount' for `org-tree-slide-mode'.")
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(def-package! impatient-mode
|
||||
:commands impatient-mode)
|
||||
|
||||
|
||||
(def-package! centered-window-mode
|
||||
:commands centered-window-mode
|
||||
:config
|
||||
(setq cwm-use-vertical-padding t
|
||||
cwm-frame-internal-border 110
|
||||
cwm-left-fringe-ratio -10
|
||||
cwm-centered-window-width 240))
|
||||
|
||||
|
||||
(when (featurep! :lang org) ;; reveal.js
|
||||
(if (bound-and-true-p org-modules-loaded)
|
||||
(require 'ox-reveal)
|
||||
(add-hook! 'org-load (require 'ox-reveal)))
|
||||
|
||||
(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/"
|
||||
org-reveal-mathjax t)
|
||||
|
||||
(def-package! org-tree-slide
|
||||
:commands org-tree-slide-mode
|
||||
:init
|
||||
(after! org
|
||||
(map! :map org-mode-map
|
||||
"<f8>" #'+present/org-tree-slides
|
||||
"<f7>" #'+present/next))
|
||||
:config
|
||||
(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-simple-profile)
|
||||
|
||||
(map! :map org-tree-slide-mode-map
|
||||
[right] #'org-tree-slide-move-next-tree
|
||||
[left] #'org-tree-slide-move-previous-tree)
|
||||
|
||||
(add-hook! 'org-tree-slide-mode-after-narrow-hook
|
||||
#'(+present|detect-slide +present|add-overlays org-display-inline-images))
|
||||
|
||||
(defun +present|org-tree-present-mode ()
|
||||
"TODO"
|
||||
(doom/window-zoom)
|
||||
(let ((arg (if org-tree-slide-mode +1 -1)))
|
||||
(centered-window-mode arg)
|
||||
(window-divider-mode (* arg -1))
|
||||
(doom-hide-modeline-mode arg)
|
||||
(+org-pretty-mode arg)
|
||||
(cond (org-tree-slide-mode
|
||||
(org-indent-mode -1)
|
||||
(text-scale-set +present-scale)
|
||||
(ignore-errors (org-toggle-latex-fragment '(4)))
|
||||
(set-face-attribute 'org-level-2 nil :height 1.4))
|
||||
(t
|
||||
(org-indent-mode +1)
|
||||
(text-scale-set 0)
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||
(+present|remove-overlays)
|
||||
(org-remove-inline-images)))))
|
||||
(add-hook 'org-tree-slide-mode-hook #'+present|org-tree-present-mode)
|
||||
|
||||
(defun +present*org-tree-slide-narrow-exclude-header (orig-fn &rest args)
|
||||
"TODO"
|
||||
(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)))))))))
|
||||
(apply orig-fn args)))
|
||||
(advice-add #'org-tree-slide--display-tree-with-narrow
|
||||
:around #'+present*org-tree-slide-narrow-exclude-header)))
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; app/present/packages.el
|
||||
|
||||
(package! centered-window-mode)
|
||||
(package! htmlize)
|
||||
(package! impatient-mode)
|
||||
(package! org-tree-slide)
|
||||
(package! ox-reveal)
|
Loading…
Add table
Add a link
Reference in a new issue