added more functionality from purcell's emacs