Move org custom faces to a use-package :custom-face block.

This prevent the faces from being written to custom.el.
This commit is contained in:
Tom Alexander 2026-02-14 21:54:01 -05:00
parent bf006a968b
commit 3df022ab3f
Signed by: talexander
GPG Key ID: 36C99E8B3C39D85F
3 changed files with 88 additions and 80 deletions

View File

@ -1,9 +1,19 @@
(package-initialize) (package-initialize)
(use-package use-package) (use-package use-package
:custom
;; Unless otherwise specified, always install packages if they are absent.
(use-package-always-ensure t)
;; Allow updating built-in packages like eglot
;; For some reason, built-in packages are still not updating so I'm just going to comment this out.
;; (package-install-upgrade-built-in t)
;; Natively compile packages
(package-native-compile t)
:config
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
)
)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
)
(use-package auto-package-update (use-package auto-package-update
:ensure t :ensure t
@ -71,10 +81,11 @@
) )
(setq-default (setq-default
;; Unless otherwise specified, always install packages if they are absent.
use-package-always-ensure t
;; Point custom-file at /dev/null so emacs does not write any settings to my dotfiles. ;; Point custom-file at /dev/null so emacs does not write any settings to my dotfiles.
custom-file "/dev/null" ;; custom-file "/dev/null"
;;
;; list-package breaks on newer versions of emacs if custom-file is set to /dev/null
custom-file (expand-file-name "custom.el" user-emacs-directory)
;; Don't pop up a small window at the bottom of emacs at launch. ;; Don't pop up a small window at the bottom of emacs at launch.
inhibit-startup-screen t inhibit-startup-screen t
inhibit-startup-message t inhibit-startup-message t
@ -95,8 +106,6 @@
"%b"))) "%b")))
;; Use 'y' or 'n' instead of 'yes' or 'no' ;; Use 'y' or 'n' instead of 'yes' or 'no'
use-short-answers t use-short-answers t
;; Natively compile packages
package-native-compile t
;; Confirm when opening a file that does not exist ;; Confirm when opening a file that does not exist
confirm-nonexistent-file-or-buffer t confirm-nonexistent-file-or-buffer t
;; Do not require double space to end a sentence. ;; Do not require double space to end a sentence.

View File

@ -1,4 +1,5 @@
(use-package eglot (use-package eglot
;; This is an emacs built-in but we're pulling the latest version
:pin gnu :pin gnu
:commands (eglot eglot-ensure) :commands (eglot eglot-ensure)
:bind (:map eglot-mode-map :bind (:map eglot-mode-map

View File

@ -1,81 +1,79 @@
(use-package org (require 'color)
:ensure nil (let ((bg (face-attribute 'default :background)))
:commands org-mode (use-package org
:bind (:map org-mode-map :ensure nil
("C-c l" . org-store-link) :commands org-mode
("C-c a" . org-agenda) :bind (:map org-mode-map
("S-<up>" . org-shiftup) ("C-c l" . org-store-link)
("S-<right>" . org-shiftright) ("C-c a" . org-agenda)
("S-<down>" . org-shiftdown) ("S-<up>" . org-shiftup)
("S-<left>" . org-shiftleft) ("S-<right>" . org-shiftright)
) ("S-<down>" . org-shiftdown)
:hook ( ("S-<left>" . org-shiftleft)
(org-mode . (lambda () )
(org-indent-mode +1) :hook (
)) (org-mode . (lambda ()
;; Make windmove work in Org mode: (org-indent-mode +1)
(org-shiftup-final . windmove-up) ))
(org-shiftleft-final . windmove-left) ;; Make windmove work in Org mode:
(org-shiftdown-final . windmove-down) (org-shiftup-final . windmove-up)
(org-shiftright-final . windmove-right) (org-shiftleft-final . windmove-left)
) (org-shiftdown-final . windmove-down)
:config (org-shiftright-final . windmove-right)
(require 'org-tempo) )
(setq org-export-latex-listings t) :custom-face
(setq org-startup-truncated nil) (org-block ((t (:inherit default :background ,(color-lighten-name bg 15) :extend ,t))))
(setq org-startup-folded nil) (org-block-begin-line ((t (:inherit default :background ,"#472300" :extend ,t))))
(setq org-src-fontify-natively t (org-block-end-line ((t (:inherit default :background ,"#472300" :extend ,t))))
org-src-tab-acts-natively t :config
org-confirm-babel-evaluate nil (require 'org-tempo)
) (setq org-export-latex-listings t)
(setq org-startup-truncated nil)
(setq org-startup-folded nil)
(setq org-src-fontify-natively t
org-src-tab-acts-natively t
org-confirm-babel-evaluate nil
)
;; Show the full source of org-mode links instead of condensing them. I.E. render "[[foo]]" instead of "foo" ;; Show the full source of org-mode links instead of condensing them. I.E. render "[[foo]]" instead of "foo"
(setq org-descriptive-links nil) (setq org-descriptive-links nil)
;; Only interpret _ and ^ and sub and superscripts if they're of the form _{subscript} and ^{superscript} ;; Only interpret _ and ^ and sub and superscripts if they're of the form _{subscript} and ^{superscript}
(setq org-export-with-sub-superscripts '{}) (setq org-export-with-sub-superscripts '{})
;; Don't include a "validate" link at the bottom of html export ;; Don't include a "validate" link at the bottom of html export
(setq org-html-validation-link nil) (setq org-html-validation-link nil)
(setq org-latex-listings 'minted) (setq org-latex-listings 'minted)
(setq org-latex-minted-options '(("breaklines" "true") (setq org-latex-minted-options '(("breaklines" "true")
("breakanywhere" "true") ("breakanywhere" "true")
("bgcolor" "mintedbg") ("frame" "single") ("framesep" "6pt") ("fontsize" "\\footnotesize"))) ("bgcolor" "mintedbg") ("frame" "single") ("framesep" "6pt") ("fontsize" "\\footnotesize")))
;; TODO: There is an option to set the compiler, could be better than manually doing this here https://orgmode.org/manual/LaTeX_002fPDF-export-commands.html ;; TODO: There is an option to set the compiler, could be better than manually doing this here https://orgmode.org/manual/LaTeX_002fPDF-export-commands.html
;; (setq org-latex-compiler "lualatex") ;; (setq org-latex-compiler "lualatex")
;; TODO: nixos latex page recommends this line, figure out what it does / why its needed: ;; TODO: nixos latex page recommends this line, figure out what it does / why its needed:
;; (setq org-preview-latex-default-process 'dvisvgm) ;; (setq org-preview-latex-default-process 'dvisvgm)
(setq org-latex-pdf-process (setq org-latex-pdf-process
'("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f" '("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"lualatex -shell-escape -interaction nonstopmode -output-directory %o %f" "lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"lualatex -shell-escape -interaction nonstopmode -output-directory %o %f")) "lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
(add-to-list 'org-latex-packages-alist '("cache=false" "minted")) (add-to-list 'org-latex-packages-alist '("cache=false" "minted"))
(add-to-list 'org-latex-packages-alist '("" "svg")) (add-to-list 'org-latex-packages-alist '("" "svg"))
(add-to-list 'org-latex-packages-alist '("margin=2cm" "geometry" nil)) (add-to-list 'org-latex-packages-alist '("margin=2cm" "geometry" nil))
(add-to-list 'org-src-lang-modes '("dot" . "graphviz-dot")) (add-to-list 'org-src-lang-modes '("dot" . "graphviz-dot"))
(org-babel-do-load-languages 'org-babel-load-languages (org-babel-do-load-languages 'org-babel-load-languages
'((shell . t) '((shell . t)
(js . t) (js . t)
(emacs-lisp . t) (emacs-lisp . t)
(python . t) (python . t)
(dot . t) (dot . t)
(css . t) (css . t)
(gnuplot . t) (gnuplot . t)
(sqlite . t) (sqlite . t)
)) ))
)
(require 'color)
(let ((bg (face-attribute 'default :background)))
(custom-set-faces
`(org-block ((t (:inherit default :background ,(color-lighten-name bg 15) :extend ,t))))
`(org-block-begin-line ((t (:inherit default :background ,"#472300" :extend ,t))))
`(org-block-end-line ((t (:inherit default :background ,"#472300" :extend ,t))))
))
) )
(use-package org-bullets (use-package org-bullets