I won’t do PHP for love or money. Since it’s known that I’m a Software Person, friends and relatives will occasionally ask for help with some random issues and I’m always happy to take a swing at it. To take some of the pain out of it, I have a docker-compose setup that makes it easy to run PHP without polluting my laptop with a lot of dependencies.

It’s been a while since I posted a Emacs build walk-through, one version of macOS has come and gone and a new major version of Emacs has arrived, let’s get to it.

Building Emacs has only gotten easier since macOS Catalina, so, let’s make this quick.

If you password protect your SSH keys (and you should) and you don’t store those passwords in your macOS keychain or Linux equivalent (slightly paranoid, but not a bad idea), you have to add keys to ssh-agent with ssh-add before using them. Otherwise, you’ll be prompted for the key’s password on each use. This always bites me when doing deploys, I get prompted multiple times as the deploy process makes multiple SSH connections.

Fortunately, there’s a simple fix.

Not long ago I shared a Bash function that takes filenames in the form of filename.rb:NNN, where NNN is a line number, opens the file in Emacs, and jumps to that line. This format is commonly used in error messages and the output of test frameworks.

However, there’s another format I run into all the time, the format Github uses in URLs when linking to a specific line number:


Here, the line number is in the form ‘#LNN’, which makes total sense as a URL fragment identifier. I get a lot of these URL in chat when discussing problems and I decided to add support for them to my function.

Another, macOS (Mojave), another major Emacs release, let’s get building.

Ironically, I started this post in vi. Why? I’d updated brew and a change in the ImageMagik version broke Emacs.

The complexity of this exercise waxes and wanes as the dependencies of Emacs change and as the versions of tools Apple ships get old or get updated. This time around, there is one new requirement.

Long ago I shared my EmacsClient setup. The short of it was that I always have Emacs running and set $EDITOR in such a way that things like git commit open a new frame in my existing session. I also had a simple Bash alias that let me open any file in a frame as well:

alias ec="$EMACSCLIENT -c -n"

Where $EMACSCLIENT is the path to emacsclient on whatever system I’m on, -c is to create a new frame for the file, and -n to tell emacsclient to exit immediately instead of waiting for me to finish editing.

This has served me well for years. However, there’s one bit of laziness I’ve been wanting to implement. Handling filenames (or file paths) that include line numbers, i.e. filename.rb:123.

If you try to build Ruby 1.9.3 using rvm install ruby-1.9.3-p551, it will barf with compiler errors. The workaround, found here, is to use:

rvm install ruby-1.9.3-p551 --with-gcc=gcc

You will get a warning:

Ruby ‘ruby-1.9.3-p551’ was built using clang - but it’s not (fully) supported, expect errors.

However, I have run into any errors.

Yes, 1.9.3 is not supported and, in a perfect world, I would be able to upgrade projects using it.

No, I don’t care if you hate RVM.

An update to my somewhat popular How I Start Rails Projects post. As before, I start with:

rvm use 2.4.1@project-name --create
gem install rails
rails new project-name
cd project-name
rvm use 2.4.1@project-name --ruby-version
echo '/.ruby-*' >> .gitignore

The only change is bumping Ruby to 2.4.1.

But this leads to a rant: