Copied the original code from the Emacs configuration to make it available to others. Need to get a better packaging setup.