From 5611ea77ff990640aa94a7f0f4e4b5f1b6f5e526 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 15 Feb 2024 08:45:37 +0000 Subject: [PATCH] Make config src blocks silent output by default Move python hook setting to python use-package block Use locate-user-emacs-file for resolving paths inside user-emacs-directory Update my/open-init-file (was my/open-config-file) for new config structure --- config/defaults.org | 11 ++++++----- config/ide.org | 6 +++--- config/internet.org | 1 + config/media.org | 1 + config/org-mode.org | 1 + config/pass.org | 1 + config/tramp.org | 1 + config/ui.org | 1 + config/writing.org | 1 + init.el | 2 +- 10 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config/defaults.org b/config/defaults.org index 1362bae..3917a89 100644 --- a/config/defaults.org +++ b/config/defaults.org @@ -2,8 +2,9 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Common defaults -#+begin_src emacs-lisp :results output silent +#+begin_src emacs-lisp (setq custom-file (locate-user-emacs-file "custom.el")) (when (and custom-file (file-exists-p custom-file)) (load custom-file nil 'nomessage)) @@ -29,11 +30,11 @@ scroll-preserve-screen-position 1) ;; Config file shortcut - (defun my/open-config-file () - "Open my literate config file" + (defun my/open-init-file () + "Open emacs init file" (interactive) - (find-file "~/.emacs/README.org")) - (keymap-global-set "C-c w c" #'my/open-config-file) + (locate-user-emacs-file "init.el")) + (keymap-global-set "C-c w c" #'my/open-init-file) ;; Scratch buffer shortcut diff --git a/config/ide.org b/config/ide.org index ccf7362..1ce8f16 100644 --- a/config/ide.org +++ b/config/ide.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Development Environment ** Miscellaneous #+begin_src emacs-lisp @@ -38,8 +39,6 @@ Set treesit to fontify all elements, default was 3 (out of 4) (treesit-auto-add-to-auto-mode-alist) (global-treesit-auto-mode +1)) - (setq python-ts-mode-hook python-mode-hook) - (with-eval-after-load 'rust-mode (setq rust-ts-mode-hook rust-mode-hook)) #+end_src @@ -391,7 +390,8 @@ Set fill column to 88 and enable display in python buffers :custom (python-check-command "mypy") :config - (add-hook 'python-base-mode-hook (lambda () (my/enable-fill-column 88)))) + (add-hook 'python-base-mode-hook (lambda () (my/enable-fill-column 88))) + (setq python-ts-mode-hook python-mode-hook)) #+end_src *** Rust diff --git a/config/internet.org b/config/internet.org index 5ec1c83..9b5e6b4 100644 --- a/config/internet.org +++ b/config/internet.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Internet ** Gnus #+begin_src emacs-lisp :tangle yes diff --git a/config/media.org b/config/media.org index cfb5784..2b038b8 100644 --- a/config/media.org +++ b/config/media.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Media ** EMMS #+begin_src emacs-lisp diff --git a/config/org-mode.org b/config/org-mode.org index 7492d9f..baef407 100644 --- a/config/org-mode.org +++ b/config/org-mode.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Org-mode For reference information, see [[https://orgmode.com][Org-mode website]] diff --git a/config/pass.org b/config/pass.org index 5cb8548..99490ee 100644 --- a/config/pass.org +++ b/config/pass.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Password Store #+begin_src emacs-lisp (use-package password-store diff --git a/config/tramp.org b/config/tramp.org index f9dc10e..a61732b 100644 --- a/config/tramp.org +++ b/config/tramp.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Remote Editing ** TRAMP #+begin_src emacs-lisp :tangle yes diff --git a/config/ui.org b/config/ui.org index 549838a..fd11905 100644 --- a/config/ui.org +++ b/config/ui.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * UI #+begin_src emacs-lisp (setq use-dialog-box nil diff --git a/config/writing.org b/config/writing.org index 38b875d..82e0c67 100644 --- a/config/writing.org +++ b/config/writing.org @@ -2,6 +2,7 @@ #+author: Evie Litherland-Smith #+email: evie@xenia.me.uk #+filetags: :emacs:config:org: +#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent * Doc-view #+begin_src emacs-lisp :tangle yes (use-package doc-view diff --git a/init.el b/init.el index 6a2c3d1..07373a7 100644 --- a/init.el +++ b/init.el @@ -18,7 +18,7 @@ "config/media.org" ;Music player using `emms' )) (org-babel-load-file - (expand-file-name fname user-emacs-directory))) + (locate-user-emacs-file fname))) (provide 'init) ;;; init.el ends here