docs: prose edits

This commit is contained in:
Kiana Sheibani 2025-02-20 02:06:18 -05:00
parent dabf36e48e
commit 539452bdd8
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -76,7 +76,7 @@ The solution is [[https://en.wikipedia.org/wiki/Literate_programming][literate p
You are currently reading the published version of this literate program[fn:1]. If you were to download this repository and use it as your config, Emacs would be running the tangled version. These versions are generated in separate processes, but both are ultimately derived from the content and metadata inside of the Org file.
[fn:1] Unless you're reading the raw file on Github, in which case you are probably already decently familiar with =org-mode= to be able to read its markup.
[fn:1] Unless you're reading the raw text file, which would not have any formatting whatsoever.
**** Code and Comprehension
@ -88,22 +88,18 @@ It's not the right tool for every codebase, but proper use of literate programmi
** Current Issues
*** TODO [#A] Doom Autoloads
I am currently unaware of a way to trigger code to run after a Doom module's =autoload.el= file is run. Look into this!
*** TODO Nix
Creating garbage collection roots currently doesn't work.
*** TODO Idris
The configuration for Idris is a bit light, and could use some touching up.
*** TODO Mail
My mail client currently requires GPG access to sync emails, which doesn't properly work. Using the mail client requires running ~mbsync -a~ externally instead.
*** Org
**** TODO Configure Org popups
* Configuration Support
A proper Emacs configuration is often so complex that it requires its own support code to ease the process of writing and maintaining it. Before the configuration itself, here's all the support systems it uses (aside from Doom Emacs itself, which is also configuration support).
@ -812,7 +808,7 @@ The package allows you to define /patches/ which modify the definitions of funct
Some packages in this config such as =dirvish=, =org-roam=, etc. require certain tools to be in the environment. On a Nix-based system, there are a few different ways to handle this:
1. Put that tool in the actual environment, e.g. in a profile. This makes sense for simple things (=ripgrep=, =sqlite=, etc) but for more opinionated things like an instance of Python it becomes less desirable.
1. Put that tool in the actual environment, e.g. in a profile. This makes sense for simple things (=ripgrep=, =sqlite=, etc) but for more opinionated things like a specific version of Python it becomes less desirable.
2. Build the tool and put a symlink to the output somewhere, e.g. in the HOME directory. This avoids polluting the environment, but you still have to deal with an unwieldy symlink that breaks Emacs if you accidentally delete it.
This was my approach before coming up with the third option:
3. Build the tool and point Emacs directly to the store path. This is the most automatic solution, but requires the most complex Emacs configuration.
@ -1152,15 +1148,16 @@ This is mostly config settings that don't belong to any particular package and a
It wouldn't be Emacs if there wasn't an endless list of config variables to change every aspect of its function!
#+begin_src emacs-lisp
(setq-default delete-by-moving-to-trash t ; Delete files to trash
window-combination-resize t ; Resize windows more evenly
(setq-default delete-by-moving-to-trash t ; Delete files to trash
window-combination-resize t ; Resize windows more evenly
)
(setq compile-command "nix build"
shell-file-name (executable-find "bash") ; Use bash instead of fish for default shell
disabled-command-function nil ; Disabled commands are a stupid idea
password-cache-expiry nil ; Security? Never heard of it
scroll-margin 2 ; A few extra lines on each end of the window
shell-file-name
(executable-find "bash") ; Use bash instead of fish for default shell
disabled-command-function nil ; Disabled commands are a stupid idea
password-cache-expiry nil ; Security? Never heard of it
scroll-margin 2 ; A few extra lines on each end of the window
)
(global-subword-mode +1)
@ -1181,7 +1178,7 @@ Emacs uses this basic personal information for a few different things, mostly ap
#+call: confpkg("Auth")
The =auth-source-pass= module lets you use [[*Password Management][pass]] as a source for authentication. Let's turn that on.
The =auth-source-pass= package lets you use [[*Password Management][pass]] as a source for authentication. Let's turn that on.
#+begin_src emacs-lisp
(require 'auth-source-pass)
@ -1383,11 +1380,11 @@ When a window is split in Emacs, the result is two windows that show the same bu
#+call: confpkg("Visual")
If you're going to be staring at your screen for hours a day, you might as well make the thing you're staring at look nice.
If you're going to be staring at your screen for hours a day, you might as well make the thing you're staring at look nice!
** Theme
My favorite color theme has always been Tokyo Night. I use it literally everywhere I can, and Doom Emacs is no exception.
My favorite color theme has always been Tokyo Night. I use it literally everywhere I can, and Emacs is no exception.
#+begin_src emacs-lisp
(setq doom-theme 'doom-tokyo-night)
@ -1395,7 +1392,7 @@ My favorite color theme has always been Tokyo Night. I use it literally everywhe
** Fonts
Victor Mono is my preferred coding font. I also use Source Sans Pro as my sans-serif font, though that is more an arbitrary pick than actually liking how it looks.
Victor Mono is my preferred coding font. I'm also using Source Sans Pro as my sans-serif font, though that is more an arbitrary pick than actually liking how it looks.
#+begin_src emacs-lisp
(setq doom-font (font-spec :family "VictorMono" :size 13)
@ -1479,7 +1476,7 @@ When a buffer has line numbers, they can interfere with the margins and make the
#+call: confpkg("Dashboard")
There's a lot of reasons why I don't like Spacemacs and why I left it for Doom Emacs (mainly the fact that it's slow and often opaque to the user), but there's one thing that Spacemacs undoubtedly has Doom beat in:
There's a lot of reasons why I don't like Spacemacs and why I left it for Doom Emacs (the most prominent being its extreme sluggishness), but there's one thing that Spacemacs undoubtedly has Doom beat in:
[[https://user-images.githubusercontent.com/33982951/39624821-a4abccee-4f92-11e8-9e91-3d5b542bbb85.png][Spacemacs's dashboard has /impeccable/ style.]]
@ -1503,7 +1500,7 @@ The image can be set like thus:
*** Title
Since our banner no longer includes a title, we should add one after the splash image. This title format is inspired by Spacemacs!
Since our banner no longer includes a title, we should add one after the splash image. This title format is inspired by the Spacemacs dashboard shown above.
#+begin_src emacs-lisp
(defface doom-dashboard-title
@ -2380,9 +2377,10 @@ I've set my default Emacs shell to =bash=, since pointing Emacs to a non-POSIX s
#+call: confpkg("Pkg: winum")
Emacs comes with a few standard commands for selecting different windows. These are mostly directional, allowing you to move your selection up, right, left or down from the current window. This is rather inconvenient when working with large amounts of windows, so the =winum= package allows you to assign a number to each window to make navigation easier.
Emacs comes with a few standard commands for selecting different windows. These are mostly directional, allowing you to move your selection up, right, left or down from the current window. This is a bit inconvenient when there are a lot of windows, so the =winum= package allows you to assign a number to each window to make navigation easier.
There's just one wrinkle: Doom Emacs's popup management system. Popups are treated as separate from "real" windows, usually displayed on the edge of the frame and without a modeline. =winum= has no knowledge of popup windows and assigns them numbers exactly the same as any other window. This can get really confusing, since windows get renumbered every time a new popup appears.
There's just one problem with =winum= for my purposes: Doom Emacs's popup management system. In Doom Emacs, popups are treated as separate from "real" windows, usually displayed on the edge of the frame and without a modeline. =winum= has no knowledge of popup windows, and assigns them numbers exactly the same as any other window, which is very confusing when popups are otherwise treated as separate.
To solve this issue, I've written my own fork of =winum=:
@ -2390,7 +2388,7 @@ To solve this issue, I've written my own fork of =winum=:
(package! winum :recipe (:local-repo "pkgs/winum"))
#+end_src
This fork generalizes the window numbering system to support indexing windows with any Lisp object, instead of just integers. We can then index regular windows with integers ~N~, and popup windows with cons cells ~(popup . N)~, allowing us to number them separately.
This fork generalizes the window numbering system to support indexing windows with any Lisp object, instead of just integers. We can then index regular windows with integers ~N~ and popup windows with cons cells ~(popup . N)~, allowing us to number them separately.
*** Bindings
@ -2552,7 +2550,7 @@ Typing =C-x *= every time I want to use Calc (very often) is annoying. To allevi
"`" #'calc-embedded-edit))
#+end_src
For the grab-region command, I think it makes sense to have it check whether your selection is a rectangle (=C-v=):
Calc can pull data from the selected region, and has two commands to do so: ~calc-grab-region~, for one-dimensional data, and ~calc-grab-rectangle~, for two-dimensional data. Seeing as Evil has a whole separate selection type for rectangular data (=C-v=), I think it makes sense to have the grab region key (=SPC C g=) run either command based on the selection type.
#+begin_src emacs-lisp
(defun ~/calc-grab-region (top bot &optional arg)
@ -2579,6 +2577,8 @@ Calc doesn't use faces to show selections by default, which I think is rather st
*** Other Defaults
Some of Calc's default modes are a little baffling. (I don't know why any modern calculator would default to degrees over radians!) These can be customized as simple variables, though, so it's easy to change them.
#+begin_src emacs-lisp
(after! calc
(setq calc-window-height 13 ; Make window taller
@ -3093,10 +3093,6 @@ When marking text for =*emphasis*=, Org mode normally only allows emphasized sec
'("-[:space:]('\"{" "-[:space:].,:!?;'\"_^)}\\[" "[:space:]" "." 20))
#+end_src
*** Popups
Org uses many popup windows for various things, and we can use Doom to make them look a little nicer.
** Enhancements
While Org-mode provides a very comprehensive set of tools and systems, there are a few small things that are missing or that would make the overall UX smoother. Luckily, Org-mode being implemented as an Emacs package gives us more than enough control over its function to crowbar in a few new features!
@ -4225,7 +4221,7 @@ I prefer 2-space indentation in all circumstances. Unfortunately, Emacs's indent
#+call: confpkg("Mode: Java")
The =lsp-java= package provides LSP support using the standard Java language server, the Eclipse-based ~jdtls~. Unfortunately, this package isn't designed for Nix, so it fails to find the server script in our Nix store. We need to do a bit of legwork to patch in this support, as well as some related considerations, such as per-project config directories.
The =lsp-java= package provides LSP support using the standard Java language server, the Eclipse server ~jdtls~. Unfortunately, this package isn't designed for Nix, so it fails to find the server script in our Nix store. We need to do a bit of legwork to patch in this support, as well as some related considerations, such as per-project config directories.
#+begin_src emacs-lisp
(defun +lsp-java-server-store-path ()
@ -4256,7 +4252,7 @@ The =lsp-java= package provides LSP support using the standard Java language ser
#+call: confpkg("Mode: LSP")
The emacs package =lsp-mode= is the package of choice for general LSP integration in Emacs. The Doom Emacs module =:tools lsp= handles most of the basic configuration for it, but there's one minor annoyance it doesn't cover: when a server isn't found for a particular language, =lsp-mode= tries to install the server itself to a local directory, which is a completely useless space-filler for my purposes since that I use NixOS.
The emacs package =lsp-mode= is the package of choice for general LSP integration in Emacs. The Doom Emacs module =:tools lsp= handles most of the configuration for it, but there's one annoyance it doesn't cover: when a server isn't found for a particular language, =lsp-mode= tries to install it itself, which is a complete waste of time for my purposes since I use NixOS.
There is luckily a configuration variable to disable this suggestion: