Netops

One of my favorite applications of Org mode and Babel is demonstrated by Howard Abrams’ post and video on what he calls Literate DevOps. The basic idea is that he documents his work in an Org file complete with the actual code that he uses. What Babel makes possible is that he executes the code from inside Org mode and the results are automatically added to his Org file. In the end, he has a complete record of what he did along with the results. That makes the process easily reproducible and he can send to file to a colleague wishing to build on his work or needing a go-by for a similar project.

Vincent Bernat has taken Abrams’ DevOps idea and applied it to network operations. He calls it netops. If you’re working in network operations and want a nice way of documenting your work, take a look at Bernat’s post and the accompanying three videos. As with DevOps, everything you do is documented along with the code and results.

If you aren’t a network engineer you probably won’t understand everything he’s doing but you can still follow his process. My only complaint is that the videos have no audio; Bernat just types in what he is going to do. I find videos like that harder to follow but they’re still definitely worth watching.

Posted in General | Tagged , | 2 Comments

Undo/Redo with Scrolling

The rollover joke for this XKCD cartoon says

If used with software that could keep up, a scroll wheel mapped to send a stream of ’undo’ and ’redo’ events could be kind of cool.

So of course an Emacs geek, ncsuwolf, immediately implemented it. It’s probably not something you’d really want but it is neat that it was so easy to do.

In the comments, someone else suggested using the scroll wheel to control the Git time machine. That might be slightly more useful but others really liked controlling undo/redo with the scroll wheel. If you’d like to try either one, they’re each only 3 lines in your init.el.

Posted in General | Tagged | Leave a comment

Zamansky 32: Using Emacs for C++

Mike Zamansky has another great video up. It’s number 32 in his Using Emacs series and discusses using Emacs for C++ coding. I’m always seeing Twitter queries on how to use Emacs as a C++ development platform and I’ve written about some good solutions (see here, here, and here for example). Those solutions—particularly Neves’—try to reproduce the functionality of a dedicated C++ IDE such as Eclipse and might be considered too much work for a casual C++ user.

Zamansky’s video is intended for his beginning C++ students so he aims at simplicity and usefulness rather than a reimplementation of Eclipse’s functionality. Nevertheless, he provides a configuration that results in a C++ environment that should be more than adequate for all but the most hardcore C++ developer. In particular, if you’re a student looking for a way to use Emacs for your C++ school work, Zamansky’s video provides just what you need.

As usual, the entire configuration is available with the video. He’s even broken out the C++ parts so that you don’t need to use his entire configuration if you don’t want or need it. You can just paste his configuration into your own (or use his as is), fire up Emacs, and the package system will take care of loading the packages you need automatically.

There isn’t anything in his configuration that’s limited to C++ so the same setup will work equally well for C and similar languages. The video is just short of 22 minutes so plan accordingly.

Posted in General | Tagged | Leave a comment

Blogging with Org Mode and Hugo

Diego A. Mundo over at whyarethingsthewaytheyare.com has a nice post on how to blog with Hugo and Org mode. Hugo uses markdown as its input language but Mundo likes to work with Org so he wrote a bit of Elisp to export Org markup to markdown. That’s a nice bit of code because it shows how to use ox-pandoc to do the export. It serves as a handy go-by for automating other Pandoc translations from Org.

Mundo uses a single file for his blog with each post in a level 1 subtree. This is like the strategy that Artur Malabarba uses for Endless Parentheses. I like the single file idea a lot and would probably steal it except that I’m afraid a single file wouldn’t scale well with the daily posts that Irreal inflicts on the world.

As I’ve said many times, I’m a reasonably happy WordPress user but if I decided that I wanted a simpler homegrown method, Hugo and Org would be a something I’d definitely look at. You might think that you need to be an expert it do this type of thing but Mundo says he knows next to nothing about setting up a blog. He used Google Domains to register and maintain his domain and Gitlab Pages to host it. Everything else is contained in that single blog file and the bit of Elisp we wrote to turn his Org markup to a Hugo input file in markdown. Head on over to Mundo’s post for the details of how he set things up.

Posted in General | Tagged , | 8 Comments

Mu4e Tutorial

Gregory Stein over at Caches to Caches has a really nice tutorial on configuring mu4e and offlineimap to handle your email from within Emacs. That’s an on-going project—delayed mostly by laziness—here at Irreal so I was especially interested in the post. My only complaint is the use of offlineimap instead of the faster mbsync.

Still, Stein shows you how to get things set up so that your mail is automatically downloaded every 5 minutes and Emacs lets you know when you have email. He found a couple little glitches when he was configuring his system and he explains those and gives workarounds for them.

If you’ve been looking for a way to move email inside Emacs, mu4e is an excellent solution. If you want some inspiration, take a look at my post where I discuss Ben Maughan’s email setup. As I say in that post, Maughan has leveraged mu4e to make what I consider a near-perfect email setup.

Posted in General | Tagged | 2 Comments

Library Hand

Years ago, there were not only library card catalogs but the cards within them were handwritten. Written not with the hen scratching that characterizes my (and probably your) handwriting but with a beautiful, legible, and, as it turns out, standard penmanship.

Librarians of the day settled on a standard way of writing the cards called Library Hand. If you follow the link, you will find several examples using both printing and long hand. These days everything is computerized—or at the very least the cards are printed—but it’s fun to read about how librarians struggled to find a standard way of writing for the cards. If nothing else, you can enjoy the examples of the art.

Posted in General | Tagged | Leave a comment

Zamansky 31: Elfeed (3)

Mike Zamansky has the latest video in his Using Emacs series up. This is the third in his set of videos on Elfeed. This time he considers using macros and hydras with Elfeed. In the second video, Zamansky showed how to use a hydra to pull up all the feed entries with a given tag.

That was a big improvement over having to type in a search to narrow the menu to a given set of feed entries but Zamansky wasn’t satisfied. The problem is that an active Elfeed workflow doesn’t define a given set of tags upfront. New tags are always being created and some are even being deleted. That means that you have to constantly update the hydra to keep the list of targets up to date.

Zamansky solves this problem by programmatically obtaining a list of active tags from Elfeed, generating a list hydra target entries, and dynamically generating the hydra. All this happens each time he invokes his Elfeed “jump to target” function. Rather than just invoke the hydra, it first builds the hydra with an up-to-date list of active tags.

That sounds complicated and perhaps even a bit magical but using a macro to define the hydra it becomes almost trivial. Most of the work is deciding which key to use for a given tag. See Zamansky’s post or video for the details. The video is 11 minutes, 22 seconds long so it shouldn’t be hard to find time to watch it.

Posted in General | Tagged | Leave a comment

An Emacs Workflow

Andreas Gerler has a nice post on how he leverages Emacs to lessen the friction of his workflow. All Emacs users do that, of course. What struck me about Gerler’s post is that he takes a literate devops approach, as exemplified by Howard Abrams, to his everyday work.

A lot of that is simply taking notes in Org mode as he goes along and adding code blocks to actually perform his commands. The result is a thorough log of what he did, the results, and why he did it. That’s really useful for multi-day projects where it’s easy to forget what you did yesterday or the day before.

Another aspect of his strategy that I like is the use of small Elisp functions or keyboard macros to do small repetitive tasks. He gives a couple of example of that sort of thing that are worth taking a look at.

The post is really just an outline of what he does and I wish he had gone into more detail because I found many of his ideas useful. Perhaps you will too so take a look and see.

Posted in General | Tagged | 1 Comment

Emacs 25.2 RC2

Things are progressing. The second release candidate for Emacs 25.2 is available. If you like to live on the edge, grab a copy and start testing.

Posted in General | Tagged | Leave a comment

Zamansky 30: Elfeed (2)

Mike Zamansky has video number 30 up in his Learning Emacs series. It’s the second video in his series about Elfeed, an RSS reader for Emacs.

Zamansky says that he generally likes Elfeed but that it’s inconvenient to jump to a category of feeds. For example, if you want to see all the entries tagged “Emacs” you have to type in a longish search string. Zamansky solved this with a hydra. He types one key to bring up the hydra and then another to choose the category he wants to see. That works well and makes navigating your feed almost frictionless.

If you’d like to try Elfeed, you’ll want something like Zamansky’s solution to speed things up. The video is a little over 11 minutes so it should fit well in a coffee break.

Posted in General | Tagged | 1 Comment