make it work reasonably OK in emacs23