Protesilaos Stavrou: Commend on Unix versus Emacs
In this post, Protesilaos answers an email by one of his readers. In the email, the sender seems to assume that Emacs is bloated by definition, and that e.g. Vim isn’t, because it comes with less stuff baked-in and works well with piping – the core way to compose in *nix command lines.
The sender asks:
This video [of Luke] really provide some good reasons why to invest on ‘coreutils’ to build a small, maintainable and decentralized system rather than investing on a giant mutable system.
Emacs being the giant, mutable system, and the pipe-able Unix command-line tools comprising the “maintainable and decentralized system”. (That way of asking is loaded with assumptions already.)
Prot does a very good job at not preaching, and actually bringing forth useful arguments.
- Vim has a lot of stuff built-in, like a terminal emulator, and isn’t that different from Emacs in that way. (Plain
vi
is a different beast.) - Prot treats Emacs “as a layer of interactivity on top of Unix”. That’s a very good description, I think.
- There is non-negligible overhead in composing a system of many independent pieces. You end up writing a lot of glue code, so to speak. (And it can be rather brittle.)
- Emacs ties things together into a coherent software where you can share stuff between pieces of functionality easily. You can copy from the Emacs shell and paste in a text buffer. You can perform mass text replacement from a UI you already know instead of having to learn syntax. (Opposed to
sed
/awk
/…)
In closing, Prot points out that the underlying issue can be binary thinking (which is rather limited and avoids entertaining opposing opinions):
This hints at the kind of thinking that treats the world in simplistic, binary terms: Unix is simple VS Emacs is complex; Arch Linux is for hackers VS Ubuntua is for simpletons… Those are stereotypes that rest on misunderstandings about the intent and the purpose of each of those paradigms, their context-specific pros and cons, as well as the potentially numerous reasons one may have to opt for a given choice.
Worth a read during this time “between the years.”
How to Profile Slow Scrolling (And Other Performance Bottlenecks) in Emacs
I played around with Nicolas Rougier’s NANO Emacs configuration because it looks so hot and I wanted to try some of his tasteful settings myself. One thing that let me down for a couple days since I started eyeballing the package was performance. In my huge org files to organize app development tasks, scrolling was so-so. Pixel scrolling, which I discovered through Nicolas’s configuration ((pixel-scroll-mode +1)
), didn’t work at all on my machine. I have a MacBook Pro 13" from 2020. This is a text editor. Something’s not right with my config.
Pulse to Highlight Yanked Text in Vanilla Emacs

I somehow found Abin Simon’s post about how he made pasting text in his Emacs “pulse”, aka temporarily highlight the pasted region. In Emacs parlance, pasting is called “yanking”. His post sadly covers only one use case: Emacs with evil-mode
, which adds vim keybindings and apparently also adds a special evil-yank
command in place of the regular yank
.
Markdown Mode Fixes Imenu Tag Generator
I installed Treemacs the other day and found out, to my excitement!, that you can not only hit TAB to expand folders, but also to expand files! When you “expand” a Markdown file, you see its headings in the file explorer. That is bonkers, and so useful for larger writing projects to get a unified overview!
OpenMoji Support in emacs-emojify

If you have no dignity (like me), you might enjoy displaying emoji in Emacs. I actually really like that when composing/reading email, and when I want to add colorful stuff like stars in my to-do lists. There’s this package, emacs-emojify, you might want to check out. When you install the package, it will download EmojiOne images by default. You can set up your own, and I found the OpenMoji set to look very nice. Clear lines, crisp shapes, very recognizable expressions in big and small sizes. Love it.
Convert org-babel Markdown Blocks to HTML

During app development, I track the tasks in an org-mode task list. And I track the stuff I finished and want to highlight in the release notes in a Markdown block right there. When I release an update, I’ll copy & paste the Markdown part to the “Release Notes” of the app and push the changes to the server online.
Making Emacs Autosaving of Files Ignore Email Drafts

This week I noticed that a ton of files like *message*-20201029-134012
piled up in my home folder. These are email drafts from message-mode
, and the numbers are a date-time-stamp. These didn’t appear ever before. So I figured it might have something to do with autosaving after looking at the change history of my configuration file – and it sure does.
Shorten Emacs Yes-or-No Confirmation Dialogs
Some commands in Emacs and its various packages are destructive. They require a confirmation by the user. These usually use yes-or-no-p
, which won’t complete the command until the user replies by writing “yes” and then hits enter, or “no”, or aborts the command with C-g. Some of the commands that require confirmation in this way are overly protective, I find. Like projectile-kill-buffers
(C-p k) which closes all open buffers for a project at once. I use this heavily when e.g. editing my website: jump into the project, edit a file or two, commit, then leave. I don’t want to type “yes” and hit enter just for that. (Please note that killing a buffer this way will still ask me if I want to save or discard changes, so the kill command alone is not destructive.)
Export Day One (macOS) Journals to Emacs org-mode Diary Entries

I noticed that I still had the journaling app Day One (macOS) on my computer. I haven’t touched it in ages. So I figured it’d be time to export to plain text and then shove all the goodness from 2004 and onward into my Emacs org-mode diary.org
. Turns out there’s no Day One to org-mode exporter.
Make RVM's Ruby Available to Emacs Shell Commands
No matter if you use exec-path-from-shell
or not, Emacs will not be able to know your RVM-managed Ruby information. This drove me crazy. Most Emacs shell commands are invoked in an “inferior” mode, aka a “dumb” shell. This includes M-!
, M-x shell
, and also the projectile compile commands. That’s when some of your user login scripts will not automatically load, like the entirety of rvm
, the Ruby Version Manager.
Add HTML Entity Picker to Emacs
Emacs comes with a lot of stuff out of the box, but I was missing TextMates “Insert Entity” action that lets me search through HTML entities by name and then insert "
or ™
for me. I can never remember the names of typographic quotation marks in German, for example.
Delete the Next Word or the Current Selection in Emacs with the Same Shortcut
When you delete a character or the current selection, you usually hit C-d
(Control + d) in Emacs. I got into the habit of revising drafts by deleting whole words, and the M-d
(Meta + d) key combination is super useful for that. It also works into the other direction with backspace. It’s essentially the same effect of ⌥+backspace everywhere else in macOS.
Indie Support Weeks: beorg

This is week two of the COVID-19 lockdown that led to #IndieSupportWeeks
to help independent developers get a shoutout and maybe find a couple extra customers.
For today’s installment, I picked beorg.
beorg is a bit weird. It’s basically a task manager and calendar, but based upon plain text files that I sync via Dropbox. It’s not a particularly user-friendly application, and its UI didn’t win any prizes, unlike e.g. Things or OmniFocus (I’m often confused by the app icons and lack of labels, but also glad because my iPhone 5S screen is so smol). So why did I pick this app, then?

beorg is a mobile companion for my Emacs org mode files. It’s capable of handling org mode outlines, and parts of these outlines can be tasks or TODOs, and you can group them in projects, and then display an overview or “Agenda” – and things get out of hand quickly from there. Emacs is ridiculously customizable, and org mode is no different. beorg makes these information available on mobile.
So since over the years I moved from OmniFocus 1 to Things to OmniFocus 2 to Emacs, I got used to viewing tasks on my mobile phone and iPad; and I really much like the capability to capture information on the go. A piece of paper will do most of the time; but having a web clipping synced to my computer directly is nice.
You can even write Scheme scripts inside beorg! I haven’t touched that topic at all. The REPL (yes, it has a REPL!) provides a sandbox for experimentation, and by convention beorg will load and run init.org
file from your list of files right after bootstrapping. You can even customize the app’s UI with this. Writing org files that auto-execute during launch to customize the behavior of the editor is a long-running theme, see this random example (source).
Regarding the business model: most stuff is free, and the free version will get you really, really far. You currently can buy access to additional features:
- “Properties” will let you add custom key/value pairs to any item; it’s mostly a UI affordance for the plain text underpinnings
- “Encryption” to, well, encrypt your items or files
- “Task Timers” to track how long you work on a task (ahem, I suggest an automated service like Timing for that; note: this is an affiliate link)
- “Templates” are pretty self-explanatory, and org mode capture templates can get out of hand and cover JIRA ticketing, for example (did I mention you can configure org mode to sync with JIRA?)
- “Export Themes” are CSS styles to generate HTML from your outlines because, well, org mode is supposed to be a structured markup language for HTML and LaTeX export and such thing
- “UI Themes” for Solarized and additional dark modes in the app
- “Saved Searches” to more quickly access the results of complex searches
- “Box Sync” to … sync to Box.net (beats me why this of all things is an add-on)
The developer provides release notes for updates in the app, which I absolutely adore for this kind of “make it your own” pro user application, to make sure I keep up-to-date with the good stuff. The tip jar that goes along with it is probably the main source of his income – at least as much as I’m concerned. The updates are really good and much appreciated.
- Check out the beorg website and the blog
- Make sure to browse the forum to see what people tinker with and post bug reports and feature requests
- Watch screencasts and read amazing how-tos
- Find beorg on the iOS App Store
- @beorgapp on Twitter
Print Current Date and Time in Emacs Minibuffer
I don’t show a clock on my computer. Sometimes, I quickly want to find out what time it is, though. I often run date
from the shell to get the current time, and can often get there in my Quake console-like iTerm 2 Hotkey Window by pressing the “up” key since I seldom use the Hotkey Window for anything else.
Native macOS Notifications for Emacs Org Tasks and Appointments
Emacs is a text editor, kind of. But I use its Org mode for “keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system” – its Agenda became my daily productivity hub. It’s a calendar view of all things scheduled for the day, plus some other info interspersed: thanks to the plain text nature of the whole interface, it’s simple (albeit not easy) to re-style everything you see there. Add sub-headings, spacing, links, text, what have you.
Prevent Emacs Compilation Window From Displaying Other Content
By accident I found a setting for emacs windows that prevents a window from displaying any other content than what it currently is showing. It is not locking the textual contents but the buffer. That means you cannot show the contents of another file, or change the currently visible help page, or whatever.
Quit and Close Emacs Special Windows Like Help and Compilation Results
Emacs can display interactive help windows (the content/buffer name is called “*Apropos*
”), and compilation results. I managed to limit the height of the compilation window to 10 lines already. But when I have the compilation results pane focused, I want to close and dismiss it quickly.
Emacs Settings for PHP Development

The project that I’ve been working on over the weekend, I worked on in emacs. This is part of my re-learning the basics of text editing and programming in emacs to slowly move away from TextMate when it comes to scripts. I want to move away from TextMate because I eventually want to transition to be productive on a Linux machine – that means, to create stuff in an otherwise foreign operating system. Emacs is portable, so that’s a good start.
Fold Current Level-1 Heading in Emacs Org-Mode Outlines
There’s no standard shortcut to fold the current subtree of an org-mode outline. When I work in org-mode outlines, I usually am 3 or more levels deep into a so-called “subtree” and want to get back to the root item, fold it to hide the details, then drill down into another item. I use that when I am working on an app and want to have a look at a planned milestone nested deep down at a different point in the outline.
Emacs for Remote SSH Python Development

I am using Emacs for over a year now to manage my tasks. I like how I can mix tasks with long form notes in a single outline. It’s good. We had to play with vi
and emacs
for a while at University. I’m very happy I got used to the very basics of both editors because I ended up using vi a lot when SSH-ing into remote machines, and now Emacs for everything else.
Sync Emacs Org Agenda Files via Dropbox Without Conflicts
I use beorg on iPad/iPhone to view my Emacs Org files. Until today, I did use it only for viewing files, not edit tasks, because I ran into sync conflicts. This is how I solved the problem with a few simple1 settings. First, put your org files into the Dropbox. I have all .org
files in one directory and use the directory as org-agenda-files
:
Add Blog Post Text Template Expansion to Emacs with Org Babel
In my quest of total immersion into Emacs, I am trying to write blog posts in Emacs instead of TextMate. That means my TextMate macros are gone for good, including insertion of YAML header information. On this very blog and on Zettelkasten.de, I used to type cthead
and zkhead
respectively, then expanded the YAML header with tab. TextMate’s great template feature even allows you to specify multiple points inside the templates to jump to by tabbing forward. Emacs works a bit differently, so I adapted the templates to request information up front instead and fill in the values.
Indent Code and Lists by 4 Spaces in Emacs Markdown Mode
I noticed that my Emacs didn’t maintain the current line’s indentation when editing code blocks in Markdown (markdown-mode
). I indent the first line with 4 spaces like any sane person would. When I hit enter to continue in the next line, thanks to the markdown-mode
defaults, I am presented with a new line that’s properly indented visually. Only when committing to git did I notice that Emacs inserted tabs instead of spaces. Gasp!
Global TODO Capture Hotkey for Emacs Org Mode on macOS
I am using GNU Emacs for a while now to do all kinds of stuff. I’m thinking about migrating away from OmniFocus as my task manager and use Org mode instead. What I like so far is the free-form list nature of Org files. I can have an outline of notes and sprinkle TODO
items inside them. This way I can take notes on puzzling problems I’m working on and mark things I need to do later. This is super useful to remind myself what to clean up before a commit, for example write or amend tests or remove debug code somewhere. I like it. I got used to a lot of shortcuts already, so most of the pain of daily use is gone.