emacs: refactor lua mode and sh script recipes