From 663e417c2f3da45a2a6dc004d2d1d0b8a7d6e9b4 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Fri, 22 Dec 2023 09:58:29 -0500 Subject: [PATCH] emacs-configuration: Variety of minor additions and changes * user-config/emacs/.emacs.d/config.org: (Email - Mu4e): Remove stale TODO comment. Setup mu4e org support when in header view. (Org Mode): No longer defer loading of org-mode. Add koma-letter support. Automatically give all capture entries an id. (Setup org-projectile): Add org-projectile-todo-files not only to org-agenda-files, but also to org-refile-targets. (Setup org-roam): Adjust org-capture-templates. (Setup org-ql): Load org-ql after org-mode (Setup helm-org-ql): Do not load after helm and org-ql. (Docker): Move docker related configurations to their own section --- user-config/emacs/.emacs.d/config.org | 89 +++++++++++++++------------ 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/user-config/emacs/.emacs.d/config.org b/user-config/emacs/.emacs.d/config.org index c33f43a..e9a98c9 100644 --- a/user-config/emacs/.emacs.d/config.org +++ b/user-config/emacs/.emacs.d/config.org @@ -1018,7 +1018,6 @@ Leverage [[https://github.com/seagle0128/all-the-icons-ibuffer][all-the-icons-ib #+begin_src emacs-lisp ;; Setup email using mu4e (mbsync in the background) and smtpmail (use-package mu4e - ; TODO: bug found when switching to guix powered emacs :init (setq mu4e~main-buffer-name "*mu4e*") :config (progn (setq mail-user-agent 'mu4e-user-agent @@ -1034,6 +1033,11 @@ Leverage [[https://github.com/seagle0128/all-the-icons-ibuffer][all-the-icons-ib mu4e-view-show-images t mu4e-view-image-max-width 800 + ;; Enable org-mode support (enabled by default) + mu4e-support-org t + ;; When in headers view, link to the query, not the message at point + mu4e-org-link-query-in-headers-mode t + mml-secure-openpgp-sign-with-sender t message-cite-style message-cite-style-gmail @@ -1813,7 +1817,6 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate #+begin_src emacs-lisp (use-package org - :defer t :custom org-modules (append '(org-habit) org-modules) :config (progn (setq org-directory "~/.org" @@ -1849,7 +1852,11 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate ;; See: https://emacs.stackexchange.com/questions/32617/how-to-jump-directly-to-an-org-headline org-goto-interface 'outline-path-completion + ;; Do not save archive file automatically (this allows for a nicer recursive archiving, with large encrypted org files) + org-archive-subtree-save-file-p nil + org-return-follows-link t + org-id-link-to-org-use-id 'use-existing org-log-done 'time org-src-fontify-natively t org-enforce-todo-dependencies t @@ -1874,18 +1881,25 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate ;; Enable markdown export (require 'ox-md) + ;; Enable koma-letter support + ;; See: https://orgmode.org/worg/exporters/koma-letter-export.html + (require 'ox-koma-letter) + (setq org-agenda-files (let ((agenda-dir "~/.org/roam/agenda") (agenda-files '("~/.emacs.d/config.org"))) (append ;; Include manually specified agenda-files agenda-files - ;; Include all *.org{,.gpg} files in agenda-dir (if (file-directory-p agenda-dir) - (directory-files-recursively - agenda-dir - "^[.-a-zA-Z]+\.org\\(\.gpg\\)?$" t t)))) + (let* ((all-org-agenda-dir-files (directory-files-recursively + agenda-dir + "^[.-a-zA-Z]+\.org\\(\.gpg\\)?$" t t)) + (all-org-agenda-dir-archive-files (seq-filter (apply-partially #'string-match (concat "^" agenda-dir "[.-a-zA-Z]+\-archive.org\\(\.gpg\\)?$")) all-org-agenda-dir-files)) + (all-org-agenda-dir-files-sans-archive-files (cl-set-difference all-org-agenda-dir-files all-org-agenda-dir-archive-files))) + (append all-org-agenda-dir-files-sans-archive-files + all-org-agenda-dir-archive-files))))) org-refile-targets `((nil :maxlevel . 5) (,org-agenda-files :maxlevel . 3))) @@ -1959,6 +1973,9 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate ;; "* %?\n Entered on %U\n %i\n %a") )) + ;; Automatically give all capture entries an id + (add-hook 'org-capture-mode-hook #'org-id-get-create) + ;; Use minted (requires python package pygments) for exported source code listings when using ;; pdflatex ;; See: https://emacs.stackexchange.com/questions/27154/exporting-highlighted-source-code-to-pdf-in-org-mode @@ -2035,12 +2052,13 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate #+begin_src emacs-lisp (use-package org-projectile :bind (("C-c f p" . org-projectile-project-todo-completing-read)) - :after org :config (progn (setq org-projectile-projects-file - "~/.org/roam/20210111004034-projects.org") - (setq org-agenda-files (append org-agenda-files (org-projectile-todo-files))) + "~/.org/roam/20210111004034-projects.org") + (setq org-agenda-files (append org-agenda-files (org-projectile-todo-files)) + org-refile-targets `((nil :maxlevel . 5) + (,org-agenda-files :maxlevel . 3))) (add-to-list 'org-capture-templates (org-projectile-project-todo-entry) t))) #+end_src @@ -2078,28 +2096,15 @@ Use [[http://gnuplot.sourceforge.net/][gnuplot]] alongside org-mode to generate '(("d" "default" plain "%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} - ") + ") :unnarrowed t) - ("p" "person" plain "%?" - :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title} - ,#+filetags: person - ") - :unnarrowed t) - ("b" "book" plain "%?" - :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title} - ${url} - ,#+filetags: book - ") - :unnarrowed t) - ("w" "web" plain "%?" - :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title} - ${url} - ,#+filetags: ${tags} - ") - :unnarrowed t))) + ("p" "person" entry "* %^{name}%?" + :target (node "863ddb0b-ed30-4cf6-86c7-915afda0c0d1")) + ("b" "book" entry "* %^{name}%?" + :target (node "64a98813-bdf8-4813-9f4e-e1153170ffa9")) + ("s" "software" entry "* %^{name} + %?" + :target (node "d0c93085-3e96-4f4b-ad83-ced92cf4de33")))) (org-roam-dailies-directory "") (org-roam-dailies-capture-templates '(("d" "default" entry "* %?" :target (file+datetree "dailies.org.gpg" week)))) @@ -2173,6 +2178,7 @@ via the customize variable ~org-roam-encrypt-files~. ("C-c f A" . org-ql-find-in-agenda) ("C-c f s" . org-ql-search) ("C-c f v" . org-ql-view)) + :after org :custom (org-ql-search-directories-files-recursive t) (org-ql-views @@ -2279,11 +2285,14 @@ via the customize variable ~org-roam-encrypt-files~. 'help-echo "Tasks with sub-tasks but no NEXT sub-tasks") :sort '(date priority) :super-groups 'org-super-agenda-groups))))) +#+end_src +**** Setup [[https://github.com/alphapapa/org-ql/blob/master/helm-org-ql.el][helm-org-ql]] + +#+begin_src emacs-lisp (use-package helm-org-ql :bind (("C-c f d" . helm-org-ql-org-directory) - ("C-c f a" . helm-org-ql-agenda-files)) - :after (helm org-ql)) + ("C-c f a" . helm-org-ql-agenda-files))) #+end_src *** Setup [[https://github.com/weirdNox/org-noter][org-noter]] @@ -2463,12 +2472,6 @@ via the customize variable ~org-roam-encrypt-files~. :after flycheck) #+end_src -** Dockerfile - -#+begin_src emacs-lisp - (use-package dockerfile-mode) -#+end_src - ** Dashboard Use [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]]. @@ -2841,7 +2844,6 @@ be further investigated. '(add-to-list 'ac-modes 'latex-mode)) (use-package auctex - :defer t :functions TeX-global-PDF-mode :hook ((LaTeX-mode . visual-line-mode) (LaTeX-mode . LaTeX-math-mode) @@ -2895,13 +2897,18 @@ This is not yet packaged for guix. :defer t) #+end_src -** TODO Docker :needs_review: +** TODO Docker :needs_review: + +#+begin_src emacs-lisp + (use-package dockerfile-mode) +#+end_src #+begin_src emacs-lisp - ;; TODO: What is this? (use-package docker :bind ("C-c D" . docker)) +#+end_src +#+begin_src emacs-lisp (use-package docker-compose-mode :disabled ;; TODO: auto-completion does not seem to work using this package :defer t)