Emacs org-mode
Welcome to the Emacs org-mode category.
You can subscribe to this category only via RSS!
I am working on restoring some of my related posts from my old blog, so keep checking here for new content.

-
This is, by the way, one of the reasons I did not want to start using special modifier layers like Xah Fly Keys or god mode. These can work, but they introduce another level of learning, like another dialect of English or similar. I might get there, but first I want to learn to use the Glove80 properly. ↩︎
- It tries to connect to a local host.
- If it fails, it next connects to an online dictionary at www.dict.org,
- The Collaborative International Dictionary of English
- WordNet
- V.E.R.A. โ Virtual Entity of Relevant Acronyms
- The Free Online Dictionary of Computing (it has an entry as an ASCII character)
- We write “wate” and we ask Emacs to complete the word by calling completion with ispell with M-C i. Because the only word that exists (in English anyway) that starts with “wate” is water, Emacs will complete it for us to “water” automatically.
- Now, while standing on the word “water,” we call completion again. Emacs informs us: complete, but not unique. In other words: the word water is real and complete (we have it spelled right) but there are other words that start with water.
- While still standing on “water”, we call complete yet again. Emacs goes “OK. So you know it’s a word that exists, and you also know there are other words that start with water, so if you’re calling complete again, you probably want to see the other words that start with water.”
-
This post from irreal is a good place to get a bit more understanding of how to use a local dictionary, a copy of the online one, and why. If you read it, you may find your way into Irreal’s older post and then this wonderful gem he found: You’re probably using the wrong dictionary. The way these posts are written, I feel it makes more sense to read them in the reverse order I presented here, inviting more exploration as you go โ however, if you’re short on time or patience, I recommend you read at least that last one, especially if you enjoy writing. ↩︎
-
As I was learning this, this next question popped into my mind: can we then look for a definition in Wikipedia and the Urban Dictionary as well? The straight answer: yes (it’s Emacs, duh). The full answer: it’s complicated. We can’t integrate it into the results buffer from
dictionary-searchdirectly, but what I can do is have it inside a “wrapper” buffer that will contain the dict.org definition with the Wikipedia and Urban Dictionary below it. For now, I’m fine with just usingeww-search-wordswhich initiates a search with Duck Duck Go, which already pulls Wikipedia search results near the top (Wikipedia itself forces JavaScript usage, which blocks Eww) ↩︎ -
By the way, something fun I discovered while researching: we can call the macOS dictionary using
dict://(as a URL link), and we can build a function in Emacs for it if we want. Further โ we could create something like this for offline situations only, but this is not needed at least in my case. Worth mentioning: there’s also the osx-dictionary package, which bridges Emacs and the built-in dictionary app on macOS. But why, when you have a different (and arguably better) version built in? ↩︎ -
hippie-expanddoesn’t really have a help file that lists all the functions, though I think I’ve listed most of those if not all above. Check out the package directly if you want to read more about the functions; they are described in comments at the top of the code. Online, it’s here, or you can navigate your way to the package inside Emacs with C-hkM-/, and then go from there to the package. ↩︎ -
Turns out you don’t have to do it this way: you can switch to the completion buffer, and then you can move around with arrows, including up and down, and select what you want with Enter like a normal human being. You could also add
(setq completion-auto-select t)to your init for this switch to happen automatically whenever you press C-M-i. ↩︎ -
As mentioned earlier, these packages and their functions go beyond what I’ll write in this post, but a few things are worth mentioning: company is much older then corfu, which came into existence after Emacs implemented completion-at-point functions; as a result, corfu is based on capf, and doesn’t come with anything “extra” out of the box besides a few option to display completion in a dynamic matter. Company, on the other hand, is a much bigger package that has a whole backend to it, complete with a lot of additional functions. I ended up installing and trying corfu, with Emacs’ native functions, and then installed cape (completion at point extensions) makes more functions available in a buffer than you’d usually have. What does that mean? Well, say you’re writing something in org-mode. the cap functions you have available do not include, for example, file names and paths, which you might want; these functions will be available to you when you are in a shell buffer (usually) โ it’s Emacs being Emacs and trying to be useful. So with cape, you can ask for that function to be available in org-mode as well. ↩︎
-
This post is here, on the new blog, because I migrated it from the old. The date on it is accurate however, and it’s the first post I have saved in my old archive. The same is true about the New Mexico post. ↩︎
-
There are a couple of more interesting parameters (options) to choose from. For example, alpha is a thing, if you like your windows to be translucent (and you can set it so that the frame in focus has a different degree of alpha than those out of focus). I played with it a bit, but eventually found it to be too distracting. ↩︎
-
But what are those anyway, and why do we need them? Let’s talk about auto-save first. It’s been there since the beginning. In the early 80s (and even before), when the idea of computers always being on and connected to some virtual cloud was science fiction, people lost their data quite often, either by hardware failure, power failures, and/or user errors, like hanging up the phone in the middle of a data transfer (these were the days of dial-up modems). Auto-saving a file was a feature that was a solution to a very common problem, and we can see it in computer magazines from the era (you can see those in the internet archive, look at page 70 in this magazine for example). As for backups, it’s a similar idea, but the purpose is slightly different. Think of backup literally means “back up.” The idea here is to restore the file from before you saved, backing up (as in going back) to what it was before you touched it. This idea is more closely associated with file-versioning, which Emacs also has, but that’s a slightly different story and it’s turned off by default. To differentiate the auto-save from backup files: In Emacs, auto-saved files are the ones marked with hashtags and the backup files are the ones with a trailing tilde:
#autosave-file#andlast-save-file~↩︎ -
There are a bunch of these helpful OS-file level functions available to us from inside Emacs. They are scattered in the Lisp manual in the file section, depending what you’re looking for. If you want a quick cheat-sheet of sorts with examples, Xah Lee has something a bit old, but still relevant. ↩︎
-
There are other functions around revert, particularly
auto-revert-avoid-polling, which is off by default. it’s a bit confusing:auto-revert-avoid-pollingmeans, avoid automatically polling for reverting. By default, this is nil (false) which means polling is on: Emacs does its own polling to check if a file was changed every 5 seconds by default (this is determined byauto-revert-interval). If this is flipped to true, Emacs does not check the file, and instead relies on the OS file notification system (inotify in Linux, FSEvents on macOS). This is good if we want to save battery and CPU cycles: our system checks if files were changed all the time, so Emacs just relies on that. In my case, with Syncthing, this is a bad idea because the OS may or may not catch changes done by Syncthing. My Desktop is always connected to power and my Mac is usually docked so leaving it as default makes sense. Check out the manual for auto-saving. ↩︎ - We’re visiting a website with our default browser and copy its URL because we want to write about it in Emacs
- We go to Emacs, and we kill the line we’re on because we need some space
- Crap! Now we lost our paste in the clipboard, and we have to go back to the browser and grab that URL again!
- Wait, which tab was it? Did we close it? Should we look in our browsing history? Ugh!
-
And here, dear reader, I fell down a deep rabbit hole, one that pushed this post a couple of days. There are two parts to this. The Emacs part, which I will explore at some point in the near future, has to do with Emacs’ menu itself, which is controlled by
easymenu.el. This is an old Emacs package that’s been around since 1994, written by RMS himself โ kind of. It was first created by Per Abrahamsen (who seems to be a bit of a mystery, but that’s digging for another day). In turn, this package was taken fromlmenu.el, which was part of yet a different Emacs fork at the time. In a regular Emacs style, the menu bar can be completely reconstructed and changed โ and that’s something I want to explore soon as a way to recall useful functions I keep forgetting exist (like having an “organize” menu with something like “org-sort” under it). This will be a fun project of its own for another day. Meanwhile, the other, bigger rabbit hole is the story of the GUI menu itself as we have it today. Apple has a big role here, back in the days before Steve Jobs left Apple and worked on the Lisa. This seems to be the first usage of a graphical interface in personal computers, and the menu, which was taken from Xerox, was a big part of it (there’s a short YouTube video there that would give you a quick brief of what happened). This means that I am right on keeping the menu in theme with the rest of the Mac apps, based on history! ↩︎ -
Emacs’ built-in help deserves its own series of posts. Looking at it now, from the eyes of someone who used it for a couple of years, I find Micky’s description satisfying, reflecting what I felt at the time: ↩︎
-
I forget how exactly, but some research into
winner-modehistory (turns out it’s been around since 1997 โ also, a lot of goodies here to look into!) led me down the path of tabs in Emacs,tab-barin particular. I didn’t think much about tabs in Emacs, but since I’ve been using Kubuntu for a while and experimented with its Workspaces, I understand the concept better. I looked into BSAG’s post, and it looks like you can hide the tabs while still displaying them on the mode line, and of course, you don’t have to use the mouse. The concept of having a whole workplace completed with its unique window arrangement available with a single keyboard shortcut is alluring. Now, instead of playing around with where and how I want my windows to display, I can just save (or re-create) those, and I always have a “work” environment vs a “personal” environment within the same Emacs frame. This can be a good organizational feature. I’m going to dig more into this one. ↩︎
Glove80: First Impressions โ the Typing Reset
I said I’ll do it, and I did. I got my Glove80 early! I looked at my emails yesterday afternoon, and there they were, waiting for me in the mailbox.
I was surprised at how light the box felt, even though Xah mentioned it several times in his review. I knew it was made of plastic, but this light? Yep. The other thing that surprised me was the size: they are smaller than I thought, which in my case is excellent (I have small hands).
I still need to pair it (or them? as in both parts? the gloves?) with Bluetooth to both my Mac and my Linux desktop, since I only used them connected (to charge them). There is a lot to like about this keyboard, but first the big caveat: getting used to it. Them. The thing. Ugh, take your pick.
Thankfully, this was not a surprise. It’s the big issue with this keyboard: it smashes your finger memory to bits and you need to start from zero again. I couldn’t get a single sentence through my journal yesterday, and I’m typing this post here with my old Kinesis keyboard because I want to put it up today โ but I’m working on it with tangent, which is designed for the Glove80 and even has an option to choose which layout I use, as it has several (I chose to stick with the default one, even though they have a macOS-dedicated one with two command keys).
I estimate it will take me about a week to 10 days of learning before I can start typing normally with it, and then another week or so to build speed and maybe add additional customizations. But that’s the main idea here: this keyboard feels right.
Even if ergonomics is not something you care about, having a keyboard that you can customize with buttons that work for your needs (and let’s be honest: Emacs, Linux and macOS come with their own unique needs when it comes to keyboards) can probably turn you into a better typist. Xah might sound a bit like a keyboard preacher, but one of the points I definitely got from him is that standard keyboards are designed after old typewriters (including the brick-like pattern of the keys), which does not make sense on modern computers. If I could go back to when I started learning to type on a computer, I would have taught myself to use columnar keyboards the same way we learn a second language.
It’s the same principle: your fingers won’t forget the old layout as long as you use it. I’m typing this on my Kinesis, and I’m fine. Meanwhile, this Kinesis keyboard is split wide apart (I have a mouse with a mouse pad separating both halves) in such a way that typing on a regular full-size keyboard (which is one board) does introduce typos I do not have on my MacBook’s keyboard, because I still use it enough. So take this to heart โ I think this second language example I use is pretty spot on1.
Besides the customized buttons (which can be done with many keyboards today), I like how it’s built and shaped. It makes sense when you look at it: the keyboard should fit your hands, not your hands fit the keyboard. And while the lightness and the plastic might not be everyone’s cup of tea, I do find that I like it.
The keyboard is very easy to pack in the included case and carry with you: It practically weighs nothing, and there are no wires to stuff in the case (it’s meant to be completely wireless). It’s easy to clean, and the palm rests (not the wrist rests, which is another thing, which might introduce a problem of its own) can be wiped off easily. The keycaps come off easily if you want to replace them with others, and I’m learning to appreciate the soft, quiet keys. I might miss the heavier, clicky switches on the Kinesis, but I ask myself whether that’s more nostalgia than a real need. After all, if this keyboard were loud and clicky, I’d think twice about bringing it to the office and annoying everyone around me. But hey, to each their own.
There’s a lot to like here, but I’m definitely still in the honeymoon phase. Give me a week, and I’ll probably write more about the issues I’ve encountered and why this keyboard might not be for everyone.
RSI/Pinky Update
I wanted to write a short update to my Emacs pinky / RSI situation.
I am still using my Kinesis Freestyle Edge keyboard. I think I’ve decided on the Glove80 as a replacement, but the price and the inability to easily return it are giving me second thoughts. Its style is very different, and I know I will have a hard time adjusting. Still as someone pointed out to me it’s not like I’m forced to throw away my current keyboard, which is true. I see myself using my Kinesis for work on the Mac while trying the new Glove80 on Linux for blog posts and more leisure-time typing.
I’ve made a few adjustments, however:
First, the spread between the two halves is much wider. This is something I was considering when I first got this keyboard, but I didn’t follow through with it. I got used to the wider split within a couple of days. It does make my shoulders feel better and more natural, especially when I’m standing at my desk. With that, I also started using the keyboard’s full tenting capability at all times: I used to have the keyboard flatter when sitting down.
The mouse is in the middle, and since I use it for quick bursts between otherwise typing sessions, it’s fine. When I game, I move it back to the right. I can basically ignore the entire right half of my keyboard while gaming, since most of the action happens on the left.
Gone is the Caps Lock as Ctrl. Caps is just Caps again. I’m still pressing it now and then out of habit, but for the most part, I switched back to using the original Control keys. I try to force myself to use my thumb, which means I have to curve my thumb into my left palm if I use the left side, or I just go all the way to the right and use my Ctrl key there. This is the most difficult part because it’s not just muscle memory: the Ctrl key is out of the way, and it can slow me down.
I also realized that the Windows key, which also acts as the Command key on my Mac, should be way more prominent than this keyboard allows. Thanks to PopClip on the Mac, I don’t use it much for copy-pasting on macOS (and since you have to use your mouse anyway to highlight text in Emacs, having PopClip is just a natural extension that I’m happy to have).
Speaking of the mouse, I know some of you will wrinkle your nose in disgust โ but I started using it more in Emacs. Sometimes when I want to select text further down or up from where I am with the mark, it’s just easier to grab it and highlight the text this way instead of using the keyboard. I am also in the process of rediscovering the menus in Emacs (yes, those menus that all of you Emacs gurus love to hide), especially when it comes to reminding myself of useful shortcuts I keep forgetting โ like registers, the mark ring, and other org-mode tricks I keep forgetting about.
My pinky still annoys me, but less. I seem to have this habit now of letting it hover over the keyboard instead of resting on the shift key. It’s almost as if I lost my ability to place my left hand correctly and naturally at times. It’s one of the things I hope the Glove80 might help with.
Emacs Config Gems - Part 5
Being a text editor (among other things), Emacs has quite a few tricks up its sleeve for making writing not just easier but also fun and seemingly magical. I call this section in my config “Wordcraft.”
Emacs Dictionary
When we need a dictionary, Emacs got us covered and then some. After version 28, Emacs connects to a dictionary as a two-step process by default:
This workflow remains in place as long as dictionary-server is nil, which is the default. It’s a bit confusing (to me anyway), since “nil” might indicate that no dictionary is set up, but here it means we simply didn’t introduce any configuration to it.
The online version at dict.org contains the Webster dictionary from 19131, which (if you follow the footnote) will start sounding like an excellent resource. What I didn’t know up until now however is that dict.org contains more than just this wonderful dictionary.
When you search for something like “US” with Emacs’ built-in dictionary, it checks this database and gives you results from:
There are others, like the CIA Factbook and the Bible, among others. All of those are at your fingertips, inside Emacs, from a simple quick search2.
The problem is that it’s an online dictionary. No internet, no dictionary. On my MacBook this can happen as I take it with me when I travel. Meanwhile, on Linux, I’m always online (desktop, wired connection).
Follow the footnote, and you will learn how to get that Webster dictionary (but just that, not the database at dict.org) working offline. As for me, I don’t want to set up an offline dictionary because macOS’s dictionary app3 (which works fine offline) is good enough โ a quick copy-paste and I’m done. So I configured my dictionary-server to point directly to dict.org, so Emacs doesn’t even search for a local one first.
Here is the setting itself, including the localhost option as a reference and a reminder:
;; (set dictionary-server nil) default, search localhost and then dict.org
;; (setq dictionary-server "localhost") local only, no online search
(setq dictionary-server "dict.org")
Hippie Expand
I learned about hippie-expand through Mastering Emacs. It’s one of those things that make Emacs magic. It uses different expansion functions (not to be confused with completion functions, which we will learn more about in a minute) to guess which word should come next in our text as we write, depending on which buffer we are in.
Following Mickey’s advice (linked above), I rebound this to M-/, which is bound to dabbrev-expand by default. It’s similar, but not as powerful (essentially it’s more basic; hippie-expand takes the functions that dabbrev-expand uses and builds on top of those with additional ones). Keep pressing M-/ to flip through suggestions.
The catch is that you need to open the buffers you want it to look through. For example, if I want it to pull words from my personal journal while writing this post, I need to have my journal buffer open somewhere. If you’re one of the people who don’t turn off Emacs often, this is not a problem โ just keep that in mind when you use it.
Turning it on (by replacing the command, using the same binding):
(global-set-key [remap dabbrev-expand] 'hippie-expand)
We also want to change the order in which it searches for things so it works better for us. For me, as a person who does less coding and more writing, I prefer it to look at Lisp-related functions toward the end. The same logic applies to global (all-buffers) lists vs those that operate on the visible buffer only. So our first M-/ will give us suggestions from our current buffer, and as we keep pressing M-/ and exhaust those, it will search all the other buffers we have open. for other suggestions4.
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-expand-line
try-expand-line-all-buffers
try-expand-list
try-expand-list-all-buffers
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
ispell
ispell is one of those things I set around the time I started using Emacs and never looked at again. I’ve made a mistake: I bound ispell-region to M-$. Those of you who use ispell often are probably perking an eyebrow: “huh? Why would you do that for? ispell does it by default!”
But somehow I didn’t know this. For years I highlighted whatever I needed to spell check, even single words. The default keybinding attributes M-$ to ispell-word, which checks the word at the marker, but if you have a region selected, it spellchecks the region. I should have given Emacs more credit; today I know better.
Another really handy thing I did not know about ispell is its ability to complete words I’m unsure of. But before we go on, please note that word completion (and completion functions) in Emacs is a big topic that I just spent a whole week on, and what I’m going to discuss here is just the tip of the iceberg.
First, the useful built-in completion built into ispell itself: l for lookup. Say you forgot how to write “psychiatry”. You type what you know โ “psy” โ and then call ispell, and as the suggestions show up, press l. ispell will ask you what to complete, along with a wildcard, so add * and then y so you have “psy*y”. ispell will show you what words start with psy and have whatever letters after but end with y. Useful!
Another thing I didn’t know: use R for query replace. This is good when you make the same mistake across several words. For example, when I wrote this post, I originally capitalized every ispell as Ispell. No problem. Stand on one of those, call ispell, press R to replace, and change it to ispell. Now you are prompted if you want to change all of them one by one, or, just hit ! and get it over with in one swoop.
With those quick tips, now back to completion functions.
Years ago, when I started using Emacs, I installed company with its minimal default settings and called it a day. It’s been working OK, and up until I started writing this post, I didn’t realize how much about Emacs completion-at-point functions (capf). Prot has a good video about this, which I’m still chewing through, but basically for ispell the magic happens when you stand on a word you don’t know how to finish and ask Emacs to suggest completions.
To understand how this works, Let’s say we don’t know if water is written as watter or watar, as a simple example.
Bam, we have a buffer full of words that start with water, like waterboard or watermelon. We can select a word from this menu, even though it’s a bit weird โ by going down or up with M-โก and M-โฃ, then insert the word we want with M-Ret5.
This is nice, but usually you want to complete words that you already know, or kind of know. If I type “psych,” I don’t need a whole buffer of words if I’m looking for “psychology”; I just slowly add letters until I find what I need โ and this is exactly what packages like company or corfu6 do.
Harper, languagetool and abbrevs
Let me just remind you of those for now and finish up this post. We will dig into those more next time.
This is now fixed: GCC drive error on macOS: This seems to show up with almost every new Emacs package I’ve been trying recently on my Mac. I remember trying to dig into it, and I went in circles trying to install something from Homebrew. Has anyone fixed this? I’m on GNU Emacs plus 30.2.
A quick update for my Emacs config Gems series:
I am working on part 5, and I’m trying to finalize a few things first. Currently it’s Ispell (I’ve not been using it to its full capacity) and completion… more details soon.
RSI and Emacs: When Your Pinky Says Enough is Enough
I’ve been doing so much Emacs writing lately, so I guess it’s time I get my Emacs pinky (which is a form of RSI). I made a quick reference to it three days ago and got a lot of responses.
What happened?
I started to feel a strain last week, but at first I didn’t think much about it. Sometimes my pinky rests awkwardly on the keyboard because I’m used to using the Caps Lock key, but it’s usually a hand-position issue. After I readjust and let my pinky rest, it goes away.
This time the strain didn’t go away, and my pinky kept rebelling.
My keyboard, Kinesis Freestyle Edge (the one here is the RGB+, the original RGB is discontinued), has a prominent Caps Lock key that just screams “use me as control!” For years, that’s what I did. As you can see in the picture, with my pinky resting on it.
The last week has been busy. I didn’t leave my small Manhattan apartment for two days, working straight from morning to evening, then gaming and sleeping. This isn’t normal for me and has taken a toll on my hands, and the RSI got worse.
I think my new screen also exacerbated the problem somehow. It’s much bigger and has higher resolution, which I’m still adjusting to by how I sit and how I move my head and neck. I also have a standing desk I usually use in its standing position in the morning, when I write these posts or work on projects โ these are easily my longest writing sessions, sometimes going for two hours straight without a break, especially in the last couple of weeks, and that’s all Emacs and pinky work.
When I thought about Emacs pinky in the past, I mostly thought of it with a smirk. I mean, it’s your pinky. How can you not read a comment about someone having their little finger hurt and not chuckle a bit? But folks, let me tell you, once you have it, you realize how much you depend on that one small finger, especially as an Emacs user.
My work, my organization, even my gaming in the evening (as it turns out), it’s all going through that little finger. Sure, it’s my “fault” for using Emacs, but if you’ve been reading this blog for a while you’d know that I owe many things to Emacs (including, among other things, my current job).
What am I doing about it?
For now, I’ve started using the keyboard’s dedicated control key again and changed how I use my hands. I try to use my right thumb, all the way to the side from the home row (my keyboard is huge, I will get to that in a minute) for when I need to use the left side of the keyboard, and then fold my pinky and use my knuckle to press it when I need the left control, for when I use the right side of the keyboard, as you can see in this picture:
This adjustment is the easiest, since I know where these Control keys are by muscle memory. I turned off my Caps as control on my Mac to make sure I don’t get tempted to go back to my old habit. It’s been working OK, and that’s what I’m doing right now for writing this post.
Other Emacs users have suggested several things, and I’ve been considering and trying a few of them.
god-mode came up a couple of times. It creates a chord (two keys pressed at once) key binding that triggers a control press. For example, sd, and then xs (separately) to save a file in Emacs โ same as C-xC-s. This can be useful, but it has two problems.
The obvious one is that this shortcut works only in Emacs. When I don’t use Emacs, which happens more often than I’d like for work, I have to use the OS shortcuts. Caps is so ingrained in my fingers’ memory that I just use it all the time, but now I need to start thinking of other options. I could probably program the keyboard’s firmware to do something similar, but that’s a topic in itself โ and if I do that, I don’t need god-mode anyway. Another odd issue is that it doesn’t work on my Mac. It throws a GCC error, which from what I gather has to do with Emacs internals and how it works (or doesn’t work in this case) with its internal compiling mechanisms. Yes, I tried the fix, which doesn’t seem to work well with Homebrew, and I gave up on it.
There are other packages like god-mode, but I think the next one I’m going to try is Xah Fly Keys, because what he’s after seems to make sense to me. Which brings me to the next point: a new keyboard.
New Keyboards
I’ve been considering a new keyboard for a while, and the RSI has sped up the process. I’ve looked at a couple reviews and YouTube videos in the last couple of days. Kinesis, my current keyboard brand, is a known name in the ergonomic keyboard world, but after checking out their Advantage 360 I’m not sure I’m sold. It’s an excellent premium-looking keyboard, but it’s having a huge and heavy keyboard again. My hands are small, and I’m not sure I want to commit to another expensive giant, especially when I already struggle with room for the mouse, especially when the two halves are spread apart for the shoulders. I already compromise on this, and my chest is closer than it should be. I also think that for the price of these keyboards (over $400), I might want to take them with me when I go to the office, and with a Kinesis keyboard, this is not going to happen. Another thing I’m considering is going wireless, because of my USB switch setup. It can take my Linux Desktop or the Mac up to 30 seconds to detect the keyboard when I switch, which is small, but still annoying. The mouse, connected by a Bluetooth dongle, takes a second to switch over.
The above reasons, and Xah’s reviews, landed me on Glove80, which is even a weirder-looking keyboard. This keyboard takes ergonomics further (or just looks crazier, if you’re not into those). It’s wireless and lighter, which means taking it with me makes more sense, and will hopefully fix the USB lag issue. It has keywells for the fingers, which is basically a “dip” or a bowl (hence the name) that curves downwards so your fingers, which are naturally curled on a keyboard, are resting downwards. It has its own super-light switches, which, while I don’t think I need them, are another example of thinking of RSI and finger pain.
Going further with light keyboards, there’s the Voyager, which is tiny, lighter, and minimal. It’s not wireless, but it’s meant to be mobile, and it’s probably the best one for small hands. However, the Voyager only has 52 keys. It’s meant to be used with layers โ meaning, there’s a modifier key that creates another “layer” of keys, which makes your Alt act as Ctrl, for example. I’m not sure I’m sold on this idea, especially when we’re talking Emacs. If I’m already challenged by my lack of Caps Lock, I can only imagine how much time I will have to sink into this keyboard with its layers and grid layout (which the Glove80 has too, by the way) to become efficient with it. I also think the Keywell is something I could use, so I have a rough idea of what I want to try next.
The problem with the Glove80 is that you can’t really try it out. They have a 30-day return policy, shipping not included, and they’re in New Zealand. A keyboard like that takes time to get used to, and 30 days for a $ 400-plus keyboard requires a level of confidence in the product I don’t have yet.
My conclusion so far
All in all, I think what I’m looking at is a combination of adjustments rather than one solution. I need to get used to the idea of different key bindings, be it something like god-mode or Xah Fly Keys, which will make it easier to use with a new keyboard and would also be beneficial now, until I get it. The idea of layering is a bit daunting, but I can see the wisdom in it, especially after I got an email back from BSAG, who was kind enough to share her experience with me (she’s the one who told me about the Voyager keyboard).
It will be a while before I buy a new keyboard, then it will take some time to get here, and then it will take me even longer to get used to one. I’m not looking forward to having my typing hindered even further, especially because I’m so dependent on writing notes all the time, but it’s also because of it that I have to do it. This is one thing I know I need to do.
Back to Solarized
Years ago, when I started the old blog1, I discovered Solarized.
I liked it. The colors were beautiful and worked for me, but eventually I switched to the Gotham theme in Emacs, which, if you take a look, is not much different โ just a bit darker. I stayed with this theme for a long time, tweaking it a bit after a trip to New Mexico.
When I received my Mac and started working on it at home, I enjoyed its automatic switching between dark and light themes. At the same time, Prot started coming out with more of his excellent Ef Themes, and I adopted ef-reverie for my light theme and ef-night for my dark one (once again, if you look at the images, you’d see they’re not far off from Solarized, especially my choice of a light theme).
This has been the state of affairs until the beginning of this week, when I “found” Solarized again. I discovered Prot himself was heavily influenced by Solarized, and he discussed it several times on his blog. Here’s part of his background story for his project Prot16:
My starting point for developing a colour scheme was Ethan Schoonover’s Solarized. A true masterpiece. I thus settled on a method of using a 16-colour palette that consists of 8 base values and 8 accents. As with Solarized, the themes would have to be able to transition from ’light’ to ‘dark’ environments with minor alteration to the mapping of colours (though not the values themselves).
Prot’s quest is an interesting one. Like me, he enjoyed Solarized, but eventually decided the colors were not contrasting enough for his taste. His reaction was to create his well-known Modus themes, which, along with his Ef-themes and Prot16, set new theming standards for Emacs.
Meanwhile, I have had the other issue since childhood:
I’ve never liked harsh contrast for this reason. As a matter of fact, a more “gentle” contrasting theme is one of the reasons I like working in Emacs. My website and my wiki are a result of these preferences. The black text on the beige background is comfortable on my eyes. Enough contrast to read, but not enough to burn text into my vision, as many dark modes out there do.
While Prot’s ef-themes offer softer contrast (I didn’t check, but it does seem so visually) which I find excellent, I decided to try out bbatsov’s Solarized for Emacs, which I didn’t know about in the past when I first picked up this theme for Emacs โ the official Emacs port is not as good in my opinion.
I’ve learned a couple of things I wasn’t aware of. For starters, you can have many variations of this theme, even though the main 16 colors are still preserved. It makes sense when you think about it: one person can choose Solarized’s red (#dc322f in hex) as an emphasis, while another can select its yellow (#b58900) or orange (#cb4b16), for example. Webpages and Emacs take it a step further, as certain texts can be bold or italicized, with solid underlines or dashed ones, etc. All of those changes take place without touching the colors themselves.
Solarized also helps me with a certain itch I’ve had for a couple of months: a dark theme for my blog. I know most of you read my posts in your RSS reader, hopefully with a theme you enjoy, so this won’t matter much. For me, how my site looks and is styled is important, and getting there is fun.
Emacs Config Gems - Part 4
Part four of Emacs Config Gems is about basic file operations and save functions. I realized as I was working on this that I have the frame configuration here, which is the wrong place for it. I will change it after posting. Alright, here we go.
When deleting a file in Emacs, we should use the system’s trash (or recycle bin) instead of deleting the file permanently, giving us a chance to restore the file in case we’ve made a mistake.
In addition, since we have this turned on, we can also tell Emacs to always delete non-empty directories (because they’ll go to the trash) instead of prompting. It’s just faster.
(setq delete-by-moving-to-trash t)
(setq dired-recursive-deletes 'always)
Let’s set the frame Emacs starts with to be a bit bigger. In Emacs, these measurements are in lines and columns (character width), so we’re basically saying: “make the default frame 100 characters wide and 55 lines high.”1
(setq default-frame-alist
'((width . 100)
(height . 55))
)
We might want to move Emacs’ backup files and temp files (those are the ones with ~ and #)2 to a different dedicated folder (emacs-bks) instead of the main Emacs folder. Since Emacs won’t just create the directory for us, let’s ask it to do so3. It won’t throw an error if we already have it.
(make-directory "~/emacs-bks" t)
(setq backup-directory-alist
`((".*" . "~/emacs-bks")))
(setq auto-save-file-name-transforms
`((".*" "~/emacs-bks" t)))
Now, let’s turn on the option to automatically save files we are working on inside Emacs, and set how long Emacs needs to be idle before auto-save kicks in. In my case, 300 seconds (= 5 minutes) is good enough for idle time. Importantly, I want to emphasize again, idle time. It will not auto-save the file as long as you type, so if you type non-stop for an hour and suddenly lose power, this will not save you, since Emacs didn’t get the chance to be idle for 5 minutes (or even 30 seconds, which is the default). For this, we have auto-save-interval, which auto-saves every 300 characters (globally in Emacs) by default. In my case, I’m lowering it here to 100, since I write plenty of quick notes (using org-add-note, C-c C-z), and it’s common for me to keep using Emacs between those without hitting the 300 mark. Both of those are described in the manual under auto-saving.
(auto-save-visited-mode t)
(setq auto-save-visited-interval 300)
(setq auto-save-interval 100)
Auto-revert checks the buffer we’re visiting against the saved file itself. If the buffer has no changes, but the saved file does have changes, it loads those changes into the buffer silently. However, if the buffer has changes (meaning, we’re writing something into the file and we haven’t saved yet), it won’t do a thing and won’t say anything. Since my particular setup means that all of my org files are inside a folder synced by Syncthing, this is ideal: if I save changes to a file on my Mac, when I switch to my Linux desktop I’ll have the file and the buffer visiting it refreshed and ready to go, provided of course that Syncthing is working and the sync is complete4.
(global-auto-revert-mode t)
Activate recentf mode, so Emacs has a list of the recent files we worked on last time, up to 30 by my config. 10 is too little; 50 starts to feel more like “everything I opened this month,” which defeats the purpose. Useful when we don’t want to navigate to the same file each time, and we don’t want to have a bookmark. Note: since I’m using consult, recent files are integrated and show under the file header in the consult minibuffer, and can be quickly viewed with f while visiting the consult minibuffer.
(recentf-mode t)
(setq recentf-max-saved-items 30)
Emacs Config Gems - Part 3
My actual configs start with pretty usual stuff you’d see across many other Emacs configs. As I was going through these however, I started to wonder how things work and why they ended up the way we have them today. In turn, that led to reading about the intention behind those, which led to more options I didn’t think about. Also, it’s kind of fun. I’ve made two more passes for this part alone in the last couple of weeks, and I could probably go for a third. When reading this post, if you want the good stuff (in my opinion), get lost in the footnotes as I did. There’s a lot to explore. I just scratched the surface.
Load Melpa
Melpa is where many Emacs packages live. The story behind it (from what I can tell) revolves around one of Emacs’ maintainers, Bozhidar Batsov, who pointed to Melpa at some point in 2012, when Emacs’s then go-to third-party package repository went offline. He is not its creator โ Melpa has been around before this post โ but this seems to be the turning point where Emacs package maintainers started to really use it. I don’t have good coder/repository maintainer knowledge, but from what I read, it’s built on the same idea as Homebrew (for Mac), which was familiar to many of the Emacs folks at the time.
So let’s get Melpa:
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
UI and Fundamental Emacs tweaks:
Most Emacs folks with a config file like this like to kill the toolbar, scrollbar, and menu bar. I find that the menu bar makes Emacs look more like the other programs, especially in macOS1. Besides, it’s nice to look every now and then and be reminded of good Emacs kung-fu I forgot exists (org-sort, I’m sorry my friend, I’ll keep saying hi more often).
This is why the menu-bar is commented out in my config; I want it, but I also want to remember I could turn it off if I wanted:
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; (menu-bar-mode -1)
By default, help commands2 display the help buffer in a new window without selecting it. I find this annoying: if I bring up the help window, it’s usually because I want to scroll down to find something or copy (yank) something. On the other hand, if I just want to skim quickly in the help buffer, it’s helpful that the marker is on it for a quick q for quit.
In addition, we want to be able to navigate help menus as Emacs intended if we follow the links in a help buffer. help-window-keep-selected allows us to keep help in its own dedicated window, so it won’t open in a separate window once we follow a link. Going back to the original is the same as we do in other browser-like buffers in Emacs, with l (like in Eww, for example). Likewise, we can go forward with r. I should also expand here on various help options; they definitely deserve a mention, but this is another huge topic (you can get an idea from the footer) that will take a couple of weeks. I will come back to this someday.
(setq help-window-select t)
(setq help-window-keep-selected t)
Lisp is full of parentheses, and it’s easy to lose track. Turning show-paren-mode on means that standing on an open or closed parentheses highlights its matching counterpart, which is handy.
In addition, while we’re here: when we stand on an expression that is only showing a portion of an expression (meaning, we need to scroll down to see the rest) Emacs can highlight the expression for us to make sure we don’t get confused โ this is the mixed option below for show-paren-style. If you want to see the whole expression highlighted every time you’re on it, there’s the option expression, which I’m leaving here for reference for myself. For now, I think it’s too much visual noise, especially since we’re using org-edit-special, which also highlights what we’re working on.
(show-paren-mode t)
(setq show-paren-style 'mixed)
;; (setq show-paren-style 'expression)
And now, a true Emacs classic. I don’t think I’ve seen a config without it: shortening “yes” or “no,” answer to “y” or “n” like any other program known to mankind. use-short-answers was introduced in Emacs 28.1, which is a more graceful way to do this, intended exactly for this purpose. Before that, back when I started to use Emacs, it was done with (fset 'yes-or-no-p 'y-or-n-p). If you have an older Emacs version, you’d need it.
;; (fset 'yes-or-no-p 'y-or-n-p)
(setq use-short-answers t)
This one was annoying until I learned this option exists from someone else’s config years ago: “Emacs, please stop asking me if I want to kill process when exiting Emacs (Shell, etc.), just do it!” Yep.
(setq confirm-kill-processes nil)
Emacs has two annoying keyboard shortcuts that I should have disabled as soon as I started using it: C-x C-c (exit Emacs) and C-z (minimize Emacs). Both of them are too easy to press by mistake, especially C-z, which is undo in many other programs. If I had a penny for each time I minimized Emacs by mistakeโฆ When we want to minimize Emacs (and why would you want to do that? Emacs deserves a prominent space on your screen), we can just do it by clicking the minimize window itself, shamefully using our mouse, as we do with other apps. And Exiting Emacs? With a shortcut that seems like it fits somewhere in org-mode? No thanks. Let’s disable those:
(global-unset-key (kbd "C-x C-c"))
(global-unset-key (kbd "C-z"))
Turn off the annoying error beep, which I first discovered in SUSE Linux by turning on a visual warning (a flash) instead. This will flash the top and bottom lines of our window instead of going “beep!”
(setq visible-bell t)
Turn on visual line mode so text lines “wrap” inside the frame and don’t continue beyond the window’s edge. This is essential; I can’t read in Emacs without it. And a newcomer I discovered recently: since Emacs 30, we also have global-visual-wrap-prefix-mode, which preserves indentation on wrapped lines. For example, in a list in org-mode (made of dashes one under the other), a long line of text that wraps will align under its starting point (dash) in the list instead of jumping back to column 0 (the start of the window, to the most left). This has been a huge pet peeve. Finally!
(global-visual-line-mode t)
(global-visual-wrap-prefix-mode t)
Winner mode (included in Emacs) is sort of “undo” for changes in windows’ layout in Emacs. C-c โ goes back to our previous setting, and C-c โ will “redo” the layout we just left. I use it all the time as in “oops, I closed the wrong window”3.
(winner-mode t)
Saw this over at https://emacsredux.com/blog/2026/04/07/stealing-from-the-best-emacs-configs/. This is a nice little trick, and it requires a bit of reading to understand what exactly it does: preventing Emacs from deleting whatever we have in the system’s clipboard when we kill a line, so it’s still in the kill ring. Here’s an example to help you grasp the idea and why it’s useful:
Not anymore! With this little guy, when we kill the line (step 2 above), Emacs “injects” it into the kill ring. Now, when we yank with C-y, we will still get the last line we killed, yes, butlook up the kill ring with M-y and voilร ! Your URL is there. No need to go find that URL again:
(setq save-interprogram-paste-before-kill t)
You know how for years Emacs “jumped” when you scrolled down large embedded images in your org buffers? Let’s turn on pixel-scroll-precision-mode for pixel scrolling instead of the default line scrolling to fix this. It’s pretty much what it reads: the default old way would “scroll” (it’s actually not scrolling at all) by a line of text at a time. Since our image of, say, 600px in height is treated as a single line of text, it will jump to the end of it. With this option turned on, Emacs would read the pixels from your mouse wheels as you scroll, and we get the smooth scrolling we’re used to.
Interesting to know: moving up and down the line without a mouse (arrows, or C-p and C-n) is moving by text lines, utilizing auto-windows-vscroll and line-move, which basically does in Emacs what arrow movement seems to be doing in modern applications: these apply this principle from the other direction โ they natively work with pixels, so they treat these arrow movements as a fixed number of pixel movements, which is approximately a line of text. So, when you move up and down a large image (or say a PDF) in a browser, the browser thinks “ok, the user is moving up one line of text, which is.. hm.. let’s seeโฆ ah, it says it’s exactly 40 pixels, so let me show that”.
(pixel-scroll-precision-mode t)
test break
“Emacs is the editor of tinkerers and artisans; those who are eternally dissatisfied with all other tools because of their adamantine rigidity. Crafting, or shaping, your tools to meet your exacting needs is what Emacs excels at. Because of that, Emacs is โ much to the chagrin of everyone who picks it up for the first time โ squarely aimed at people who already know Emacs.”
In fact, if you’re curious about help and Emacs help, I suggest you head over there now and read that post. It expands on how to approach Emacs help by how to think Emacs, which is something that experienced Emacs users struggle to explain to newcomers.
As for the history of help in Emacs, I think it’s pretty safe to say it’s been there since the start, or at least since Emacs became intended for public use, sometime around the 1980s. By that point, most of the core help parts we know today (the tutorial, C-h t; the Emacs Manual, C-h R; as well as the framework itself) were already in place. The help system was there before GNU Emacs, back in the days of TECO Emacs that RMS worked on at MIT in the 1970s. You could browse the original code from then (preserved by MIT) and see how Stallman explained what certain commands do in emacs.doc inside that repository. Another interesting find about Emacs itself (and the help system that comes with it) is the EMACS paper written by RMS back in 1981. For the help system, take a look at page 17: “6. Self-Documentation and Extensibility” and the following chapter in page 18: “7. History”. Fascinating stuff.
Still working on Emacs Config Gems part 3. Fell into a deep rabbit hole and got lost for a couple of days, then climbed out just to discover another one I have to explore next. I wanted to crunch the first few tweaks of my Emacs config in one post, but there’s too much to explore. I’m getting there!