Fixing loading order of org, elfeed, mu4e

This commit is contained in:
Chris Cochrun 2021-03-01 06:35:46 -06:00
parent 8f70724127
commit 5abf35e341
2 changed files with 167 additions and 162 deletions

View file

@ -23,8 +23,8 @@
- [[#eshell][Eshell]]
- [[#pdf-tools][PDF-Tools]]
- [[#window-management][Window Management]]
- [[#garbage-collection][Garbage Collection]]
- [[#elfeed][Elfeed]]
- [[#garbage-collection][Garbage Collection]]
- [[#early-init][Early Init]]
* Init
@ -568,6 +568,7 @@ We need a function to copy the full filename to kill-ring
:after dired
:config (diredfl-global-mode +1))
#+end_src
*** Tramp
#+begin_src emacs-lisp
(require 'tramp)
@ -576,6 +577,7 @@ We need a function to copy the full filename to kill-ring
(add-to-list 'tramp-default-proxies-alist
'((regexp-quote (system-name)) nil nil))
#+end_src
** Org Mode
Let's start by creating a self contained function of what I'd like started on every org buffer.
#+begin_src emacs-lisp
@ -584,7 +586,8 @@ Let's start by creating a self contained function of what I'd like started on ev
(org-indent-mode +1)
(toc-org-mode +1)
(olivetti-mode +1)
(display-line-numbers-mode -1))
(display-line-numbers-mode -1)
(variable-pitch-mode +1))
#+end_src
This is the use-package definition with a lot of customization. Need to setup auto tangle and make sure I have some structure templates for org-mode.
@ -595,15 +598,15 @@ Part of this config includes some special capture templates for my work as a you
:straight (:type built-in)
:config
(setq org-startup-indented t
org-edit-src-content-indentation 0
org-agenda-sticky t)
org-edit-src-content-indentation 0
org-agenda-sticky t)
(add-hook 'org-mode-hook 'chris/org-mode-setup)
(org-babel-do-load-languages 'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(shell . t)))
'((emacs-lisp . t)
(python . t)
(shell . t)))
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
@ -612,44 +615,44 @@ Part of this config includes some special capture templates for my work as a you
(add-to-list 'org-structure-template-alist '("q" . "quote"))
(setq org-capture-templates
'(("t" "Personal todo" entry
(file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry
(file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file)
"* %U %?\n%i\n%a" :prepend t)
("p" "TFC Plan" entry
(function chris/org-roam-capture-lesson-file)
(file ".templates/tfcplantemplate.org")
:prepend nil
:jump-to-captured t
:empty-lines 1)
("P" "TFC Posts" entry
(file+headline "/home/chris/org/nvtfc_social_media.org" "Posts")
(file ".templates/posts.org")
:prepend t
:jump-to-captured t)
("r" "Templates for projects")
("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox")
"* %U %?\n%i\n%a" :prepend t)
("rc" "Project-local changelog" entry
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t)
("o" "Centralized templates for projects")
("ot" "Project todo" entry #'+org-capture-central-project-todo-file
"* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
("on" "Project notes" entry #'+org-capture-central-project-notes-file
"* %U %?\n %i\n %a" :heading "Notes" :prepend t)
("oc" "Project changelog" entry #'+org-capture-central-project-changelog-file
"* %U %?\n %i\n %a" :heading "Changelog" :prepend t))
org-capture-use-agenda-date t)
'(("t" "Personal todo" entry
(file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry
(file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file)
"* %U %?\n%i\n%a" :prepend t)
("p" "TFC Plan" entry
(function chris/org-roam-capture-lesson-file)
(file ".templates/tfcplantemplate.org")
:prepend nil
:jump-to-captured t
:empty-lines 1)
("P" "TFC Posts" entry
(file+headline "/home/chris/org/nvtfc_social_media.org" "Posts")
(file ".templates/posts.org")
:prepend t
:jump-to-captured t)
("r" "Templates for projects")
("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox")
"* %U %?\n%i\n%a" :prepend t)
("rc" "Project-local changelog" entry
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t)
("o" "Centralized templates for projects")
("ot" "Project todo" entry #'+org-capture-central-project-todo-file
"* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
("on" "Project notes" entry #'+org-capture-central-project-notes-file
"* %U %?\n %i\n %a" :heading "Notes" :prepend t)
("oc" "Project changelog" entry #'+org-capture-central-project-changelog-file
"* %U %?\n %i\n %a" :heading "Changelog" :prepend t))
org-capture-use-agenda-date t)
;;(setq org-superstar-headline-bullets-list '("◉" "◈" "▸" "✬" "◎" "◇" "❉" "✙" "❖"))
(setq org-imenu-depth 4)
@ -659,19 +662,19 @@ Part of this config includes some special capture templates for my work as a you
(setq org-export-with-author nil)
(setq org-todo-keywords
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
(setq org-agenda-files
'("/home/chris/org/inbox.org"
"/home/chris/org/notes.org"
"/home/chris/org/repetition.org"
"/home/chris/org/tasks.org"
"/home/chris/org/tfc_plans.org"
"/home/chris/org/ministry_team.org"
"/home/chris/org/todo.org"
"/home/chris/org/newsletter.org"))
'("/home/chris/org/inbox.org"
"/home/chris/org/notes.org"
"/home/chris/org/repetition.org"
"/home/chris/org/tasks.org"
"/home/chris/org/tfc_plans.org"
"/home/chris/org/ministry_team.org"
"/home/chris/org/todo.org"
"/home/chris/org/newsletter.org"))
(setq org-id-method 'ts)
@ -691,21 +694,35 @@ Part of this config includes some special capture templates for my work as a you
(olivetti-mode +1))
(add-hook 'org-agenda-finalize-hook 'evil-normal-state)
;;Let's make sure org-mode faces are inheriting fixed pitch faces.
(dolist (face '(org-block
org-block-begin-line
org-block-end-line
org-code
org-document-info-keyword
org-meta-line
org-table
org-verbatim))
(set-face-attribute `,face nil :inherit 'fixed-pitch))
(set-face-attribute 'org-block-end-line nil :inherit 'org-block-begin-line)
:general
(chris/leader-keys
"o a" 'org-agenda
"c" 'org-capture
"so" 'consult-outline)
('normal org-agenda-mode-map
"q" 'org-agenda-quit
"r" 'org-agenda-redo)
"q" 'org-agenda-quit
"r" 'org-agenda-redo)
('normal org-columns-map
"j" 'outline-next-heading
"h" 'outline-previous-heading
"q" 'chris/org-columns-quit)
"j" 'outline-next-heading
"h" 'outline-previous-heading
"q" 'chris/org-columns-quit)
('normal org-mode-map
"RET" 'chris/org-dwim-at-point
"gC" 'chris/org-columns-view))
"RET" 'chris/org-dwim-at-point
"gC" 'chris/org-columns-view))
#+end_src
We need to create a lesson capture function to find our lesson files differently each time we run our TFC plan capture. This is the most unique part of my capture template. This function uses =org-roam-find-file= to pick the lesson file that I need to add my lesson plan to. This way the lesson itself is created before the plan.
@ -741,21 +758,7 @@ We also need to add =evil-org= to make better keybindings.
:after org)
#+end_src
Let's make sure org-mode faces are inheriting fixed pitch faces.
#+begin_src emacs-lisp
(eval-after-load 'org
(dolist (face '(org-block
org-block-begin-line
org-block-end-line
org-code
org-document-info-keyword
org-meta-line
org-table
org-verbatim))
(set-face-attribute `,face nil :inherit 'fixed-pitch)))
(eval-after-load 'org
(set-face-attribute 'org-block-end-line nil :inherit 'org-block-begin-line))
#+end_src
*** Org-Super-Agenda
Super Agenda gives me a really nice way of making the agenda view look a lot better with some better information included.
#+begin_src emacs-lisp
@ -788,7 +791,7 @@ We also need to setup some capture templates to use some specific setups with my
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:after org
:hook (org-load . org-roam-mode)
:hook org-load
:commands (org-roam org-roam-find-file)
:config
(setq org-roam-directory "~/org")
@ -1288,13 +1291,6 @@ Let's use pdf-tools for a lot better interaction with pdfs.
(side . right))))
#+end_src
** Garbage Collection
We set the =gc-cons-threshold= variable to really high, now lets set it back low to make sure emacs performs properly.
#+begin_src emacs-lisp
(setq gc-cons-threshold 2000000)
#+end_src
** Elfeed
#+begin_src emacs-lisp
(use-package elfeed
@ -1311,6 +1307,13 @@ We set the =gc-cons-threshold= variable to really high, now lets set it back low
(setq rmh-elfeed-org-files (list "~/org/elfeed.org")))
#+end_src
** Garbage Collection
We set the =gc-cons-threshold= variable to really high, now lets set it back low to make sure emacs performs properly.
#+begin_src emacs-lisp
(setq gc-cons-threshold 2000000)
#+end_src
* Early Init
:PROPERTIES:
:header-args: emacs-lisp :tangle early-init.el

156
init.el
View file

@ -341,21 +341,22 @@ vertically."
(org-indent-mode +1)
(toc-org-mode +1)
(olivetti-mode +1)
(display-line-numbers-mode -1))
(display-line-numbers-mode -1)
(variable-pitch-mode +1))
(use-package org
:straight (:type built-in)
:config
(setq org-startup-indented t
org-edit-src-content-indentation 0
org-agenda-sticky t)
org-edit-src-content-indentation 0
org-agenda-sticky t)
(add-hook 'org-mode-hook 'chris/org-mode-setup)
(org-babel-do-load-languages 'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(shell . t)))
'((emacs-lisp . t)
(python . t)
(shell . t)))
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
@ -364,44 +365,44 @@ vertically."
(add-to-list 'org-structure-template-alist '("q" . "quote"))
(setq org-capture-templates
'(("t" "Personal todo" entry
(file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry
(file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file)
"* %U %?\n%i\n%a" :prepend t)
("p" "TFC Plan" entry
(function chris/org-roam-capture-lesson-file)
(file ".templates/tfcplantemplate.org")
:prepend nil
:jump-to-captured t
:empty-lines 1)
("P" "TFC Posts" entry
(file+headline "/home/chris/org/nvtfc_social_media.org" "Posts")
(file ".templates/posts.org")
:prepend t
:jump-to-captured t)
("r" "Templates for projects")
("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox")
"* %U %?\n%i\n%a" :prepend t)
("rc" "Project-local changelog" entry
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t)
("o" "Centralized templates for projects")
("ot" "Project todo" entry #'+org-capture-central-project-todo-file
"* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
("on" "Project notes" entry #'+org-capture-central-project-notes-file
"* %U %?\n %i\n %a" :heading "Notes" :prepend t)
("oc" "Project changelog" entry #'+org-capture-central-project-changelog-file
"* %U %?\n %i\n %a" :heading "Changelog" :prepend t))
org-capture-use-agenda-date t)
'(("t" "Personal todo" entry
(file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry
(file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file)
"* %U %?\n%i\n%a" :prepend t)
("p" "TFC Plan" entry
(function chris/org-roam-capture-lesson-file)
(file ".templates/tfcplantemplate.org")
:prepend nil
:jump-to-captured t
:empty-lines 1)
("P" "TFC Posts" entry
(file+headline "/home/chris/org/nvtfc_social_media.org" "Posts")
(file ".templates/posts.org")
:prepend t
:jump-to-captured t)
("r" "Templates for projects")
("rt" "Project-local todo" entry
(file+headline +org-capture-project-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("rn" "Project-local notes" entry
(file+headline +org-capture-project-notes-file "Inbox")
"* %U %?\n%i\n%a" :prepend t)
("rc" "Project-local changelog" entry
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i\n%a" :prepend t)
("o" "Centralized templates for projects")
("ot" "Project todo" entry #'+org-capture-central-project-todo-file
"* TODO %?\n %i\n %a" :heading "Tasks" :prepend nil)
("on" "Project notes" entry #'+org-capture-central-project-notes-file
"* %U %?\n %i\n %a" :heading "Notes" :prepend t)
("oc" "Project changelog" entry #'+org-capture-central-project-changelog-file
"* %U %?\n %i\n %a" :heading "Changelog" :prepend t))
org-capture-use-agenda-date t)
;;(setq org-superstar-headline-bullets-list '("◉" "◈" "▸" "✬" "◎" "◇" "❉" "✙" "❖"))
(setq org-imenu-depth 4)
@ -411,19 +412,19 @@ vertically."
(setq org-export-with-author nil)
(setq org-todo-keywords
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
'((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "CNCL(c)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)")))
(setq org-agenda-files
'("/home/chris/org/inbox.org"
"/home/chris/org/notes.org"
"/home/chris/org/repetition.org"
"/home/chris/org/tasks.org"
"/home/chris/org/tfc_plans.org"
"/home/chris/org/ministry_team.org"
"/home/chris/org/todo.org"
"/home/chris/org/newsletter.org"))
'("/home/chris/org/inbox.org"
"/home/chris/org/notes.org"
"/home/chris/org/repetition.org"
"/home/chris/org/tasks.org"
"/home/chris/org/tfc_plans.org"
"/home/chris/org/ministry_team.org"
"/home/chris/org/todo.org"
"/home/chris/org/newsletter.org"))
(setq org-id-method 'ts)
@ -443,21 +444,35 @@ vertically."
(olivetti-mode +1))
(add-hook 'org-agenda-finalize-hook 'evil-normal-state)
;;Let's make sure org-mode faces are inheriting fixed pitch faces.
(dolist (face '(org-block
org-block-begin-line
org-block-end-line
org-code
org-document-info-keyword
org-meta-line
org-table
org-verbatim))
(set-face-attribute `,face nil :inherit 'fixed-pitch))
(set-face-attribute 'org-block-end-line nil :inherit 'org-block-begin-line)
:general
(chris/leader-keys
"o a" 'org-agenda
"c" 'org-capture
"so" 'consult-outline)
('normal org-agenda-mode-map
"q" 'org-agenda-quit
"r" 'org-agenda-redo)
"q" 'org-agenda-quit
"r" 'org-agenda-redo)
('normal org-columns-map
"j" 'outline-next-heading
"h" 'outline-previous-heading
"q" 'chris/org-columns-quit)
"j" 'outline-next-heading
"h" 'outline-previous-heading
"q" 'chris/org-columns-quit)
('normal org-mode-map
"RET" 'chris/org-dwim-at-point
"gC" 'chris/org-columns-view))
"RET" 'chris/org-dwim-at-point
"gC" 'chris/org-columns-view))
(defun chris/org-roam-capture-lesson-file ()
"Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion"
@ -483,19 +498,6 @@ vertically."
(use-package evil-org
:after org)
(eval-after-load 'org
(dolist (face '(org-block
org-block-begin-line
org-block-end-line
org-code
org-document-info-keyword
org-meta-line
org-table
org-verbatim))
(set-face-attribute `,face nil :inherit 'fixed-pitch)))
(eval-after-load 'org
(set-face-attribute 'org-block-end-line nil :inherit 'org-block-begin-line))
(use-package org-super-agenda
:after org-agenda
:init
@ -517,7 +519,7 @@ vertically."
(use-package org-roam
:after org
:hook (org-load . org-roam-mode)
:hook org-load
:commands (org-roam org-roam-find-file)
:config
(setq org-roam-directory "~/org")
@ -976,8 +978,6 @@ If on a:
(window-width . 0.4)
(side . right))))
(setq gc-cons-threshold 2000000)
(use-package elfeed
:commands (elfeed)
:general
@ -988,3 +988,5 @@ If on a:
:after elfeed
:config
(setq rmh-elfeed-org-files (list "~/org/elfeed.org")))
(setq gc-cons-threshold 2000000)