diff options
| author | Blake Romero <blake@blkrom.com> | 2025-07-11 12:35:44 +0100 |
|---|---|---|
| committer | Blake Romero <blake@blkrom.com> | 2025-07-11 12:35:44 +0100 |
| commit | 3f26f56f1dcafd72d04b0d86d39f4cf026e1578c (patch) | |
| tree | 7d1303584b3176b5c0a402ff60d2f33ff70e36be /emacs-config.org | |
| parent | 0a921cbf7d61a7b2295c7378aa69327154b35257 (diff) | |
Reordered org settings
Diffstat (limited to 'emacs-config.org')
| -rw-r--r-- | emacs-config.org | 108 |
1 files changed, 63 insertions, 45 deletions
diff --git a/emacs-config.org b/emacs-config.org index 8d63bf8..6249920 100644 --- a/emacs-config.org +++ b/emacs-config.org @@ -356,47 +356,41 @@ Case-sensitive search by default and show match count in minibuffer. #+begin_src elisp :noweb yes (with-eval-after-load 'org <<org-settings>> + <<org-todo-tag-settings>> <<org-babel-settings>>) #+end_src +#+begin_src elisp :noweb yes + (with-eval-after-load 'org-keys + <<org-speed-command-settings>>) +#+end_src + +*** Org Settings +:PROPERTIES: +:header-args:elisp: :tangle no :noweb-ref org-settings +:END: + Hide emphasis markers and set ellipse symbol. -#+begin_src elisp :tangle no :noweb-ref org-settings +#+begin_src elisp (setq-default org-ellipsis "⤵" org-hide-emphasis-markers t) #+end_src Enable checkbox dependency checking. -#+begin_src elisp :tangle no :noweb-ref org-settings +#+begin_src elisp (setq-default org-enforce-todo-dependencies t org-enforce-todo-checkbox-dependencies t org-checkbox-hierarchical-statistics nil) #+end_src -Try to get the width from attribute tags or fall-back to original image width. -Also redisplay updated images on block execution. -#+begin_src elisp :tangle no :noweb-ref org-settings - (setq-default org-image-actual-width nil) - (add-hook 'org-babel-after-execute-hook - (lambda () "Redisplay Org inline images." - (when org-inline-image-overlays - (org-redisplay-inline-images)))) -#+end_src - -Use custom IDs for links. -#+begin_src elisp - (with-eval-after-load 'org-id - (setq-default org-id-link-to-org-use-id - 'create-if-interactive-and-no-custom-id)) -#+end_src - Set org column format. -#+begin_src elisp :tangle no :noweb-ref org-settings +#+begin_src elisp (setq-default org-columns-default-format "%70ITEM %TODO %10CLOCKSUM %16DEADLINE") #+end_src Enable notes for various actions. -#+begin_src elisp :tangle no :noweb-ref org-settings +#+begin_src elisp (setq-default org-log-done 'time org-log-reschedule 'note org-log-redeadline 'note @@ -404,7 +398,37 @@ Enable notes for various actions. org-log-note-clock-out t) #+end_src -*** Org To-do +Prioritise attribute tags for image width. +#+begin_src elisp + (setq-default org-image-actual-width nil) +#+end_src + +Add advice to prompt for confirmation before commenting or cutting a subtree. +#+begin_src elisp + (advice-add 'org-cut-subtree + :before-while (lambda (&rest _) + "Prompts for confirmation before cutting subtree." + (let ((heading (org-entry-get nil "ITEM"))) + (y-or-n-p (format "Cut \"%s\" subtree?" heading))))) + + (advice-add 'org-toggle-comment + :before-while (lambda (&rest _) + "Prompt for confirmation before commenting a subtree." + (let ((heading (org-entry-get nil "ITEM"))) + (y-or-n-p (format "Toggle comment on \"%s\" subtree?" heading))))) +#+end_src + +Use custom IDs for links. +#+begin_src elisp + (with-eval-after-load 'org-id + (setq-default org-id-link-to-org-use-id + 'create-if-interactive-and-no-custom-id)) +#+end_src + +*** Org To-dos & Tags +:PROPERTIES: +:header-args:elisp: :tangle no :noweb-ref org-todo-tag-settings +:END: Set to-do key words and selection type. #+begin_src elisp (setq-default @@ -427,7 +451,8 @@ Style keywords. Add no-export tag. #+begin_src elisp - (setq-default org-export-exclude-tags '("noexport" "NOEXPORT")) + (with-eval-after-load 'ox + (cl-pushnew "NOEXPORT" org-export-exclude-tags)) #+end_src Set tag list. @@ -468,34 +493,18 @@ Set tag list. (:endgroup))) #+end_src -*** Org Speed Commands -#+begin_src elisp :noweb yes - (with-eval-after-load 'org-keys - <<org-speed-command-settings>>) -#+end_src +*** Org Speed Command Keys +:PROPERTIES: +:header-args:elisp: :tangle no :noweb-ref org-speed-command-settings +:END: Enable org speed commands. #+begin_src elisp (setq-default org-use-speed-commands t) #+end_src -Add advice to prompt for confirmation before commenting or cutting subtree. -#+begin_src elisp - (advice-add 'org-cut-subtree - :before-while (lambda (&rest _) - "Prompts for confirmation before cutting subtree." - (let ((heading (org-entry-get nil "ITEM"))) - (y-or-n-p (format "Cut \"%s\" subtree?" heading))))) - - (advice-add 'org-toggle-comment - :before-while (lambda (&rest _) - "Prompt for confirmation before commenting a subtree." - (let ((heading (org-entry-get nil "ITEM"))) - (y-or-n-p (format "Toggle comment on \"%s\" subtree?" heading))))) -#+end_src - Alternative comment key =;= added to be consistent with ~org-toggle-comment~ (=C-c ;=). -#+begin_src elisp :tangle no :noweb-ref org-speed-command-settings +#+begin_src elisp (dolist (key '(("P" . org-set-property) ("$" . org-archive-subtree-default-with-confirmation) ("q" . org-set-tags-command) @@ -507,7 +516,7 @@ Alternative comment key =;= added to be consistent with ~org-toggle-comment~ (=C (cl-pushnew key org-speed-commands)) #+end_src -Add ='= key to edit org source blocks, which is consistent with ~org-edit-special~ (=C-c '=). +Add ='= shortcut key to edit source blocks, which is consistent with ~org-edit-special~ (=C-c '=). #+begin_src elisp (cl-pushnew '("'" . org-edit-src-code) org-babel-key-bindings) #+end_src @@ -536,6 +545,15 @@ Enable supported org babel languages. (cl-pushnew `(,lang . t) org-babel-load-languages)) #+end_src +Redisplay images when executing an org block. +#+begin_src elisp + (with-eval-after-load 'ob-core + (add-hook 'org-babel-after-execute-hook + (lambda () "Redisplay Org inline images." + (when org-inline-image-overlays + (org-redisplay-inline-images))))) +#+end_src + *** Org LaTeX Use SVG LaTeX previews. #+begin_src elisp |
