Creating Custom Minor Modes - Learning Emacs Lisp #7
In this video, we'll learn how to create custom minor modes and hooks in Emacs Lisp! We'll also continue with our dotcrafter.el project by creating a minor mode that will cause our Org Mode configuration files to be automatically tangled when saved.
Check out the show notes here: https://systemcrafters.cc/learning-emacs-lisp/creating-minor-modes
The code for dotcrafter.el can be found here: https://github.com/daviwil/dotcrafter.el
We cover the following topics:
- 0:00 Intro
- 0:34 What will we learn?
- 1:53 What is a "mode"?
- 6:46 Writing a basic minor mode
- 12:44 Example: Creating a simple minor mode from scratch
- 22:26 Creating a Hook
- 25:55 Using the define-minor-mode macro
- 34:09 Example: Writing real behavior for dotcrafter-mode
- 47:39 What's next?
My Emacs configuration: https://config.daviwil.com/emacs
My system configurations: https://config.daviwil.com/systems
If you enjoy this series, please consider becoming a sponsor on GitHub or Patreon:
- https://github.com/sponsors/daviwil
- https://patreon.com/SystemCrafters
You can also leave a tip via PayPal: https://paypal.me/daviwil
Follow me on Twitter for more GNU Emacs and GNU Guix content!
https://twitter.com/SystemCrafters
Chat with the System Crafters community on Discord: https://discord.gg/yVD8Gx6
Check out my other video series!
- Emacs From Scratch: https://www.youtube.com/watch?v=74zOY-vgkyw&list=PLEoMzSkcN8oPH1au7H6B7bBJ4ZO7BXjSZ
- Emacs Tips: https://www.youtube.com/watch?v=wKTKmE1wLyw&list=PLEoMzSkcN8oMHJ6Xil1YdnYtlWd5hHZql
- Emacs Desktop Environment: https://www.youtube.com/watch?v=f7xB2fFk1tQ&list=PLEoMzSkcN8oNPbEMYEtswOVTvq7CVddCS
- Emacs IDE: https://www.youtube.com/watch?v=E-NAM9U5JYE&list=PLEoMzSkcN8oNvsrtk_iZSb94krGRofFjN
- Emacs Mail: https://www.youtube.com/watch?v=yZRyEhi4y44&list=PLEoMzSkcN8oM-kA19xOQc8s0gr0PpFGJQ
- Learning Emacs Lisp: https://www.youtube.com/watch?v=RQK_DaaX34Q&list=PLEoMzSkcN8oPQtn7FQEF3D7sroZbXuPZ7
Music credits:
Coriolis Effect by logos feat. stefsax, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/mseq/26296
reNovation by airtone, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/airtone/60674
ukeSounds by airtone, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/airtone/32655
Between Worlds (Instrumental) by Aussens@iter, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/tobias_weber/56664