Further ideas courtesy of #emacs.