diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 47 |
1 files changed, 11 insertions, 36 deletions
@@ -7,35 +7,18 @@ * Introduction -My Emacs configuration is a mess. As I’m writing this my Emacs -configuration stretches across multiple files, each containing various -snippets of code that seemed like a good idea to group. - -Unfortunately, there are a some things that don’t have a “natural” -home. Enabling the same minor mode in various major modes is one of -these cases—do I duplicate the hook and place it in a file for each -major mode? Or do I write a new file for the minor mode in which I -add it to the major modes at once? - -With multiple files I spend too much time trying to find the best -place for any bit of configuration I add. This slows me down and -sometimes I just append to the main =init.el=, so I often feel that my -configuration is in need of reorganisation. But configuring Emacs -should be fun! I don’t want it to create an uncomfortable clean-up -task as a side-effect. This is why I’m now trying to use a literate -approach with =org-mode=. My Emacs configuration should be prose -first and code second. In my experience, finding the right spot in -prose for a new paragraph requires a lot less effort as the text -itself acts as a connection between unrelated bits of code. +My Emacs configuration is a mess. As I’m writing this my Emacs configuration stretches across multiple files, each containing various snippets of code that seemed like a good idea to group. + +Unfortunately, there are a some things that don’t have a “natural” home. Enabling the same minor mode in various major modes is one of these cases—do I duplicate the hook and place it in a file for each major mode? Or do I write a new file for the minor mode in which I add it to the major modes at once? + +With multiple files I spend too much time trying to find the best place for any bit of configuration I add. This slows me down and sometimes I just append to the main =init.el=, so I often feel that my configuration is in need of reorganisation. But configuring Emacs should be fun! I don’t want it to create an uncomfortable clean-up task as a side-effect. This is why I’m now trying to use a literate approach with =org-mode=. My Emacs configuration should be prose first and code second. In my experience, finding the right spot in prose for a new paragraph requires a lot less effort as the text itself acts as a connection between unrelated bits of code. * How to use this? :PROPERTIES: :noweb-ref: compile-init :END: -We take all code blocks in this file and assemble an =init.el= from it -if the source file =init.org= is younger. At startup time we check if -the =init.el= has to be regenerated. +We take all code blocks in this file and assemble an =init.el= from it if the source file =init.org= is younger. At startup time we check if the =init.el= has to be regenerated. #+BEGIN_SRC elisp (let ((orgfile (expand-file-name (concat user-emacs-directory "init.org"))) @@ -112,9 +95,7 @@ Here’s a list of them: scss-mode)) #+END_SRC -I want these packages to be installed automatically. First I need to -define in what repositories Emacs should look for the packages. I’m -using packages from both the “melpa” and “marmalade” repositories. +I want these packages to be installed automatically. First I need to define in what repositories Emacs should look for the packages. I’m using packages from both the “melpa” and “marmalade” repositories. #+BEGIN_SRC elisp (require 'package) @@ -125,8 +106,7 @@ using packages from both the “melpa” and “marmalade” repositories. (package-initialize) #+END_SRC -If this is a fresh Emacs installation melpa needs to be initialised -first: +If this is a fresh Emacs installation melpa needs to be initialised first: #+BEGIN_SRC elisp (unless (file-exists-p "~/.emacs.d/elpa/archives/melpa") @@ -408,10 +388,7 @@ All of this should be loaded lazily. :noweb-ref: tramp :END: -TRAMP is a really convenient way to edit files on remote systems from -within the comfort of my cozy customised local Emacs session. I use -it to edit files at work, to edit things on my server =elephly.net=, -and even to edit things as root on the local system. +TRAMP is a really convenient way to edit files on remote systems from within the comfort of my cozy customised local Emacs session. I use it to edit files at work, to edit things on my server =elephly.net=, and even to edit things as root on the local system. #+BEGIN_SRC elisp (require 'tramp) @@ -597,8 +574,7 @@ The default prompt face makes it hard to see the prompt. :noweb-ref: initial :END: -This is supposed to happen at the very beginning, even before loading -packages. I still need to arrange these things nicely. +This is supposed to happen at the very beginning, even before loading packages. I still need to arrange these things nicely. #+BEGIN_SRC elisp ;; No splash screen please ... @@ -623,8 +599,7 @@ packages. I still need to arrange these things nicely. :noweb-ref: initial-after-packages :END: -This is even more stuff to be done after initialising packages. I -still need to process all of this and clean it up. +This is even more stuff to be done after initialising packages. I still need to process all of this and clean it up. #+BEGIN_SRC elisp ;; better defaults, includes hiding the GUI |