reddit / emacs

The Basics of Emacs Configuration

daviwil · 2022-01-31 16:43
daviwil · 2022-01-31 16:44
Hey folks! In this video, I explain the basics of configuring the ultra-powerful productivity tool called Emacs. We'll discuss how to set configuration variables and enable new functionality, all while gaining a basic understanding of Emacs Lisp. This is the first video in a series where I'll show you how to build a complete Emacs configuration using only functionality that comes with it! Show notes: https://systemcrafters.net/emacs-from-scratch/basics-of-emacs-configuration/
3rdPoliceman · 2022-01-31 17:30
Great idea for a series. Thanks for all your wonderful Emacs content!
p7e9W8itt1tYayZn · 2022-01-31 18:05
Rumor has it, he's still configuring his Emacs to this day...
daviwil · 2022-01-31 18:05
You're not wrong...
00-11 · 2022-01-31 18:13
1. Thanks for doing this. 2. It's good to teach some Elisp early on. **+1**. 3. It's a shame that there's no mention of using Customize to set and save settings (options and faces). * Show setting and saving with the ***Options*** menu. * Show the use of Customize: `customize-option` or `customize-face`. Show it for setting, saving, and unsetting. * Show adding these to init file: (1) setting `custom-file`, (2) loading `custom-file`. Show what Customize does to your init file if you don't use a separate `custom-file`, and explain why mixing hand-coded code with generated code is problematic. [Use Customize or its functions](https://emacs.stackexchange.com/questions/102/advantages-of-setting-variables-with-setq-instead-of-custom-el/106#106) for options and faces.
daviwil · 2022-01-31 18:23
I probably should have given it a passing mention, you're right. At some point I plan to make a video about how to use the customization system too
00-11 · 2022-01-31 18:54
Thanks for considering this.
discursive_moth · 2022-01-31 22:37
Aren't we all?
dpassen1 · 2022-01-31 23:12
apropos would be a good interactive command for a new user to find things related to 'tab' in addition to describe-symbol
oantolin · 2022-02-01 03:07
I love the customization system for exploration and for temporary customization! (Not for permanent customization because `custom.el` and I disagree about the meaning of "tidy": I don't think "lump *eveything* together, but alphabetically" is very tidy). Embark has several tricks to support customization buffers: 1. If you are in a customization buffer with point on the heading for a variable (the line with the little triangle to the left to collapse or expand the settings for the variable), `embark-act` will act of the underlying variable. So you can, for example, use `embark-dwim` right there to go to the source where the variable is defined, or use `embark-act` and `s` to go to the corresponding section of the info manual (for built-in variables). 2. If you run `embark-collect-snapshot` from a customization buffer, you get an Embark collect buffer listing the variable from the customization buffer. 3. If from `describe-variable` you run `embark-export` you get a customization buffer with just the variables that are completions for what you've typed at the `describe-variable` prompt. Same works for `describe-face`. And since I realize Embark is off-topic for a series on the Basics of Emacs Configuration, here are two non-embark tips: 1. You can easily configure `imenu` to navigate among settings in a customization buffer: (defun configure-imenu-Custom () (setq imenu-generic-expression '(("Faces" "^\\(?:Show\\|Hide\\) \\(.*\\) face: \\[sample\\]" 1) ("Variables" "^\\(?:Show Value\\|Hide\\) \\([^:\n]*\\)" 1)))) (add-hook 'Custom-mode-hook 'configure-imenu-Custom) 2. If you want customize's guidance for setting a variable, but not the whole customization buffer, try `customize-set-variable` which works in the minibuffer! (It's bound to `c` in `embark-variable-map`, so you can comfortably use it from within `describe-variable` ---OK, this tip was half-embarky).
daviwil · 2022-02-01 03:13
Nice tips, thanks a lot! I'll keep a note for these when I cover the customization system. I'm also planning to do a legitimate video on Embark at some point this year :)
CrunchyChewie · 2022-02-01 13:48
Been watching some of your videos lately, they're awesome, keep up the good work!
daviwil · 2022-02-01 13:55
Thanks a lot!
daviwil · 2022-02-01 13:56
Yep, I'll cover `apropos` and the Info system in another video, possibly in the Emacs Essentials series.
c256 · 2022-02-02 18:35
What custom.el lacks in tidiness and readability, it makes up for in fragility. None of those are good things. The idea behind custom.el is a good one, and the maintainers roughly agree that it has several sharp corners and unfinished pieces. If someone were interested in hacking on a self-contained part of emacs, this is an area where effort could clearly be applied usefully. (The biggest political pitfall here is what I will call the simplicity/purity trade-off around precisely when, where, and how custom.el stores and applies its settings.)