Port some stuff from Emacs Starter Kit