Update patch from EmacsWiki that make works with Emacs 24.4