Extra query functions for emacs keyboard macros