Merge from emacs-24; up to r117546