Utility functions for frame management in emacs