move tag generation out of shell script and into elisp