emacs: Clean up unique shell invocation functions