diff --git a/README.org b/README.org index d3a666c..da6cde9 100644 --- a/README.org +++ b/README.org @@ -7,19 +7,23 @@ #+LATEX_HEADER: \lstset{breaklines=true, breakatwhitespace=true, basicstyle=\ttfamily\footnotesize, columns=fullflexible} #+begin_src emacs-lisp :exports none :tangle no +;; This asks for a file which it uses to store the processed org +;; data with the includes into. It can be anything and can safely +;; be deleted afterwards. I think README.org is a good file to +;; pick if using a repository. (defun tangle-literate-config () - "Tangle all my literate configuration files." + "Tangle config files with proper include handling." (interactive) - (let ((org-confirm-babel-evaluate nil) - (files '("config.org" - "extra/feed.org" - "extra/email.org" - "extra/social.org"))) - (dolist (file files) - (when (file-exists-p file) - (message "Tangling %s..." (file-name-nondirectory file)) - (org-babel-tangle-file file))) - (message "All configuration files tangled!"))) + (let ((org-confirm-babel-evaluate nil)) + ;; Create a temporary buffer with expanded includes + (with-temp-buffer + (insert-file-contents "config.org") + (org-mode) + ;; This expands all #+INCLUDE directives + (org-export-expand-include-keyword) + ;; Now tangle from this buffer which has everything in one place + (org-babel-tangle nil "init.el")) + (message "Configuration tangled!"))) #+end_src #+BEGIN_SRC emacs-lisp :exports none @@ -114,18 +118,6 @@ loading as a blank slate with only the scratch buffer open. ;; End: #+end_src -* Basic Editing - -The most crucial settings in the whole configuration. Despite the look of my -configuration I do *indeed* use it as an editor. - -#+begin_src emacs-lisp -(setq initial-buffer-choice t) ;;*scratch* -(setq-default standard-indent 2) -(setq-default tab-width 2) -(editorconfig-mode) -#+end_src - * Package Management I am using [[https://github.com/progfolio/elpaca][Elpaca]] as my package manager. I've found it to be quite quick, and easy to @@ -201,6 +193,18 @@ features. (setq use-package-always-ensure t)) #+end_src +* Basic Editing + +The most crucial settings in the whole configuration. Despite the look of my +configuration I do *indeed* use it as an editor. + +#+begin_src emacs-lisp +(setq initial-buffer-choice t) ;;*scratch* +(setq-default standard-indent 2) +(setq-default tab-width 2) +(editorconfig-mode) +#+end_src + * Garbage Collection There's a lot of clashes that can happen with regards to performance, and @@ -478,14 +482,6 @@ on a system by system basis. ;;; #+end_src -# For now I'm not using headers here and letting them be defined in the org files -# themselves. -#+INCLUDE: "extra/email.org" :minlevel 1 - -#+INCLUDE: "extra/feed.org" :minlevel 1 - -#+INCLUDE: "extra/social.org" :minlevel 1 - * Hail Hydra?! I find that [[https://github.com/abo-abo/hydra][Hydra]] is great for providing visual menus for tasks that might @@ -1287,6 +1283,7 @@ the package. (c-ts-mode . lsp-deferred) (clojure-ts-mode . lsp-deferred) (elixir-ts-mode . lsp-deferred) + (gleam-ts-mode . lsp-deferred) (rust-ts-mode . lsp-deferred) (slint-mode . lsp-deferred) (zig-mode . lsp-deferred) @@ -1360,6 +1357,10 @@ bother with an explanation on each. (clojure-ts-mode . rainbow-delimiters-mode) (clojure-ts-mode . clj-refactor-mode))) +;; Gleam +(use-package gleam-ts-mode + :mode (rx ".gleam" eos)) + (use-package cider :ensure t :defer t) diff --git a/config.org b/config.org index 7de5a39..ee6787c 100644 --- a/config.org +++ b/config.org @@ -7,19 +7,23 @@ #+LATEX_HEADER: \lstset{breaklines=true, breakatwhitespace=true, basicstyle=\ttfamily\footnotesize, columns=fullflexible} #+begin_src emacs-lisp :exports none :tangle no +;; This asks for a file which it uses to store the processed org +;; data with the includes into. It can be anything and can safely +;; be deleted afterwards. I think README.org is a good file to +;; pick if using a repository. (defun tangle-literate-config () - "Tangle all my literate configuration files." + "Tangle config files with proper include handling." (interactive) - (let ((org-confirm-babel-evaluate nil) - (files '("config.org" - "extra/feed.org" - "extra/email.org" - "extra/social.org"))) - (dolist (file files) - (when (file-exists-p file) - (message "Tangling %s..." (file-name-nondirectory file)) - (org-babel-tangle-file file))) - (message "All configuration files tangled!"))) + (let ((org-confirm-babel-evaluate nil)) + ;; Create a temporary buffer with expanded includes + (with-temp-buffer + (insert-file-contents "config.org") + (org-mode) + ;; This expands all #+INCLUDE directives + (org-export-expand-include-keyword) + ;; Now tangle from this buffer which has everything in one place + (org-babel-tangle nil "init.el")) + (message "Configuration tangled!"))) #+end_src #+BEGIN_SRC emacs-lisp :exports none @@ -114,18 +118,6 @@ loading as a blank slate with only the scratch buffer open. ;; End: #+end_src -* Basic Editing - -The most crucial settings in the whole configuration. Despite the look of my -configuration I do *indeed* use it as an editor. - -#+begin_src emacs-lisp -(setq initial-buffer-choice t) ;;*scratch* -(setq-default standard-indent 2) -(setq-default tab-width 2) -(editorconfig-mode) -#+end_src - * Package Management I am using [[https://github.com/progfolio/elpaca][Elpaca]] as my package manager. I've found it to be quite quick, and easy to @@ -201,6 +193,8 @@ features. (setq use-package-always-ensure t)) #+end_src +#+INCLUDE: "config/editing.org" :minlevel 1 + * Garbage Collection There's a lot of clashes that can happen with regards to performance, and @@ -478,14 +472,6 @@ on a system by system basis. ;;; #+end_src -# For now I'm not using headers here and letting them be defined in the org files -# themselves. -#+INCLUDE: "extra/email.org" :minlevel 1 - -#+INCLUDE: "extra/feed.org" :minlevel 1 - -#+INCLUDE: "extra/social.org" :minlevel 1 - * Hail Hydra?! I find that [[https://github.com/abo-abo/hydra][Hydra]] is great for providing visual menus for tasks that might diff --git a/config/editing.org b/config/editing.org new file mode 100644 index 0000000..e7e2086 --- /dev/null +++ b/config/editing.org @@ -0,0 +1,11 @@ +* Basic Editing + +The most crucial settings in the whole configuration. Despite the look of my +configuration I do *indeed* use it as an editor. + +#+begin_src emacs-lisp +(setq initial-buffer-choice t) ;;*scratch* +(setq-default standard-indent 2) +(setq-default tab-width 2) +(editorconfig-mode) +#+end_src diff --git a/extra/email.org b/extra/email.org index 5469365..fdf232e 100644 --- a/extra/email.org +++ b/extra/email.org @@ -1,12 +1,10 @@ -#+PROPERTY: header-args :tangle email.el - Incoming email is handled by [[https://notmuchmail.org][notmuch]]. Outgoing is via [[https://github.com/marlam/msmtp][msmtp]] This is a pretty simple implementation without a lot of search queries, and list handling. As I get more comfortable with using emacs as an email client I'll try to get fancier. -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle "email.el" ;; Email/notmuch settings -*- lexical-binding: t; -*- (use-package notmuch :init diff --git a/extra/feed.org b/extra/feed.org index 7713642..5a6d5e0 100644 --- a/extra/feed.org +++ b/extra/feed.org @@ -1,25 +1,8 @@ -#+PROPERTY: header-args :tangle "feed.el" :noweb yes - I get a lot of my news, and updates via Atom/RSS feeds. If I'm going to browse them in emacs I use elfeed. -#+name: header -#+begin_src emacs-lisp :exports none -;;; elfeed -- Just my elfeed config. -*- lexical-binding: t; -*- -;;; Commentary: -;;; Nothing yet. - -;;; Code: -#+end_src - -#+name: footer -#+begin_src emacs-lisp :exports none -(provide 'feed) -;;; feed.el ends here -#+end_src - #+name: feed-src -#+begin_src emacs-lisp :exports code +#+begin_src emacs-lisp :tangle "feed.el" :exports code (use-package elfeed :defer t @@ -56,9 +39,5 @@ browse them in emacs I use elfeed. :after (elfeed) :config (elfeed-goodies/setup)) - -<