Emacs tools function