Categories
Computers

Coming Back Home to Emacs

Emacs is more than a text editor to me. It feels like home. I’ve been through quite a many editor in my day. From (classic) Notepad, to TextMate (paid) to pico, then nano, then Vim (for a very long, enjoyable, time) and then, Emacs. I’ve had brief stints with KDE’s Kate and Microsoft’s VSCode. Both excellent editors in their own right, but nothing I use seems to compare with Emacs.

What is Emacs?

Emacs is, at it’s core, not really a text editor. It’s a Lisp interpreter for a specialized dialect of Lisp known as Emacs Lisp (or elisp). Aside from the interpreter and some core components built in C (for performance reasons), the rest of the stack is entirely built on this language. From the editor, to the tooling, to the interface. All Lisp. This means that the editor is extremely malleable. You can extend it on a whim, add packages that build entirely new functionality and control whole systems with it.

All of this can be done live, while the application is running. Meaning I can take a bit of code I’ve written in elisp and evaluate it, and now it’s part of the running program (or just returns a result, depending on what it is). I can do this for all sorts of things. Writing my own functions, handling input, connecting to servers. I can even write “advice” on existing functionality. Instead of having to replace a “problematic” function, I can just “advise” it to behave in such a way, by having code run before or after it.

Home is Where Your Text is

One of the best things about Emacs, and much of the so-called “Unix Philosophy” is that you largely deal in text. Input and output are usually text, unless you’re compiling for a purpose (pdf, pandoc, binary). Everything in Emacs is centered around dealing with text. This allows you to see, manipulate and ultimately manage things in a familiar way. There are no opaque file formats that can only be opened in Emacs, or are incompatible with different versions. It’s just text.

For all it’s warts, Emacs has become my final editor of choice. While some tools may be fancier, none is as versatile or as interesting as Emacs is. It’s been around for ages, and I hope that it sticks around for ages more.

Categories
Awesome Computers

Emacs Occur

I love Emacs. It’s a great text editor and platform for doing all sorts of things. One of the ways that it makes a great editing environment is that things are extensible, often live in the environment. One of the things I used to use is a package called “ioccur“, this allowed you to edit occurrences of a specified text across the document. This mirrored a built-in function called “Occur“, which showed you each line or instance of the occurrence across the document. The biggest problem was that once you found stuff, you had to swap back and forth between the list and the actual document. I have since learned about the ability to edit the document right from the “Occur” results.

Once you have a list of items, you can press e to enter edit mode. Each line becomes linked to their buffer line and you can make edits to whatever you want and they’ll be reflected, live. Once you’re done, you can return to the “Occur” mode (which allows you to do more) by pressing C-c C-c (a common Emacs ‘complete’ command).

Here is the feature in action:

Here is the effect in action, inside my .profile file.

Categories
Computers

Emacs Rocks

Emacs is an amazing tool. It’s both a programming language (Elisp) and a functioning text editor. No, it’s not even a text editor, it’s an environment that contains a text editor, crafted out of Elisp. This allows you to extend it in almost any direction. From reading email and news groups to editing photos and viewing PDFs and listening to music.

I’ve spent a lot of time with it, and it’s classical rival, Vim, over the years and both are amazing tools in their own right. Emacs has won me over, though, because it allows me to do more than just edit text. I can craft it how I need it. To that end, I’m now using Emacs for RSS Feed reading (via Elfeed), Listening to music via EMMS (and mpv), Managing my files using Dired, even using it as a terminal emulator via Eshell. I can do most of what I need to do in Emacs.

Emacs even comes with it’s own server. Generally, this is to allow you to load a single instance of Emacs and then connect to it with any number of lighter clients. This offsets some of the longer startup times, which Emacs is, unfortunately, known for. This actually works out well, though, as it keeps buffers (files) and other utilities open, even if I close the frame (window) I’m working in. I can then freely close things and not worry about loosing data.

The next, logical step would be to replace i3 with EXWM, but I’m not entirely ready to make that leap. I still use Firefox and Steam. LibreOffice will be coming in handy when school starts back up and command-line mount tools are not really fun. I’d also like to try and get email, contacts and calendars going. I have Office 365, so that may be an impediment. It’s something to ponder, though.

Edit: If you want to see my configurations, you can visit my Emacs GitLab repository.