10

Emacs: Fury Road

 4 years ago
source link: https://nqnstudios.github.io//2019/11/19/emacs-fury-road.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Emacs: Fury Road

Nov 19, 2019

I took a ride in my friend’s Tesla today. It was disgustingly perfect.

Interior of Tesla, with a gigantic touch-screen console and large street map view

The car door handles were new-fangled and strange, but after I learned how to lever the door open, it was smooth sailing. The first thing he showed me was the automatic steering. All by itself, it made a perfect lane change on a steep, curving, downhill road! I couldn’t have done it better myself.

After that I couldn’t help but notice the size of the console. It’s like 3 iPads put together! Zoom out on that map screen and I bet you could see all of Salt Lake City at once, with color coding for traffic jams.

Tesla console running Caraoke:

Next up: Caraoke. You can sing along to Imagine Dragons using the built-in software of your Tesla. Can I get a “Thun-der!” or what?! I couldn’t remember the beat of this unironic Utah classic until the second time through the chorus, but once I got going I could not be stopped.

When we pulled over at our destination (and trust me, I was not happy for it to be over) my friend still had a few things to show me, including the Tesla Arcade, YouTube integration, and OH MY GOD it has a Yule Log with REAL HEAT!!

I made him take me one last time around the block. And if not for that, the illusion would have remained impenetrable. But it didn’t. We went over a bump.

It was then that I realized: This Tesla’s not so special! It takes bumps and potholes just the same as my little 2007 Prius! And I sure as hell don’t need any Silicon Valley goons controlling my car for me!

I need Emacs.

So I did what any self-respecting hacker would do, and made some upgrades. Starting with my steering wheel.

Dashboard of a 2007 Prius with Nat's Unicomp Bucking Spring keyboard poorly GIMP-edited on top of the steering wheel

I know what you must be thinking: That keyboard’s a knockoff! And you’d be right. I haven’t been able to get my hands on a real Model M but the Unicomp comes pretty close!1

After securely attaching a keyboard to my steering wheel, I needed to gain control of my car’s console. I had no idea what OS it was running, and the only hacks I could find online were for disabling that annoying beeping whenever you’re in reverse.

Many hours of experimentation later, I was able to gain BIOS access to my Prius Console. The solution was mind-blowing, but it could fill its own blog post, so I won’t get into it.

Of course, for my new base operating system I chose Arch Linux. Once I had pacman up and running, I was tempted to install xorg and the delightful Emacs X Window Manager, knowing it would give me access to GUI versions of all the apps I’d need to reach feature parity with a Tesla. But I realised this was nonsense for three reasons:

  1. Using GUIs would be cheating
  2. Unlike with native Emacs extensions, I would never be able to fully hack GUI apps to my needs at runtime
  3. I definitely don’t want to fiddle with a computer mouse while driving.

So X was out the window. Pure terminal forever! I installed Emacs and prepared to write my own Prius drivers for Arch Linux. Again, this was an arduous process, so I’ll spare you the trouble.

Once I had working functions for all the basics ((prius-turn-wheel-left), (prius-turn-wheel-right), (prius-accelerate), etc.) I started to think about my ideal keyboard shortcuts. I knew C-b and C-f wouldn’t feel very intuitive for turning the steering wheel, so I installed evil mode and embraced using hjkl for acceleration, reverse, left, and right.

C-g hits the brakes. Obviously.

If anything ever bugs me, I can always tinker on my Elisp config without even turning the car off. I simply turn to the familiar C-x C-e binding and (eval-buffer)–and suddenly I’m metaprogramming my car on the way to school! If that seems dangerous to you, rest assured that I only ever drive with a navigator in the passenger’s seat. #PairProgramming

But what about all those cool features my friend had? Could my homebrew vehicle ever come close to the glorious feature bloat of a Tesla?

Map support: google-maps.el seems compelling. I do hate to rely on closed-source software, so maybe I’ll find time to fork osm-mode bring it up to date for OpenStreetMap support.

Karaoke: Surprisingly, this is also already implemented. karaoke-time

Games: All I need is nethack-el to keep me entertained for thousands of hours on the road.

Yule Log: emacs-fireplace is in colorful ASCII art which makes it even better.

And with that, I’m satisfied. With GNU all things are possible.

I hope this write-up might inspire a few new Emacs Road Warriors out there. If you’re like me, you’ll see that you never wanted a self-driving car–all along, you wanted smarter tools for driving your own car.


Note: Many parts of this post are true or at least plausible, but I did not actually install Emacs in my car. Neither should you.

Further note: I should have been seeking gainful employment during the 3 hours it took to write this blog post. If you think my lunacy deserves to be rewarded, Venmo @nathyafterdark or subscribe to my Patreon.

  1. I do have one disappointment with the Unicomp: It only supports chords of up to 4 keys, which my research tells me is the same as the original Model M with its PS/2 connection. With the advantage of modern hardware, why not more? Sadly this means I won’t be able to use braille-chords-mode on the road. 


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK