💥 lang/org: conform to new name conventions
This commit is contained in:
parent
149b2617b0
commit
8147bc1aee
10 changed files with 198 additions and 196 deletions
|
@ -3,7 +3,7 @@
|
|||
;;
|
||||
;;; `org-load' hooks
|
||||
|
||||
(defun +org|init-agenda ()
|
||||
(defun +org-init-agenda-h ()
|
||||
(unless org-agenda-files
|
||||
(setq org-agenda-files (list org-directory)))
|
||||
(setq-default
|
||||
|
@ -18,7 +18,7 @@
|
|||
org-agenda-start-day "-3d"))
|
||||
|
||||
|
||||
(defun +org|init-appearance ()
|
||||
(defun +org-init-appearance-h ()
|
||||
"Configures the UI for `org-mode'."
|
||||
(setq-default
|
||||
org-adapt-indentation nil
|
||||
|
@ -67,14 +67,14 @@
|
|||
;; Scale up LaTeX previews a bit (default is too small)
|
||||
org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
|
||||
|
||||
(advice-add #'org-eldoc-documentation-function :around #'+org*display-link-in-eldoc)
|
||||
(advice-add #'org-eldoc-documentation-function :around #'+org-display-link-in-eldoc-a)
|
||||
|
||||
;; Don't do automatic indent detection in org files
|
||||
(add-to-list 'doom-detect-indentation-excluded-modes 'org-mode nil #'eq)
|
||||
|
||||
;; Previews are usually rendered with light backgrounds, so ensure their
|
||||
;; background (and foreground) match the current theme.
|
||||
(defun +org|update-latex-preview-background-color ()
|
||||
(defun +org-update-latex-preview-background-color-h ()
|
||||
(setq-default
|
||||
org-format-latex-options
|
||||
(plist-put org-format-latex-options
|
||||
|
@ -82,7 +82,7 @@
|
|||
(face-attribute (or (cadr (assq 'default face-remapping-alist))
|
||||
'default)
|
||||
:background nil t))))
|
||||
(add-hook 'doom-load-theme-hook #'+org|update-latex-preview-background-color)
|
||||
(add-hook 'doom-load-theme-hook #'+org-update-latex-preview-background-color-h)
|
||||
|
||||
(set-pretty-symbols! 'org-mode
|
||||
:name "#+NAME:"
|
||||
|
@ -90,7 +90,7 @@
|
|||
:src_block_end "#+END_SRC"))
|
||||
|
||||
|
||||
(defun +org|init-babel ()
|
||||
(defun +org-init-babel-h ()
|
||||
(setq org-src-fontify-natively t ; make code pretty
|
||||
org-src-preserve-indentation t ; use native major-mode indentation
|
||||
org-src-tab-acts-natively t
|
||||
|
@ -101,7 +101,7 @@
|
|||
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
|
||||
|
||||
;; Use major-mode native TAB indentation in SRC blocks
|
||||
(advice-add #'org-return-indent :after #'+org*fix-newline-and-indent-in-src-blocks)
|
||||
(advice-add #'org-return-indent :after #'+org-fix-newline-and-indent-in-src-blocks-a)
|
||||
|
||||
;; `org-babel-get-header' was removed from org in 9.0. Quite a few babel
|
||||
;; plugins use it, so until those plugins update, this polyfill will do:
|
||||
|
@ -115,7 +115,7 @@
|
|||
(setq org-babel-js-function-wrapper "console.log(require('util').inspect(function(){\n%s\n}()));"))
|
||||
|
||||
|
||||
(defun +org|init-babel-lazy-loader ()
|
||||
(defun +org-init-babel-lazy-loader-h ()
|
||||
"Load babel libraries lazily when babel blocks are executed."
|
||||
(defvar +org-babel-mode-alist
|
||||
'((cpp . C)
|
||||
|
@ -135,15 +135,16 @@ when executed.")
|
|||
take one argument (the language specified in the src block, as a string). Stops
|
||||
at the first function to return non-nil.")
|
||||
|
||||
(defun +org*src-lazy-load-library (lang)
|
||||
(def-advice! +org--src-lazy-load-library-a (lang)
|
||||
"Lazy load a babel package to ensure syntax highlighting."
|
||||
:before #'org-src--get-lang-mode
|
||||
(or (cdr (assoc lang org-src-lang-modes))
|
||||
(fboundp (intern-soft (format "%s-mode" lang)))
|
||||
(require (intern-soft (format "ob-%s" lang)) nil t)))
|
||||
(advice-add #'org-src--get-lang-mode :before #'+org*src-lazy-load-library)
|
||||
|
||||
(defun +org*babel-lazy-load-library (info)
|
||||
(def-advice! +org--babel-lazy-load-library-a (info)
|
||||
"Load babel libraries lazily when babel blocks are executed."
|
||||
:after-while #'org-babel-confirm-evaluate
|
||||
(let* ((lang (nth 0 info))
|
||||
(lang (if (symbolp lang) lang (intern lang)))
|
||||
(lang (or (cdr (assq lang +org-babel-mode-alist))
|
||||
|
@ -156,11 +157,10 @@ at the first function to return non-nil.")
|
|||
;; child process), so we only need to make sure it's loaded.
|
||||
(require 'ob-async nil t))
|
||||
(add-to-list 'org-babel-load-languages (cons lang t)))
|
||||
t))
|
||||
(advice-add #'org-babel-confirm-evaluate :after-while #'+org*babel-lazy-load-library))
|
||||
t)))
|
||||
|
||||
|
||||
(defun +org|init-capture-defaults ()
|
||||
(defun +org-init-capture-defaults-h ()
|
||||
"Sets up some reasonable defaults, as well as two `org-capture' workflows that
|
||||
I like:
|
||||
|
||||
|
@ -216,43 +216,43 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
|||
(file+headline +org-capture-project-notes-file "Unreleased")
|
||||
"* TODO %?\n%i\n%a" :prepend t :kill-buffer t)))
|
||||
|
||||
(defun +org*capture-expand-variable-file (file)
|
||||
(def-advice! +org-capture-expand-variable-file-a (file)
|
||||
"If a variable is used for a file path in `org-capture-template', it is used
|
||||
as is, and expanded relative to `default-directory'. This changes it to be
|
||||
relative to `org-directory', unless it is an absolute path."
|
||||
:filter-args #'org-capture-expand-file
|
||||
(if (and (symbolp file) (boundp file))
|
||||
(expand-file-name (symbol-value file) org-directory)
|
||||
file))
|
||||
(advice-add #'org-capture-expand-file :filter-args #'+org*capture-expand-variable-file)
|
||||
|
||||
(defun +org*prevent-save-prompts-when-refiling (&rest _)
|
||||
(def-advice! +org--prevent-save-prompts-when-refiling-a (&rest _)
|
||||
"Fix #462: when refiling from org-capture, Emacs prompts to kill the
|
||||
underlying, modified buffer. This fixes that."
|
||||
:after 'org-refile
|
||||
(when (bound-and-true-p org-capture-is-refiling)
|
||||
(org-save-all-org-buffers)))
|
||||
(advice-add 'org-refile :after #'+org*prevent-save-prompts-when-refiling)
|
||||
|
||||
(defun +org|show-target-in-capture-header ()
|
||||
(setq header-line-format
|
||||
(format "%s%s%s"
|
||||
(propertize (abbreviate-file-name (buffer-file-name (buffer-base-buffer)))
|
||||
'face 'font-lock-string-face)
|
||||
org-eldoc-breadcrumb-separator
|
||||
header-line-format)))
|
||||
(add-hook 'org-capture-mode-hook #'+org|show-target-in-capture-header)
|
||||
(add-hook 'org-capture-mode-hook
|
||||
(defun +org-show-target-in-capture-header-h ()
|
||||
(setq header-line-format
|
||||
(format "%s%s%s"
|
||||
(propertize (abbreviate-file-name (buffer-file-name (buffer-base-buffer)))
|
||||
'face 'font-lock-string-face)
|
||||
org-eldoc-breadcrumb-separator
|
||||
header-line-format))))
|
||||
|
||||
(when (featurep! :editor evil)
|
||||
(add-hook 'org-capture-mode-hook #'evil-insert-state)))
|
||||
|
||||
|
||||
(defun +org|init-capture-frame ()
|
||||
(add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame)
|
||||
(defun +org-init-capture-frame-h ()
|
||||
(add-hook 'org-capture-after-finalize-hook #'+org-capture-cleanup-frame-h)
|
||||
|
||||
(when (featurep! :ui doom-dashboard)
|
||||
(add-hook '+doom-dashboard-inhibit-functions #'+org-capture-frame-p)))
|
||||
|
||||
|
||||
(defun +org|init-centralized-attachments ()
|
||||
(defun +org-init-centralized-attachments-h ()
|
||||
"I believe Org's native attachment system is over-complicated and litters
|
||||
files with metadata I don't want. So I wrote my own, which:
|
||||
|
||||
|
@ -294,7 +294,7 @@ Some commands of interest:
|
|||
(lambda (file) (file-in-directory-p file org-attach-directory)))))
|
||||
|
||||
|
||||
(defun +org|init-centralized-exports ()
|
||||
(defun +org-init-centralized-exports-h ()
|
||||
"TODO"
|
||||
(defvar +org-enable-centralized-exports t
|
||||
"If non-nil, files exported from files in `org-directory' will be stored in
|
||||
|
@ -310,9 +310,10 @@ path too.")
|
|||
;; place, and I want to be able to refer back to old exports if needed.
|
||||
(setq +org-export-directory (expand-file-name +org-export-directory org-directory))
|
||||
|
||||
(defun +org*export-output-file-name (args)
|
||||
(def-advice! +org--export-output-file-name-a (args)
|
||||
"Return a centralized export location unless one is provided or the current
|
||||
file isn't in `org-directory'."
|
||||
:filter-args #'org-export-output-file-name
|
||||
(when (and +org-enable-centralized-exports
|
||||
(not (nth 2 args))
|
||||
buffer-file-name
|
||||
|
@ -322,11 +323,10 @@ file isn't in `org-directory'."
|
|||
(unless (file-directory-p dir)
|
||||
(make-directory dir t))
|
||||
(setq args (list extension subtreep dir)))))
|
||||
args)
|
||||
(advice-add #'org-export-output-file-name :filter-args #'+org*export-output-file-name))
|
||||
args))
|
||||
|
||||
|
||||
(defun +org|init-custom-links ()
|
||||
(defun +org-init-custom-links-h ()
|
||||
(defun +org--relpath (path root)
|
||||
(if (and buffer-file-name (file-in-directory-p buffer-file-name root))
|
||||
(file-relative-name path)
|
||||
|
@ -342,7 +342,6 @@ file isn't in `org-directory'."
|
|||
'org-link
|
||||
'error))))
|
||||
|
||||
|
||||
;; Highlight broken file links
|
||||
(org-link-set-parameters
|
||||
"file"
|
||||
|
@ -352,7 +351,6 @@ file isn't in `org-directory'."
|
|||
'org-link
|
||||
'error)))
|
||||
|
||||
|
||||
;; Add custom link types
|
||||
(setq org-link-abbrev-alist
|
||||
'(("github" . "https://github.com/%s")
|
||||
|
@ -378,7 +376,7 @@ file isn't in `org-directory'."
|
|||
(def-package! org-yt))
|
||||
|
||||
|
||||
(defun +org|init-export ()
|
||||
(defun +org-init-export-h ()
|
||||
(when (featurep! :lang markdown)
|
||||
(add-to-list 'org-export-backends 'md))
|
||||
|
||||
|
@ -395,7 +393,7 @@ file isn't in `org-directory'."
|
|||
(variable . "revealjs-url=https://cdn.jsdelivr.net/npm/reveal.js@3/")))))
|
||||
|
||||
|
||||
(defun +org|init-habit ()
|
||||
(defun +org-init-habit-h ()
|
||||
"TODO"
|
||||
(defvar +org-habit-graph-padding 2
|
||||
"The padding added to the end of the consistency graph")
|
||||
|
@ -406,41 +404,42 @@ file isn't in `org-directory'."
|
|||
(defvar +org-habit-graph-window-ratio 0.3
|
||||
"The ratio of the consistency graphs relative to the window width")
|
||||
|
||||
(defun +org-habit|resize-graph()
|
||||
"Right align and resize the consistency graphs based on
|
||||
(add-hook 'org-agenda-mode-hook
|
||||
(defun +org-habit-resize-graph-h ()
|
||||
"Right align and resize the consistency graphs based on
|
||||
`+org-habit-graph-window-ratio'"
|
||||
(require 'org-habit)
|
||||
(let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days)))
|
||||
(preceding-days-ratio (/ org-habit-preceding-days total-days))
|
||||
(graph-width (floor (* (window-width) +org-habit-graph-window-ratio)))
|
||||
(preceding-days (floor (* graph-width preceding-days-ratio)))
|
||||
(following-days (- graph-width preceding-days))
|
||||
(graph-column (- (window-width) (+ preceding-days following-days)))
|
||||
(graph-column-adjusted (if (> graph-column +org-habit-min-width)
|
||||
(- graph-column +org-habit-graph-padding)
|
||||
nil)))
|
||||
(setq-local org-habit-preceding-days preceding-days)
|
||||
(setq-local org-habit-following-days following-days)
|
||||
(setq-local org-habit-graph-column graph-column-adjusted)))
|
||||
(add-hook 'org-agenda-mode-hook #'+org-habit|resize-graph))
|
||||
(require 'org-habit)
|
||||
(let* ((total-days (float (+ org-habit-preceding-days org-habit-following-days)))
|
||||
(preceding-days-ratio (/ org-habit-preceding-days total-days))
|
||||
(graph-width (floor (* (window-width) +org-habit-graph-window-ratio)))
|
||||
(preceding-days (floor (* graph-width preceding-days-ratio)))
|
||||
(following-days (- graph-width preceding-days))
|
||||
(graph-column (- (window-width) (+ preceding-days following-days)))
|
||||
(graph-column-adjusted (if (> graph-column +org-habit-min-width)
|
||||
(- graph-column +org-habit-graph-padding)
|
||||
nil)))
|
||||
(setq-local org-habit-preceding-days preceding-days)
|
||||
(setq-local org-habit-following-days following-days)
|
||||
(setq-local org-habit-graph-column graph-column-adjusted)))))
|
||||
|
||||
|
||||
(defun +org|init-hacks ()
|
||||
(defun +org-init-hacks-h ()
|
||||
"Getting org to behave."
|
||||
;; Don't open separate windows
|
||||
(setf (alist-get 'file org-link-frame-setup) #'find-file)
|
||||
;; Open directory links in Emacs
|
||||
(add-to-list 'org-file-apps '(directory . emacs))
|
||||
|
||||
(defun +org|delayed-recenter ()
|
||||
"`recenter', but after a tiny delay. Necessary to prevent certain race
|
||||
(add-hook 'org-follow-link-hook
|
||||
(defun +org-delayed-recenter-h ()
|
||||
"`recenter', but after a tiny delay. Necessary to prevent certain race
|
||||
conditions where a window's buffer hasn't changed at the time this hook is run."
|
||||
(run-at-time 0.1 nil #'recenter))
|
||||
(add-hook 'org-follow-link-hook #'+org|delayed-recenter)
|
||||
(run-at-time 0.1 nil #'recenter)))
|
||||
|
||||
(defun +org*strip-properties-from-outline (orig-fn path &optional width prefix separator)
|
||||
(def-advice! +org--strip-properties-from-outline-a (orig-fn path &optional width prefix separator)
|
||||
"Remove link syntax and fix variable height text (e.g. org headings) in the
|
||||
eldoc string."
|
||||
:around #'org-format-outline-path
|
||||
(let ((result (funcall orig-fn path width prefix separator))
|
||||
(separator (or separator "/")))
|
||||
(string-join
|
||||
|
@ -452,30 +451,28 @@ eldoc string."
|
|||
(org-add-props (replace-regexp-in-string org-any-link-re "\\4" part)
|
||||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||
separator)))
|
||||
(advice-add #'org-format-outline-path :around #'+org*strip-properties-from-outline)
|
||||
|
||||
(defun +org|exclude-agenda-buffers-from-workspace ()
|
||||
"Prevent from temporarily-opened agenda buffers from being associated with
|
||||
(add-hook 'org-agenda-finalize-hook
|
||||
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
||||
"Prevent from temporarily-opened agenda buffers from being associated with
|
||||
the current workspace."
|
||||
(when (and org-agenda-new-buffers (bound-and-true-p persp-mode))
|
||||
(let (persp-autokill-buffer-on-remove)
|
||||
(persp-remove-buffer org-agenda-new-buffers
|
||||
(get-current-persp)
|
||||
nil))))
|
||||
(add-hook 'org-agenda-finalize-hook #'+org|exclude-agenda-buffers-from-workspace)
|
||||
(when (and org-agenda-new-buffers (bound-and-true-p persp-mode))
|
||||
(let (persp-autokill-buffer-on-remove)
|
||||
(persp-remove-buffer org-agenda-new-buffers
|
||||
(get-current-persp)
|
||||
nil)))))
|
||||
|
||||
(defun +org*exclude-agenda-buffers-from-recentf (orig-fn file)
|
||||
(def-advice! +org--exclude-agenda-buffers-from-recentf-a (orig-fn file)
|
||||
"Prevent temporarily opened agenda buffers from polluting recentf."
|
||||
:around #'org-get-agenda-file-buffer
|
||||
(let ((recentf-exclude (list (lambda (_file) t))))
|
||||
(funcall orig-fn file)))
|
||||
(advice-add #'org-get-agenda-file-buffer
|
||||
:around #'+org*exclude-agenda-buffers-from-recentf))
|
||||
(funcall orig-fn file))))
|
||||
|
||||
|
||||
(defun +org|init-keybinds ()
|
||||
(defun +org-init-keybinds-h ()
|
||||
"Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies
|
||||
between the two."
|
||||
(add-hook 'doom-escape-hook #'+org|remove-occur-highlights)
|
||||
(add-hook 'doom-escape-hook #'+org-remove-occur-highlights-h)
|
||||
|
||||
;; C-a & C-e act like `doom/backward-to-bol-or-indent' and
|
||||
;; `doom/forward-to-last-non-comment-or-eol', but with more org awareness.
|
||||
|
@ -485,8 +482,8 @@ between the two."
|
|||
;; insert new headings after current subtree rather than inside it
|
||||
org-insert-heading-respect-content t)
|
||||
|
||||
(add-hook! 'org-tab-first-hook #'(+org|indent-maybe +org|yas-expand-maybe))
|
||||
(add-hook 'doom-delete-backward-functions #'+org|delete-backward-char-and-realign-table-maybe)
|
||||
(add-hook! 'org-tab-first-hook #'(+org-indent-maybe-h +org-yas-expand-maybe-h))
|
||||
(add-hook 'doom-delete-backward-functions #'+org-delete-backward-char-and-realign-table-maybe-h)
|
||||
|
||||
(map! :map org-mode-map
|
||||
;; textmate-esque newline insertion
|
||||
|
@ -589,7 +586,7 @@ between the two."
|
|||
"t" #'org-agenda-todo))
|
||||
|
||||
|
||||
(defun +org|init-keybinds-for-evil (&rest args)
|
||||
(defun +org-init-keybinds-for-evil-h (&rest args)
|
||||
"TODO"
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(def-package! evil-org
|
||||
|
@ -608,12 +605,12 @@ between the two."
|
|||
:config (evil-org-agenda-set-keys))
|
||||
|
||||
;; Only fold the current tree, rather than recursively
|
||||
(add-hook 'org-tab-first-hook #'+org|cycle-only-current-subtree t)
|
||||
(add-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h t)
|
||||
|
||||
;; Fix o/O creating new list items in the middle of nested plain lists. Only
|
||||
;; has an effect when `evil-org-special-o/O' has `item' in it (not the
|
||||
;; default).
|
||||
(advice-add #'evil-org-open-below :around #'+org*evil-org-open-below)
|
||||
(advice-add #'evil-org-open-below :around #'+org-evil-org-open-below-a)
|
||||
|
||||
(map! :map outline-mode-map
|
||||
;; Undo keybinds from `evil-collection-outline'
|
||||
|
@ -698,7 +695,7 @@ between the two."
|
|||
"C-S-j" (λ! (org-eval-in-calendar '(calendar-forward-year 1))))))
|
||||
|
||||
|
||||
(defun +org|init-popup-rules ()
|
||||
(defun +org-init-popup-rules-h ()
|
||||
(set-popup-rules!
|
||||
'(("^\\*Org Links" :slot -1 :vslot -1 :size 2 :ttl 0)
|
||||
("^\\*\\(?:Agenda Com\\|Calendar\\|Org \\(?:Export Dispatcher\\|Select\\)\\)"
|
||||
|
@ -708,13 +705,14 @@ between the two."
|
|||
("^CAPTURE.*\\.org$" :size 0.2 :quit nil :select t :autosave t))))
|
||||
|
||||
|
||||
(defun +org|init-protocol-lazy-loader ()
|
||||
(defun +org-init-protocol-lazy-loader-h ()
|
||||
"Brings lazy-loaded support for org-protocol, so external programs (like
|
||||
browsers) can invoke specialized behavior from Emacs. Normally you'd simply
|
||||
require `org-protocol' and use it, but the package loads all of org for no
|
||||
compelling reason, so..."
|
||||
(defun +org*server-visit-files (args)
|
||||
(def-advice! +org--server-visit-files-a (args)
|
||||
"Advise `server-visit-flist' to invoke `org-protocol' lazily."
|
||||
:filter-args #'server-visit-files
|
||||
(cl-destructuring-bind (files proc &optional nowait) args
|
||||
(catch 'greedy
|
||||
(let ((flist (reverse files)))
|
||||
|
@ -734,20 +732,19 @@ compelling reason, so..."
|
|||
(setcar var fname))
|
||||
((setq files (delq var files)))))))))
|
||||
(list files proc nowait)))
|
||||
(advice-add #'server-visit-files :filter-args #'+org*server-visit-files)
|
||||
|
||||
;; Disable built-in, clumsy advice
|
||||
(after! org-protocol
|
||||
(ad-disable-advice 'server-visit-files 'before 'org-protocol-detect-protocol-server)))
|
||||
|
||||
|
||||
(defun +org|init-protocol ()
|
||||
(defun +org-init-protocol-h ()
|
||||
;; TODO org-board or better link grabbing support
|
||||
;; TODO org-capture + org-protocol instead of bin/org-capture
|
||||
)
|
||||
|
||||
|
||||
(defun +org|init-smartparens ()
|
||||
(defun +org-init-smartparens-h ()
|
||||
"TODO"
|
||||
(after! smartparens
|
||||
(defun +org-sp-point-in-checkbox-p (_id action _context)
|
||||
|
@ -807,29 +804,29 @@ compelling reason, so..."
|
|||
;; Shows a lot of false positives, so...
|
||||
doom-disable-show-trailing-whitespace-h
|
||||
|
||||
+org|enable-auto-reformat-tables
|
||||
+org|enable-auto-update-cookies
|
||||
+org|unfold-to-2nd-level-or-point))
|
||||
+org-enable-auto-reformat-tables-h
|
||||
+org-enable-auto-update-cookies-h
|
||||
+org-unfold-to-2nd-level-or-point-h))
|
||||
|
||||
(add-hook! 'org-load-hook
|
||||
#'(+org|init-appearance
|
||||
+org|init-agenda
|
||||
+org|init-babel
|
||||
+org|init-babel-lazy-loader
|
||||
+org|init-capture-defaults
|
||||
+org|init-capture-frame
|
||||
+org|init-centralized-attachments
|
||||
+org|init-centralized-exports
|
||||
+org|init-custom-links
|
||||
+org|init-export
|
||||
+org|init-habit
|
||||
+org|init-hacks
|
||||
+org|init-keybinds
|
||||
+org|init-keybinds-for-evil ; will noop without :editor evil
|
||||
+org|init-popup-rules
|
||||
+org|init-protocol
|
||||
+org|init-protocol-lazy-loader
|
||||
+org|init-smartparens))
|
||||
#'(+org-init-appearance-h
|
||||
+org-init-agenda-h
|
||||
+org-init-babel-h
|
||||
+org-init-babel-lazy-loader-h
|
||||
+org-init-capture-defaults-h
|
||||
+org-init-capture-frame-h
|
||||
+org-init-centralized-attachments-h
|
||||
+org-init-centralized-exports-h
|
||||
+org-init-custom-links-h
|
||||
+org-init-export-h
|
||||
+org-init-habit-h
|
||||
+org-init-hacks-h
|
||||
+org-init-keybinds-h
|
||||
+org-init-keybinds-for-evil-h ; will noop without :editor evil
|
||||
+org-init-popup-rules-h
|
||||
+org-init-protocol-h
|
||||
+org-init-protocol-lazy-loader-h
|
||||
+org-init-smartparens-h))
|
||||
|
||||
;; In case the user has eagerly loaded org from their configs
|
||||
(when (featurep 'org)
|
||||
|
@ -847,11 +844,11 @@ compelling reason, so..."
|
|||
;;; Packages
|
||||
(after! toc-org
|
||||
(setq toc-org-hrefify-default "gh")
|
||||
(defun +org*unfold-toc (&rest _)
|
||||
(def-advice! +org-unfold-toc-a (&rest _)
|
||||
:before #'toc-org-insert-toc
|
||||
(save-excursion
|
||||
(when (re-search-forward toc-org-toc-org-regexp (point-max) t)
|
||||
(+org/open-fold))))
|
||||
(advice-add #'toc-org-insert-toc :before #'+org*unfold-toc))
|
||||
(+org/open-fold)))))
|
||||
|
||||
(def-package! org-pdfview
|
||||
:when (featurep! :tools pdf)
|
||||
|
@ -874,6 +871,14 @@ compelling reason, so..."
|
|||
|
||||
(def-package! org-clock ; built-in
|
||||
:commands org-clock-save
|
||||
:hook (org-mode . org-clock-load)
|
||||
:init (setq org-clock-persist 'history)
|
||||
:config (add-hook 'kill-emacs-hook #'org-clock-save)))
|
||||
:init
|
||||
(setq org-clock-persist t)
|
||||
(def-advice! +org-clock-load-a (&rest _)
|
||||
:before '(org-clock-in
|
||||
org-clock-out
|
||||
org-clock-in-last
|
||||
org-clock-goto
|
||||
org-clock-cancel)
|
||||
(org-clock-load))
|
||||
:config
|
||||
(add-hook 'kill-emacs-hook #'org-clock-save)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue