From f6a1ec5f84ed246205c55d55092b2140a27f245b Mon Sep 17 00:00:00 2001 From: Raul Benencia Date: Sun, 12 Feb 2023 14:56:00 -0800 Subject: emacs: auto-load config files --- .emacs | 1 - .emacs.local.d/config.el | 17 -------------- .emacs.local.d/config/rul-config-mail.el | 15 ++++++++++++ .emacs.local.d/config/rul-config-org.el | 19 +++++++++++++++ .emacs.local.d/config/rul-config-projectile.el | 2 ++ .emacs.local.d/mail.el | 13 ----------- .emacs.local.d/modes/notmuch.el | 32 +------------------------- .emacs.local.d/modes/org-journal.el | 1 + .emacs.local.d/modes/org-roam.el | 1 + .emacs.local.d/modes/org.el | 2 ++ .emacs.local.d/modes/projectile.el | 1 + 11 files changed, 42 insertions(+), 62 deletions(-) delete mode 100644 .emacs.local.d/config.el create mode 100644 .emacs.local.d/config/rul-config-mail.el create mode 100644 .emacs.local.d/config/rul-config-org.el create mode 100644 .emacs.local.d/config/rul-config-projectile.el delete mode 100644 .emacs.local.d/mail.el diff --git a/.emacs b/.emacs index b9f70e0..ced6f19 100644 --- a/.emacs +++ b/.emacs @@ -1,7 +1,6 @@ (add-to-list 'load-path "~/.emacs.local.d/config/") ;; Load up the general config -(load-file "~/.emacs.local.d/config.el") (load-file "~/.emacs.local.d/general.el") (load-file "~/.emacs.local.d/mail.el") diff --git a/.emacs.local.d/config.el b/.emacs.local.d/config.el deleted file mode 100644 index 876fcb4..0000000 --- a/.emacs.local.d/config.el +++ /dev/null @@ -1,17 +0,0 @@ -(setq - my-org-agenda-files '("~/org/") - my-org-agenda-custom-commands - '(("x" agenda) - ("y" agenda*) - ("w" todo "WAITING") - ("W" todo-tree "WAITING") - ) - my-org-journal-file-type 'yearly - my-org-journal-dir "~/org/journal/" - my-org-journal-file-format "%Y.org" - my-org-journal-time-prefix "* " - my-org-journal-time-format "" - my-org-refile-path "~/refile.org" - my-org-roam-directory "~/org/roam/" - my-projectile-project-search-path '("~/src/") -) diff --git a/.emacs.local.d/config/rul-config-mail.el b/.emacs.local.d/config/rul-config-mail.el new file mode 100644 index 0000000..143bbc3 --- /dev/null +++ b/.emacs.local.d/config/rul-config-mail.el @@ -0,0 +1,15 @@ +;; Mutt support. +(setq auto-mode-alist (append '((".*tmp/mutt.*" . message-mode)) auto-mode-alist)) +(setq auto-mode-alist (append '((".*tmp/neomutt.*" . message-mode)) auto-mode-alist)) + +;; Hook up `mutt:...` style URLs +(use-package ol-notmuch :ensure t) +(org-add-link-type "message" 'org-notmuch-open) + +(setq send-mail-function 'sendmail-send-it + sendmail-program "/usr/bin/msmtp" + mail-specify-envelope-from t + message-sendmail-envelope-from 'header + mail-envelope-from 'header) + +(provide 'rul-config-mail) diff --git a/.emacs.local.d/config/rul-config-org.el b/.emacs.local.d/config/rul-config-org.el new file mode 100644 index 0000000..020efa4 --- /dev/null +++ b/.emacs.local.d/config/rul-config-org.el @@ -0,0 +1,19 @@ +(setq + my-org-agenda-files '("~/org/") + my-org-agenda-custom-commands + '(("x" agenda) + ("y" agenda*) + ("w" todo "WAITING") + ("W" todo-tree "WAITING") + ) + my-org-journal-file-type 'yearly + my-org-journal-dir "~/org/journal/" + my-org-journal-file-format "%Y.org" + my-org-journal-time-prefix "* " + my-org-journal-time-format "" + my-org-refile-path "~/refile.org" + my-org-roam-directory "~/org/roam/" + ) + +(provide 'rul-config-org) + diff --git a/.emacs.local.d/config/rul-config-projectile.el b/.emacs.local.d/config/rul-config-projectile.el new file mode 100644 index 0000000..3922c8f --- /dev/null +++ b/.emacs.local.d/config/rul-config-projectile.el @@ -0,0 +1,2 @@ +(setq my-projectile-project-search-path '("~/src/")) +(provide 'rul-config-projectile) diff --git a/.emacs.local.d/mail.el b/.emacs.local.d/mail.el deleted file mode 100644 index cee35a5..0000000 --- a/.emacs.local.d/mail.el +++ /dev/null @@ -1,13 +0,0 @@ -;; Mutt support. -(setq auto-mode-alist (append '((".*tmp/mutt.*" . message-mode)) auto-mode-alist)) -(setq auto-mode-alist (append '((".*tmp/neomutt.*" . message-mode)) auto-mode-alist)) - -;; Hook up `mutt:...` style URLs -(use-package ol-notmuch :ensure t) -(org-add-link-type "message" 'org-notmuch-open) - -(setq send-mail-function 'sendmail-send-it - sendmail-program "/usr/bin/msmtp" - mail-specify-envelope-from t - message-sendmail-envelope-from 'header - mail-envelope-from 'header) diff --git a/.emacs.local.d/modes/notmuch.el b/.emacs.local.d/modes/notmuch.el index f4ed127..5a5c9a9 100644 --- a/.emacs.local.d/modes/notmuch.el +++ b/.emacs.local.d/modes/notmuch.el @@ -2,37 +2,7 @@ ;; notmuch mode ;; -------- (require 'notmuch) - -;; This should be upstream -(require 'notmuch-show) -(require 'notmuch-tag) -(defun notmuch-tree-show-message-in () - "Show the current message (in split-pane)." - (interactive) - (let ((id (notmuch-tree-get-message-id)) - (inhibit-read-only t) - buffer) - (when id - ;; We close and reopen the window to kill off un-needed buffers - ;; this might cause flickering but seems ok. - (notmuch-tree-close-message-window) - (setq notmuch-tree-message-window - (split-window-vertically (/ (window-height) 4))) - (with-selected-window notmuch-tree-message-window - ;; Since we are only displaying one message do not indent. - (let ((notmuch-show-indent-messages-width 0) - (notmuch-show-only-matching-messages t)) - (setq buffer (notmuch-show id)))) - ;; We need the `let' as notmuch-tree-message-window is buffer local. - (let ((window notmuch-tree-message-window)) - (with-current-buffer buffer - (setq notmuch-tree-message-window window) - (add-hook 'kill-buffer-hook 'notmuch-tree-message-window-kill-hook))) - (when notmuch-show-mark-read-tags - (notmuch-tree-tag-update-display notmuch-show-mark-read-tags) - (notmuch-tree-tag notmuch-show-mark-read-tags)) - (setq notmuch-tree-message-buffer buffer)))) -;; End upstream +(require 'rul-config-mail) ;; Keymaps (defun rul/capture-mail() diff --git a/.emacs.local.d/modes/org-journal.el b/.emacs.local.d/modes/org-journal.el index 5bc2671..7bf217d 100644 --- a/.emacs.local.d/modes/org-journal.el +++ b/.emacs.local.d/modes/org-journal.el @@ -6,6 +6,7 @@ (setq org-journal-file-format my-org-journal-file-format) (setq org-journal-enable-agenda-integration t) :config + (require 'rul-config-org) (setq org-journal-dir my-org-journal-dir org-journal-file-type my-org-journal-file-type org-journal-time-prefix my-org-journal-time-prefix diff --git a/.emacs.local.d/modes/org-roam.el b/.emacs.local.d/modes/org-roam.el index dd19ad8..422eb93 100644 --- a/.emacs.local.d/modes/org-roam.el +++ b/.emacs.local.d/modes/org-roam.el @@ -8,6 +8,7 @@ ("C-c n f" . org-roam-node-find) ("C-c n i" . org-roam-node-insert)) :config + (require 'rul-config-org) (org-roam-setup) (add-to-list 'display-buffer-alist '("\\*org-roam\\*" diff --git a/.emacs.local.d/modes/org.el b/.emacs.local.d/modes/org.el index c003b6c..51b269e 100644 --- a/.emacs.local.d/modes/org.el +++ b/.emacs.local.d/modes/org.el @@ -7,6 +7,8 @@ (require 'org-modern) +(require 'rul-config-org) + ;; -------- ;; Org mode ;; -------- diff --git a/.emacs.local.d/modes/projectile.el b/.emacs.local.d/modes/projectile.el index ed95775..df85aec 100644 --- a/.emacs.local.d/modes/projectile.el +++ b/.emacs.local.d/modes/projectile.el @@ -4,5 +4,6 @@ :hook (after-init . projectile-global-mode) :config + (require 'rul-config-projectile) (setq projectile-completion-system 'ivy) ) -- cgit v1.2.3