lang/org: minor refactor of contrib submodules
This commit is contained in:
parent
c5464f1798
commit
1694641636
5 changed files with 26 additions and 35 deletions
|
@ -2,7 +2,7 @@
|
||||||
;;;###if (featurep! +dragndrop)
|
;;;###if (featurep! +dragndrop)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-dragndrop-download-dnd (uri action)
|
(defun +org-dragndrop-download-dnd-fn (uri action)
|
||||||
"TODO"
|
"TODO"
|
||||||
(if (eq major-mode 'org-mode)
|
(if (eq major-mode 'org-mode)
|
||||||
(+org-attach/uri uri)
|
(+org-attach/uri uri)
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless (derived-mode-p 'org-mode)
|
(unless (derived-mode-p 'org-mode)
|
||||||
(error "Not in an org buffer"))
|
(error "Not in an org buffer"))
|
||||||
(call-interactively 'org-tree-slide-mode)
|
(call-interactively #'org-tree-slide-mode)
|
||||||
(add-hook 'kill-buffer-hook '+org-present--cleanup-org-tree-slides-mode))
|
(add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -88,23 +88,3 @@
|
||||||
(let ((overlay (make-overlay beg end)))
|
(let ((overlay (make-overlay beg end)))
|
||||||
(push overlay +org-present--overlays)
|
(push overlay +org-present--overlays)
|
||||||
(overlay-put overlay 'invisible '+org-present)))
|
(overlay-put overlay 'invisible '+org-present)))
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Advice
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +org-present*narrow-to-subtree (orig-fn &rest args)
|
|
||||||
"Narrow to the target subtree when you start the presentation."
|
|
||||||
(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)))
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
:commands (org-download-dnd org-download-dnd-base64)
|
:commands (org-download-dnd org-download-dnd-base64)
|
||||||
:init
|
:init
|
||||||
;; HACK We add these manually so that org-download is truly lazy-loaded
|
;; HACK We add these manually so that org-download is truly lazy-loaded
|
||||||
(nconcq! dnd-protocol-alist
|
(pushnew! dnd-protocol-alist
|
||||||
'(("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd)
|
'("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd-fn)
|
||||||
("^data:" . org-download-dnd-base64)))
|
'("^data:" . org-download-dnd-base64))
|
||||||
(advice-add #'org-download-enable :override #'ignore)
|
(advice-add #'org-download-enable :override #'ignore)
|
||||||
:config
|
:config
|
||||||
(setq org-download-image-dir org-attach-directory
|
(setq org-download-image-dir org-attach-directory
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
;;; lang/org/contrib/journal.el -*- lexical-binding: t; -*-
|
;;; lang/org/contrib/journal.el -*- lexical-binding: t; -*-
|
||||||
;;;###if (featurep! +journal)
|
;;;###if (featurep! +journal)
|
||||||
|
|
||||||
(use-package! org-journal
|
(map! :after org-journal
|
||||||
:defer t
|
:localleader
|
||||||
:config
|
(:map org-journal-search-mode-map
|
||||||
(map! :map org-journal-search-mode-map
|
|
||||||
:localleader
|
|
||||||
"n" #'org-journal-search-next
|
"n" #'org-journal-search-next
|
||||||
"p" #'org-journal-search-prev)
|
"p" #'org-journal-search-prev)
|
||||||
(map! :map org-journal-mode-map
|
(:map org-journal-mode-map
|
||||||
:localleader
|
|
||||||
"n" #'org-journal-open-next-entry
|
"n" #'org-journal-open-next-entry
|
||||||
"p" #'org-journal-open-previous-entry))
|
"p" #'org-journal-open-previous-entry))
|
||||||
|
|
|
@ -36,5 +36,19 @@
|
||||||
#'org-display-inline-images)
|
#'org-display-inline-images)
|
||||||
|
|
||||||
(add-hook 'org-tree-slide-mode-hook #'+org-present-init-org-tree-window-h)
|
(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))
|
(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)))))))))
|
||||||
|
(apply orig-fn args))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue