Howardism
Guess who is trying to get their RSS feed working again?
Demos in Emacs, Part Deux
Revisiting my decade-old demonstration code, I created a new approach. I also realized I had something more general that may have wider application. Oh, and I get to show you how I go about writing Lisp macros.
And now to you use it in recording my talk for EmacsConf 2024.
Playing with Emacs
This year’s EmacsConf was really good with some interesting talks and ideas. I really appreciate all the lovely comments and compliments about my talk. Thank you.
(I also copied the video to YouTube)
Linkage:
- Ironsworn Emacs project code: emacs-ironsworn
- Note that this code depends on my earlier project: emacs-rpgdm
- The alpha version of a RPG Toolkit code: emacs-rpgtk
Query JSON Documents in Emacs
While working on a web interface spitting out JSON, I wish I had a jq
-like interface in Emacs. Easy enough to write.
Better find-file for Org Files
What if find-file
in Emacs, along with the file’s name, could display more information, like the title or tags of an org-formatted file? I made this using ripgrep (so fast, we don’t need an index), and with extensions to completing-read
(like Ivy, vertico, or Selectrum), I can filter and narrow the list of all org-files, until I find what I want.
Mastodon
Yes, Mastodon is the talk of the tubes, and I’m glad this new federated service has its day in the sun.
Before Twitter went mainstream, only technical people used it, and it felt like a nerdy community. Those days are long gone.
When I first grabbed my Mastodon handle over at mastodon.xyz
, I could see the potential for community, but without people I wanted to talk to …
This changed when Louis Brauer created emacs.ch; I found a nice, nerdy community, and now that everyone else has joined the federation (thank you head twit), we get to take advantage of all the nicer features that Mastodon offers.
Follow me on Mastodon!A Second Chance for Eshell
During EmacsConf 2022, I gave a lightning talk with 10 minutes (actually 14) to present the top 10 Reasons why you Retry Eshell. But the talk ballooned, and I felt the content was too condensed to be useful. I wrote an essay to fill in a lot of the details (as well as links to the extension code).
Beep for Emacs
When starting a long process, I prefix a shell command with beep, a shell script I wrote to alert when the process had completed. I’ve been wanting to have a version for Emacs, and thought that I would also demonstrate how easy it is to add a feature to Emacs.
Updated: Enhanced the function to only “beep” when a command when too long, which means I can attach the beep to just about any function without getting annoyed if the function immediately returned.
Focused Work
While I’m intrigued with the Pomodoro Technique… you know, where you work in discrete time segments, with equally discrete break intervals. Perhaps making the work/relax cycle more specific and focused may convert these cycles into practice, and condition our brains.
However, while I would like to focus my thoughts in discrete bursts, I don’t want to interrupt the flow. You know, that mental groove where one is really productive. I certainly don’t want a jarring ding to shatter that flow.
I’ve decided to try an experiment to see if I can make the cycle changes noticeable, but not disturbing. The code is particular to my workflow, but perhaps you can convert it.
Extending Emacs Completing Read
Other than editing buffer, the most common user interface in Emacs is completing-read
, which allows you to select an item from a list of choices. I thought I would expand on it with a bit of Lisp code to explain how to give your interactive functions a bit more interaction.
Web Browsing and Emacs
I use three different browsers, but I really want all of them to be as mouse-less as possible. Here is a discussion of my Emacs and browser configuration. Do you have similar tips you’d like to share?
Project Piper
While awfully early for folks like me in the Pacific Timezone, I really enjoyed EmacsConf 2019 (I’ve never attended a conference in my pajamas before). My talk was plagued with technical issues, and I’m sure it came across pretty disjointed. I am planning on re-recording this talk and putting it up on YouTube.
I have written a transcript of the slides for my presentation, as well as a lengthy essay on the project. The project is only for interested tinkerers as it is really just a proof-of-concept, but if you’d like to play, pop over to emacs-piper project on Gitlab.
Getting Boxes Done
Benjamin Franklin once wrote,
“For every minute spent in organizing, an hour is earned.”
Due to Emacs, I may have accrued nearly a lifetime by now.
I’ve been tweaking and refining my take on the Getting Things Done process, and thought I’d share my process. As a recurring theme on my website, the original essay bloomed into three separate chapters:
- Chapter 1 illustrates my workflow with a flowchart
- Chapter 2 describes my Emacs configuration and helper functions
- Chapter 3 contains code for turning an Org subtree into its own file
Would like to hear your opinions for how you keep your tasks and goals organized.
Capturing Content for Emacs
Continuing my multi-year quest to craft a pensieve made of code and text files, I’ve been lately focusing on ways to quickly copy content from various sources into this text mind.
If you are not familiar with this Emacs’ org-capture
feature, check out my gentle introduction.
If you use org-capture
and want to level up, check out my advanced org-capture ideas.
Advice for Code Reviewers
While the primary goal of code reviews is better software quality, we can’t loose sight of two other critical goals:
- Creating better programmers
- Creating cohesive teams that collaborate well
These two bullets have got me thinking, and thought I would share some techniques I have learned over the years in regards to effect code reviews.
Review of Keyboard.io
While all projects take longer than expected, good ones where the craftsman cares about the quality, require even more time, but now I am can type a review on my new keyboard.io, I love the results.
Presenting EShell
Gave a demonstration of EShell to both the PDX and London Emacs User groups. While the recording may be fun to watch, feedback told me that the white rabbit holes I dived into were interesting, a transcript of the slides and demonstration may be easier to copy/paste.
Breadcrumbs from a Hack Night
Last night, interested Emacsians from around the PDX area gathered together for a hack night, with a goal to implement a rudimentary, breadcrumb project. The basics of how to make a breadcrumb project should be easy to grasp for a group of hackers… and also fun to extend after everyone leaves to home.
I polished my notes from the evening and cleaned up some of the function and variable names (no, they weren’t offensive… just silly).
The end result turned out to be a great start to a personalized approach to remembering and jumping to file positions.
New File Templates
Just because we need a lot of organizational support characters in your text files doesn’t mean you have to physically type them all.
After a fun discussion with Mr. JJ Asghar, I wrote up a mini-tutorial on getting Emacs to do some of the heavy typing for you when you create a /new file/… you know, boilerplate needed when creating a new file of a particular type.
My tutorial covers and integrates the auto-insert
feature and the
yasnippet
template system.
Demystifying Regular Expressions
Next month, I will be hosting a workshop on regular expressions at Open Source Bridge. Should be lots of fun, and to prepare, I’ve been updating my Regular Expression Scratchpad with a tutorial.
Reviewed the Kinesis Foot Pedal
I was asked to review the new Kinesis Foot Pedal, and while I have a wee bit to tell you, I was really intrigued with how I could use it towards our ever increasing goal of getting more power with fewer finger movements.
Spoiler Alert: I talk about the Avy package.
Emacs: The Pair of Old Jeans
In this old essay by Steve Yegge, he has a nice synthesis of static vs dynamic types, but also includes lots of interesting observations on Emacs (one would have to, since static vs. dynamic is almost as old a debate as emacs vs. vi). I liked this quote:
People have observed that Emacs has QWAN1: a nice, organic, comfortable rightness that fits like a pair of old jeans, or a snug warm chair in a library by a fire. It’s very right-brain stuff we’re talking about here, all touchy and feely and sensitive: exactly the kind of thing that programmers are often so lousy at, so it’s no wonder we don’t know the recipe for building it into our software. But unlike with UI design, software QWAN can only come from the programmer, who is playing the roles of interior decorator, head chef, and ergonomic consultant for all the programmer-users of said software.
Skinning Org Mode
While I never intended to make Org Mode look or behave like a word processor, but with slight tweaks every now and then, that is my end result. Although all my code is in my dot-files repository, I figured I better highlight just the applicable code.
Tutorial for OrgLitProg
Yesterday, I hosted a workshop on Literate Programming with org-mode for the PDX Emacs Hackers group. For everyone who couldn’t attend, I decided to expand it into a tutorial.
Warning: The examples are pretty lame.
PS: I think that I have finally figured out my RSS woes, so you shouldn’t have issues if you follow along.
Emacs and imenu
If you haven’t used imenu in Emacs, you should try it. It gives you a way to select all top-level items of a file… functions and constants in source code or headers in an org-mode file.
I have a couple of suggestions to make the interface a bit nicer:
Code Density?
Sure we should program as if we are writing for our team mates, but writing code for people is far less precise, for what might be readable to one, may be Perl code to another. This essay is simply the start conversations…
Online Turing Machine
My daughter read a book about Ada Lovelace, which generated discussion about Alan Turing, which generated discussions about computers, which showed me how much kids not only don’t know about computers, but how unlikely they are to understand the guts underneath the icons.
Over the weekend, I completed my personal hack-a-thon on a project to demonstrate the depths of a computer, but in a simpler way. I may give it to my after school computer club that I run at a local middle school.
Pretty simple as my entire assembly language parser was written as a
single reduce
function.
Git Rebasing and Magit Demo
Had a good time at the first Portland Emacs Hackers meetup. I couldn’t record my presentation on Magit that night, so I recorded my demonstration of Magit and its ease of rebasing.
Also, some teammates accidentally pushed a merge into one of our repositories at work, so I wrote shortcut instructions on keeping a clean, sequential Git history.
Deploying!
My current dayjobgig is building private clouds, and I’m surprised at how much context switching I need to do due to waiting for the bloody things to deploy.
Perhaps I need to invest in sword play.
I was Schooled
Each week, I teach an after school class at my local Middle School. Today, while getting ready to present, I switched over to the browser tab containing my presentation and waited for the kids to take their seats.
One girl raised her hand and asked about a browser tab that showed Emacs Meetup. Clearly she wouldn’t care about some old programming editor, but I quickly summarized so I could get to the lesson. She said she uses it to play snakes. I told her that she probably uses something else, as Emacs is just some old editor. She insisted.
She quickly fired up Terminal on the Mac, typed emacs
, and
promptly entered =M-x snake=… How…how…did you do…know that?
While I wrote a version of the snake game on my Apple ][ computer
when I was a kid, I didn’t know that any one had written one for
Emacs. Huh. Schooled in my editor by a kid.
She also typed in telnet towel.blinkenlights.nl
.
She’s now my favorite.
The Power of EmacsConf
I was asked to speak about Literate Devops at EmacsConf 2015. Due to work and family complications, I knew that I couldn’t physically attend. Wait, what year is this!? We should open a can of virtualization on this meatspace! The week before, we tested out the technology, and the Furies looked favorable upon me to remotely attend a live conference.
On Saturday, September 29th at 9:00am, I sat at my large monitor, carefully arranged into windows of note taking Emacs, conference twitter feeds, the #emacsconf
IRC channel … and of course, the live video feed. “This is good,” I thought. No struggling in uncomfortable seats to power small-screened laptops. I had all the coffee I wanted, and just the way I wanted it too.
The first talk, by Nicolas Petton (who was also presenting remotely from France), illustrated immutable data structures and lazy sequencing from Clojure to Emacs Lisp. I thought, “This is going to be a great day!”
And then it happened. The power went out halfway through the second talk. Using the battery and data service on my cell phone, I went to the power utility’s web site. Their power outage map was covered in red. Estimated time began at 12:50… then 1:30… then 3:00…
I panicked and put out a plea for help. I quickly cross town to the first friend who responded, to give my talk perched in his living room.
My demonstration went well enough (I start at 1:27:00), but I was frazzled and the environment on my laptop was less than ideal. I received some very thoughtful compliments, however:
Your talk on Literate DevOps with Org-Mode was fantastic, and everyone was blown away by it. You had a really stressful day, but you gave the talk anyway for your fellow emacers, and everyone really enjoyed it. I really appreciate the effort it took to go through with the talk after your power cut out. An excerpt from IRC at the end of your talk:
The virtual clapping on IRC was pretty humorous:
| 5:41 PM | <tered> <clap clap> | 5:41 PM | — cestdiego *claps* | 5:41 PM | <python476> <fingerclap> | 5:41 PM | <Caine> great talk | 5:41 PM | <momerath> thanks Howard!! | 5:41 PM | <cestdiego> M-x clap | 5:41 PM | — offby1 stomps feet | 5:42 PM | — python476 flips IKEA desks
While the entire experience was interesting and enjoyable, I just wasn’t pleased, and felt my fellow Cultists in the Church of Emacs deserved better, so last night, I re-recorded myself. The audio is better, but it doesn’t have the questions and answers afterward.
See you all next year at EmacsConf 2016!
More Literate Devop Examples
I’ve collected some table formatting code for OpenStack’s nova
command, and placed them in an Tower of Babel file that make
:post
commands in org-mode files able to use them.
The os-table
function, in that file, converts the ASCII tables
from OpenStack’s CLI into org-mode
tables that I can export,
render, and feed into other code blocks as values. This feature
came in handy today…
How Often do you Commit?
For your own projects, you can commit to Git anytime, but one of the advantages of committing frequently is sharing code…either to your team mates or even to yourself. Best approach, however, is to commit a single bug or feature at a time, but use Gerrit to make sure that single commit is perfect.
Whence Forth?
A friend of mine once asked me, “why was Forth so much fun?” to which I responded, “I may have to write a blog entry to explain and reminisce…”
Updated my Literate Devops
Today I got around to playing around with the wrap
and the post
options to org-mode
source blocks, and updated my Literate Devops
essay, to help explain how I email my formatted notes directly to my
team mates.
Meeting Etiquette
I have been in many meetings over the years where the presenter’s screen is more of a distraction. If you find yourself sharing your Macintosh desktop, may I suggest a couple of tips?
TMux: My Starting Guide
While I seldom leave Emacs, I do dabble on the shell from time to
time, and many colleagues ask about my terminal usage with tmux
,
so I present my very-opinionated Getting Started Guide to TMux.
Literate Devops: With Databases!
I swore I wouldn’t put any more examples of my literate devops
idea, but when I habitually used org-mode
during a recent
exploration of MySQL database instance, followed by emailing the
results to my teammates, I thought I would share. Read more…
Update: A section of the exported document on accessing a database can be viewed here, but a few of you have requested the original org-mode file Enjoy!
Folder Actions for Emacs
On the Macintosh, the Finder can trigger a script due to any change
of a file in a directory (Apple calls these Folder Actions). I was
tempted to try and learn enough of this so I could rsync
all local
file changes to a system in the lab….
Seemed easier for me to just modify Emacs.
Little Emacs Spreadsheets
I’ve discovered the ultimate in Yak Shaving: Gnu Shaving!
Since I keep everything as org-mode formatted text files, I tried an experiment to directly convert the spreadsheet-like tables in my “tax notes” into a PDF mail for my accountant.
Yours in Emacs
After reading the Wired article, Why We Should Design Some Things to Be Difficult to Use, I finally realize that Emacs should be hard to use, and we really should just give up changing it to be easier for new-comers.
This quote sums up my 20 year experience with Emacs:
[Fujifilm took] the controls out of deep menu functions and putting them back on chrome knobs that just beg to be twiddled.
I bought a Fujifilm X100 two years ago. It was the first piece of technology I’d bought in 15 years where I had to read the manual. Actually, I’ve read the manual at least four times. Now I’m taking the best pictures of my life, and I love it. By being hard to use, my X100 made me a better photographer.
Seems like Emacs users are now in some elite club where the hazing ritual amounts to learning Lisp. Consequently, I’ve decided to start signing all my Emacs-related correspondence with:
Yours in Emacs,
Howard
Literate DevOps
Maintaining servers falls into two phases: First, bang head until server works; second, capture effort into some automation tool like Puppet or Chef. Recently, I’ve been playing around with making the first phase closer to the second. For lack of a better word, I’m calling it literate devops.
Update 1: I finally got around to troubleshooting using Tramp references to execute code blocks on remote servers (even those behind firewards).
Update 2: Need another complete example? Check out my notes onsetting up IP Tables (and this org-mode file), where part of the file can be executed in the editor in order to see how my machines are configured, and the other part is a script that can be tangled to a machine and executed to reset to the firewall rules.
Key Sequences in Emacs
In Emacs, a key sequence is special key binding that uses multiple keys in a series. Since they require more effort to type, a sequence is chosen for functions that interrupt the normal editing flow.
Let’s explore some code associated with key sequences as well as write a macro to help make these more palatable.
The Tao of Emacs
I’m not saying the Emacs Way is objectively better, but you may find your work-style improved if you incorporate this way in your workflow. Let me demonstrate the way with a few examples.
Emacs is my Window Manager
I have played with a lot of window managers, and while many claim to
be unobtrusive and minimal, I really just want Emacs in full-screen
mode. So, I create an .xinitrc
file that contains only:
exec emacs
That’s right, folks, Emacs is my window manager.
Read more… or simply check out the results.
Squashing Commits with Magit
Manipulating the commit history in Emacs isn’t as straight-forward as other Magit processes, so I thought I would share my notes.
Artistically Perfect
Saw this video with Woz, where he describes how he wanted every trace on the original Apple board to be placed where the chips would be in the best position. He then said:
It had to be that artistically perfect to me, because it represents yourself when you do a great design.
Yeah, we can relate.
Computer Languages Suck
I like to publish only positive essays on my blog, and I’ve been conflicted about publishing my perspective on perching on Paul Graham’s shoulders to extend his essay on the Hundred-Year Language. So keep in mind that any snarkiness is my inept attempt at humor.
Teaching Programming…Again
After many years of teaching Scratch at my local elementary school, I decided to start teaching an after-school session at my local Middle School. With diverse interests and abilities (not to mention, I’m considerably more busy during my day job), I thought I would try a new approach: nothing.
Journaling with org-mode
Regardless of whether you are into capturing personal data as part of the Quantified Self movement, or simply like to reflect on your day, I thought Emacs and org-mode would be a good approach to journaling.
Online Presentations
After all the fun I had this summer at the Open Source Bridge giving my talks on both Lisp/Clojure and Emacs, I figured that I would upload them to YouTube:
Just noticed that the audio to my talk, Literate Programming now has the audio online, however, without the Emacs demonstration of org-mode, I wonder how helpful it would be.
Eschewing Zshell for Emacs
The Emacs Shell, or EShell, is a unique and quite powerful shell that allows you to write your supporting functions in Lisp. This article beyond my original introduction to explore it deeper.
Scratch Tutorial
Gave a tutorial on Scratch to 50 children at the OSCON Kids Day. Lot of fun, so I made a special online Scratch tutorial, where a kid could run my video in one browser window, and follow along in a second window running Scratch.
Squashing Git Commits for Gerrit
Now that my company is starting to use Gerrit, I decided to resurrect some old essays on Git usage.
Good Git practice encourages developers to create a history of useful commits. This essay is a ‘recipe’ for squashing multiple… uh… less than helpful commits into a single commit using the Git’s interactive rebase command.
This is a good technique if you start to use the Gerrit Review system.
Why Emacs?
As a professional software engineer, I’m stunned that put up with an editor that insists that you bind your fingers to someone else’s accepted practice.
Clustered Random Numbers for Art
Using functional programming techniques and the standard functions from Underscore to generate random numbers that favor particular numbers. Useful for picking colors.
Getting Started with Emacs
Just learning? Well, this ancient editor can be modernized for someone without much memory already embedded in their fingertips.
A/B Testing at jQuery Summit
The jQuery 2013 Summit published my A/B Testing Tutorial with jQuery presentation. Why yes, I did have a lot of fun with SP Studio.
New Design
For half the web sites I visit, I use either a tablet or w3m (in an Emacs window, of course), I’ve realized that I should make my own web more accessible and flexible.
You’re viewing the results.
Everything should be simple, open, and easy. Oh, and did I mention that I’m publishing directly from Emacs. Yeah, that is how old men do.
My original blog was originally written in Markdown. Once easy to
write in, org-mode
is much better. To convert or not convert them
all? I’ve done these, but most of my original essays will continue
to date themselves.
Footnotes:
QWAN stands for Quality Without a Name, and reminds me of much of the thesis of the book, Zen and the Art of Motorcycle Maintenance. Regardless of what you think of the book, we often recognize quality without being able to define it.