Git-undo

John Wiegley has released a nice package that can be really helpful if your workflow involves tracking and saving your work with Git. Sometimes you do some work and then decide that you don’t want that change and would like to revert back to what it was. Wiegley’s git-undo makes that easy. You can mark a region and have that region replaced by the working tree or HEAD version of your Git tree. You can also walk back through your Git history undoing previous changes to the region in your Git tree.

It’s not yet in Melpa but it’s a single small file so perhaps Wiegley has no plans to submit it.

Posted in General | Tagged , | Leave a comment

PSA: Importing the OS X Path into Emacs

I’ve probably written about this before but this tweet suggests that not all Mac Emacs users are aware of it:

The exec-path-from-shell package is a must-have for the OS X Emacs user. Before I found it, I could never get the search path for Emacs configured correctly. Once I installed it, all those problems disappeared and I haven’t thought about them since. Really; if you’re using Emacs on a Mac, you need this.

Posted in General | Tagged | Leave a comment

Exporting DOCX/ODT Documents With a Style Sheet

Karl Voit has a really handy tip for those of you unfortunate enough to have to deal with Word (or its evil siblings) documents. Many folks in that cohort make do writing in Org mode and exporting to ODT. If you use Pandoc as your translation engine you can you can also export to DOCX and, as Voit explains, you can incorporate a template into the export so that, say, company styles and logos are respected by the exported document.

This turns out to be pretty easy but probably doesn’t work the way you think it does so you’ll want to be sure to follow the link to Voit’s post.

Posted in General | Tagged , , | Leave a comment

More Calc Recipes

Yesterday’s post on calc generated an interesting discussion in the comments. Frequent commentor Phil offers a particularly nice example of an easy way to add up a row or column of numbers. That’s something that while it doesn’t come up everyday, does occur often enough that it’s worth learning how to do it easily.

Phil also noted that reddit had a pointer to a post by Mark Hepburn that collected some calc recipes from Andrew Hyatt. These recipes and those from Chris Wellons in yesterday’s post are, I think, a good way to get familiar with calc. I’ve tried working through the manual to learn calc but I always got overwhelmed and had a hard time remembering everything. By learning some specific methods for performing useful calculations that come up in your work, you get familiar with how things work and what’s available. After that, it’s much easier to figure out how to do something new.

Posted in General | Tagged , | Leave a comment

Chris Wellons on Emacs Calc

In a nice piece of ironic serendipity, I found this reference to an old Chris Wellons post on Calc while reading my feed with Chris Wellons’ excellent feed reader, elfeed.

As I written a several times, I really like calc and am always amazed at its power. I have a shortcut key for it in Emacs but usually end up just using “quick” mode. That’s mostly because the power of calc comes at the cost of a certain complexity and I don’t use it often enough to internalize its interface. It’s not that calc has a stack based RPN interface—my oldest “computer” was a programmable HP RPN calculator—it’s the sheer number of functions and their sometimes abstruse commands that I find difficult.

Getting better at calc is perpetually on my TODO list. One year it was even a New Year’s resolution but, alas, life intervened and I failed. Reading Wellons’ post, which is a series of examples showing the power of calc, has inspired me to once again try to really learn it. That’s probably going to involve using it more often than I normally would even if that use is “just for practice.” If you have the slightest use for a calculator or sometimes want to do symbolic mathematics, you should take a look at the post. It may inspire you, too, to spend some time learning it.

Update [2017-12-16 Sat 16:19]: Fixed link.

Posted in General | Tagged | 16 Comments

The Dream Achieved?

Back in 2007, Mike Elgan wrote an article about The New Bedouins that really struck and excited me. In it he talked about a trend towards digital nomadism that was starting to take off. The “digital nomad” term was already 10 years old but the technology was finally in place to make it a reality. This was more than just “working from home;” it was the ability to work from anywhere in the world where you could find cell and WiFi service. As I wrote in 2011, this seemed natural and inevitable to us geeks but appeared positively weird to the rest of the population. A year later, even The Economist was taking notice.

For most of my career, I was trapped in a soul-sucking cubical farm and yearned for the freedom promised by the Bedouin life style. These days, many engineers wouldn’t consider a job that didn’t offer flexible workplace arrangements and it’s no longer strange or surprising to find folks working from some exotic location or even the local coffee shop. The practice has become so commonplace that Elgan has revisited the subject in another article declaring that the term “digital nomad” is now obsolete. It’s just something those who are inclined and have a job that makes it possible do. The same technology that makes it possible is used by everyone now and the term—which originally meant someone who used that technology that work from anywhere—is no longer needed.

I think the term is still useful to describe someone who practices workshifting but I take Elgan’s point. The dream has finally been realized. Some managers, of course, still resist workshifting but they’re likely the same ones who think open offices are a great idea and that software engineers are fungible.

Posted in General | Tagged | 2 Comments

The Lions Book

There was a time when you couldn’t be a Unix hacker unless you had a copy of John Lions’ A Commentary On The Sixth Edition Unix Operating System. It was supposed to be restricted to holders of a Unix license but was nevertheless copied and passed around. Many Unix hackers had six or seven deep copies of copies.

The book itself contains the complete source of the V6 Unix kernel along with Lions’ commentary on the code. For years it was, as the Jargon File points out, to only detailed description of Unix internals available outside of Bell Labs. In 1996, it was openly republished and is still available from Amazon.

Sixth Edition Unix was still simple enough that you can easily read and understand the whole thing. For that reason, it’s an excellent introduction for anyone who wants to understand Unix. Source code for even modern Unix versions is, of course, available now so someone dedicated to learning how the kernel works could start with the Lions book and go on to later versions.

I just came across an excellent on-line version of the Lions book provided by Warsus. If you’ve ever wanted to take a look at the book, here’s your chance to do so. It’s a great resource but, of course, mostly of historical value now.

Posted in General | Tagged | 6 Comments

A Multiple Cursors Use Case

Our maximal leader, John Wiegley, has posted a very nice video in which he demonstrates one of the ways that he uses Magnar Sveen’s excellent multiple cursors package. There’s more to multiple cursors than just popping up a bunch of cursors and then editing the text under them.

The TL;DR is that Wiegley wants to renumber some of the comments of the form STEP 5 but not all of them. Some of the numbers are already correct and others are references to one of the other steps. To do this he uses mc/mark-next-like-this to put a cursor on the next STEP N and mc/skip-to-next-like-this to skip the ones he doesn’t want to change. Finally, he deletes each of the numbers and uses mc/insert-numbers to renumber the STEP at each of the cursors. It’s a very nice and simple workflow. It’s nice how multiple cursors has all of the tools needed to make this so easy.

The video is only 2 minutes 53 seconds long so there’s no reason not to watch it immediately. It’s a great example of a simple but effective workflow.

Posted in General | Tagged | Leave a comment

Helpful

I haven’t paid too much attention to Wilfred Hughes’ Helpful but judging from Hughes’ latest tweet:

that may have been a mistake.

Is anyone here using it? If so, do you recommend it as a worthy addition to one’s set of packages?

Posted in General | Tagged | 1 Comment

Programmer Wisdom

Sometimes it seems more like 6 seconds, but yes:

Posted in General | Tagged | Leave a comment