Compare commits

...

2 commits

Author SHA1 Message Date
Evie Litherland-Smith 74bbe0578f Guard against loading invalid config files
Ensure that config org-mode files don't contain "#" in the filename
when looping to call org-babel-load-file. These files only exist if a
file has unsaved changes, but directory-files will still find them as
.org files and attempt to load

Move package-archive definition and priorities into start of init.el,
since everything else actually depends on that (somewhat)
2024-04-05 15:22:48 +01:00
Evie Litherland-Smith 2eb76021bf Replace uses of customize-set-variable with setopt 2024-04-05 13:31:58 +01:00
4 changed files with 37 additions and 40 deletions

View file

@ -6,9 +6,9 @@
#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent
* Calendar
#+begin_src emacs-lisp
(customize-set-variable 'calendar-date-style 'iso)
(customize-set-variable 'calendar-mark-holidays-flag t)
(customize-set-variable 'calendar-mark-diary-entries-flag nil)
(setopt calendar-date-style 'iso
calendar-mark-holidays-flag t
calendar-mark-diary-entries-flag nil)
#+end_src
* Appointment reminders
#+begin_src emacs-lisp

View file

@ -49,17 +49,16 @@
(global-auto-revert-mode +1)
(delete-selection-mode +1)
;; No tabs
(customize-set-variable 'indent-tabs-mode nil)
;; Only display async output buffer when there's something to show
(customize-set-variable 'async-shell-command-display-buffer nil)
(setopt
;; No tabs
indent-tabs-mode nil
;; Only display async output buffer when there's something to show
async-shell-command-display-buffer nil
;; Scroll compilation buffer output
compilation-scroll-output t)
;; Make shebang (#!) file executable when saved
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)
;; Scroll compilation buffer output
(customize-set-variable 'compilation-scroll-output t)
#+end_src
* Auto-save file settings
@ -81,17 +80,6 @@
(recentf-max-saved-items 2048))
#+end_src
* package-archive with priorities
#+begin_src emacs-lisp :results output silent
(when (require 'package nil :noerror)
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(setq package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
("stable" . 70)
("melpa" . 0))))
#+end_src
* diminish modes
#+begin_src emacs-lisp
(use-package diminish :ensure t)

View file

@ -20,7 +20,7 @@
* Grand Unified Debugger
#+begin_src emacs-lisp
(with-eval-after-load 'gud
(customize-set-variable 'gdb-many-windows t))
(setopt gdb-many-windows t))
#+end_src
* Tree-sitter
@ -144,19 +144,15 @@ Set treesit to fontify all elements, default was 3 (out of 4)
:ensure t
:diminish
:defer
:after flymake)
#+end_src
*** mypy
#+begin_src emacs-lisp
(with-eval-after-load 'flymake-collection
(customize-set-variable 'flymake-collection-mypy-args
'("--ignore-missing-imports"
"--follow-imports=skip"
"--check-untyped-defs"
"--warn-unreachable"
"--show-error-codes"
"--no-color-output")))
:after flymake
:custom
;; Extra mypy config
(flymake-collection-mypy-args '("--ignore-missing-imports"
"--follow-imports=skip"
"--check-untyped-defs"
"--warn-unreachable"
"--show-error-codes"
"--no-color-output")))
#+end_src
** shellcheck

21
init.el
View file

@ -6,13 +6,26 @@
;;; Code:
;; Stop popups for warning messages, keep in log buffer
(customize-set-variable 'warning-minimum-level :error)
(setopt warning-minimum-level :error)
(defvar my/config-files () "List of literate config files to load.")
;; Configure packages archives with priority
(when (require 'package nil :noerror)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(setq my/config-files (directory-files (locate-user-emacs-file "config") t ".org"))
(setopt package-archive-priorities '(("melpa" . 10)
("stable" . 5)
("nongnu" . 5)
("gnu" . 0)))
(package-initialize))
(dolist (fname my/config-files) (org-babel-load-file fname))
(defvar my/config-files
(directory-files (locate-user-emacs-file "config") t ".org")
"List of literate config files to load.")
(dolist (fname my/config-files)
(unless (string-match-p (regexp-quote "#") fname)
(org-babel-load-file fname)))
(provide 'init)
;;; init.el ends here