fix code for newer emacs