diff options
author | Tom Willemse | 2022-01-30 23:12:22 -0800 |
---|---|---|
committer | Tom Willemse | 2022-01-30 23:12:22 -0800 |
commit | 9b7417f6c69360273e82b41130992c44fe373101 (patch) | |
tree | bb5c9628c40662a43240ac2d7755c895c7820801 /emacs/.config | |
parent | fc6b53d4dfdb96cb889388c6630d6994c99d410a (diff) | |
download | new-dotfiles-9b7417f6c69360273e82b41130992c44fe373101.tar.gz new-dotfiles-9b7417f6c69360273e82b41130992c44fe373101.zip |
Update GNUmakefile
- Add the ‘dunst’, ‘zsh’, ‘mcron’, and ‘mbsync’ modules.
- Tell Make that any ‘*.el’ files ar “precious”, meaning that when a ‘.elc’ file
was generated from a ‘.el’ file that was itself generated from a ‘.org’ file,
the ‘.el’ file isn't just an intermediate file and should not be deleted.
- Change the ‘install’ and ‘clean’ to use the ‘*-stow’ and ‘*-clean’ rules set
up for each module.
- Add configuration for ‘outline-minor-mode’ and change the headings to adhere
to that configuration.
- Stop using the ‘build/’ directory, tangle all the files to the same directory
as the source files, and use stow, not cp, to install them. The only exception
is the XDG files, which now have their specific ‘xdg-stow’ rule. This is
necessary because programs using these files will overwrite a symbolic link
they find and replace it with a new file, overwriting my settings.
- Add some files that were missing, and rename some files to follow the existing
convention to make them easy to tangle.
Diffstat (limited to 'emacs/.config')
-rw-r--r-- | emacs/.config/emacs/init.org | 53 | ||||
-rw-r--r-- | emacs/.config/shepherd/init.d/emacs.scm.org (renamed from emacs/.config/shepherd/init.d/emacs.org) | 0 |
2 files changed, 53 insertions, 0 deletions
diff --git a/emacs/.config/emacs/init.org b/emacs/.config/emacs/init.org new file mode 100644 index 0000000..ff7186d --- /dev/null +++ b/emacs/.config/emacs/init.org @@ -0,0 +1,53 @@ +#+TITLE: Emacs Configuration + +First, lexical binding must be enabled. This is better for performance, but also makes variable binding behave more as expected, and allows the creation of closures. + +#+begin_src emacs-lisp :padline no + ;; -*- lexical-binding: t; -*- +#+end_src + +#+begin_src emacs-lisp + (require 'oni-core) + (require 'oni-gui) +#+end_src + +Store all auto-save files in =$XDG_DATA_HOME/emacs/auto-save-list= to prevent them from clogging up =$XDG_CONFIG_HOME/emacs/=. The XDG specification says that if =XDG_DATA_HOME= hasn't been specified a default of =~/.local/share= should be used. + +#+begin_src emacs-lisp + (add-to-list + 'auto-save-file-name-transforms + `(,(rx (zero-or-more any)) + ,(concat (or (getenv "XDG_DATA_HOME") + (expand-file-name "~/.local/share")) + "/emacs/auto-save-list") + t) + t) +#+end_src + +Use =hunspell= instead of the default =aspell=. Hunspell is used by LibreOffice and other programs too. So far (at least through Emacs) it doesn't recognize the =’= as an apostrophe and I have to use ='= in org-mode if I want spell checking to accept word contractions in English. + +#+begin_src emacs-lisp + (eval-when-compile (require 'ispell)) + (with-eval-after-load 'ispell + (setq ispell-program-name "hunspell" + ispell-really-hunspell t)) +#+end_src + +Electric quote uses pretty quoting characters =’=, =‘=, =”=, and =“= instead of ='= and ="=, but when I'm in the middle of a word I don't want to use =’= (right single quotation mark), but ='= (apostrophe), which provides better results with spellchecking. So here is a function that checks whether the character before the previous is a word character. + +#+begin_src emacs-lisp + (defun oni-in-word-p () + "Check whether the character just typed was part of a word." + (save-excursion + (backward-char) + (looking-back (rx word) (1- (point))))) +#+end_src + +Now that I can check whether or not I'm typing a word, I can tell =electric-quote-mode= not to use =’= in that case. + +#+begin_src emacs-lisp + (with-eval-after-load 'electric + (add-hook 'electric-quote-inhibit-functions #'oni-in-word-p)) +#+end_src + +So now that that's settled, I should be writing ='= in words like “shouldn't'' and =’= otherwise. And spellchecking should work just fine. diff --git a/emacs/.config/shepherd/init.d/emacs.org b/emacs/.config/shepherd/init.d/emacs.scm.org index 11bef69..11bef69 100644 --- a/emacs/.config/shepherd/init.d/emacs.org +++ b/emacs/.config/shepherd/init.d/emacs.scm.org |