Switch to use-package defer by default

Change org-journal to monthly files

Slightly adjust load order and dependencies for calendar, org-journal,
org-agenda, etc... to make sure binds are still properly defined
This commit is contained in:
Evie Litherland-Smith 2025-01-22 11:26:09 +00:00
parent 7e21825c41
commit 984a2d5c9c
2 changed files with 20 additions and 31 deletions

View file

@ -3,6 +3,7 @@
;;; Code:
(setq use-package-check-before-init t
use-package-enable-imenu-support t
use-package-always-defer t
base16-theme-distinct-fringe-background t
base16-theme-highlight-mode-line 'contrast)

50
init.el
View file

@ -27,7 +27,6 @@
(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")))
(use-package secrets
:defer t
:functions (secrets-get-secret))
(setq-default truncate-lines t
@ -79,7 +78,6 @@
(use-package nerd-icons
:if (package-installed-p 'nerd-icons)
:demand t
:functions (nerd-icons-octicon))
(use-package nerd-icons-dired
@ -146,7 +144,6 @@
'("^/tdrive" . "/smb:elitherl%ccfepc@msrv-cfshare.ccfepc.ccfe.ac.uk:/NewT/"))
(use-package tramp
:defer t
:defines (tramp-remote-path tramp-default-proxies-alist)
:custom
(tramp-default-method "sshx")
@ -175,7 +172,6 @@
(appt-display-format 'echo))
(use-package calendar
:after appt
:bind (("C-c >" . calendar))
:hook ((calendar-today-visible . calendar-mark-today))
:custom
@ -184,19 +180,19 @@
(calendar-mark-diary-entries-flag nil)
(calendar-view-holidays-initially-flag nil)
(calendar-view-diary-initially-flag nil)
:config
(appt-activate +1)
:init
(add-to-list 'display-buffer-alist
'("\\*Calendar\\*"
(display-buffer-in-side-window)
(side . bottom)
(slot . 0)
(window-height . 0.2)
(window-parameters . ((no-delete-other-windows . t))))))
(window-parameters . ((no-delete-other-windows . t)))))
:config
(require 'org-journal nil :noerror))
(use-package khalel
:if (package-installed-p 'khalel)
:after (appt org)
:commands (khalel-run-vdirsyncer khalel-import-events khalel-add-capture-template)
:custom
(khalel-default-alarm "30")
@ -399,9 +395,7 @@
(keymap-global-set "<remap> <downcase-word>" 'downcase-dwim)
(use-package savehist
:demand
:config
(savehist-mode +1))
:init (savehist-mode +1))
(use-package dired
:functions (dired-omit-mode)
@ -426,7 +420,6 @@
(keymap-global-set "C-h K" #'describe-keymap)
(use-package text-mode
:defer t
:custom
(text-mode-ispell-word-completion nil))
@ -514,9 +507,7 @@
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))
(use-package winner
:demand
:config
(winner-mode))
:init (winner-mode +1))
(use-package ediff
:custom
@ -660,13 +651,13 @@
(use-package org-journal
:if (package-installed-p 'org-journal)
:after org
:demand
:defines (org-journal-dir)
:bind ("C-c n d" . org-journal-new-entry)
:custom
(org-journal-dir (expand-file-name "journal" org-directory))
(org-journal-file-header "#+category: Journal")
(org-journal-file-type 'yearly)
(org-journal-file-format "%Y.org")
(org-journal-file-type 'monthly)
(org-journal-file-format "%Y-%m_%B.org")
(org-journal-date-format "%A, %F"))
(use-package org-clock
@ -687,7 +678,7 @@
(org-habit-show-habits-only-for-today t))
(use-package org-agenda
:after (appt org-journal)
:after org
:bind (("C-c a" . org-agenda))
:hook ((org-agenda-mode . (lambda () (visual-line-mode -1)))
(org-agenda-finalize . org-agenda-to-appt))
@ -711,11 +702,12 @@
(tags . " %-12:c")
(search . " %-12:c")))
(org-agenda-file-regexp "\\`[^.].*\\.org\\\(\\.gpg\\\)?\\'")
(org-agenda-files (list
(expand-file-name org-directory)
(expand-file-name org-journal-dir)))
(org-agenda-files (list (expand-file-name org-directory)))
:config
(require 'appt)
(require 'khalel)
(require 'org-journal)
(add-to-list 'org-agenda-files (expand-file-name org-journal-dir))
(khalel-import-events)
(appt-activate +1)
(org-agenda-to-appt)
@ -981,7 +973,6 @@
(envrc-show-summary-in-minibuffer t))
(use-package gud
:defer t
:defines gdb-many-windows
:config
(setq gdb-many-windows t))
@ -995,7 +986,9 @@
:after treesit
:functions (treesit-auto-add-to-auto-mode-alist
global-treesit-auto-mode)
:hook (after-init . (lambda () (global-treesit-auto-mode +1)))
:hook (after-init . (lambda ()
(require 'treesit-auto)
(global-treesit-auto-mode +1)))
:config
(treesit-auto-add-to-auto-mode-alist))
@ -1176,8 +1169,7 @@
:hook python-base-mode)
(use-package python-pytest
:if (package-installed-p 'python-pytest)
:defer t)
:if (package-installed-p 'python-pytest))
(use-package files
:custom
@ -1185,7 +1177,6 @@
(enable-remote-dir-locals t))
(use-package doc-view
:defer t
:bind ( :map doc-view-mode-map
("<mouse-8>" . doc-view-previous-page)
("<mouse-9>" . doc-view-next-page))
@ -1196,7 +1187,6 @@
(use-package auctex
:if (package-installed-p 'auctex)
:defer t
:custom
(TeX-Engine 'luatex))
@ -1213,7 +1203,6 @@
(set-face-attribute 'markdown-comment-face nil :inherit 'variable-pitch))
(use-package eww
:defer t
:custom
(browse-url-browser-function 'browse-url-default-browser)
(browse-url-secondary-browser-function 'browse-url-default-browser)
@ -1223,8 +1212,7 @@
(eww-browse-url-new-window-is-tab nil))
(use-package scad-mode
:if (package-installed-p 'scad-mode)
:defer t)
:if (package-installed-p 'scad-mode))
;; Scratch buffer shortcut
(keymap-global-set "C-c w x" #'scratch-buffer)