--- autoload.el.orig 2015-03-08 23:10:06.623228668 +0100 +++ autoload.el 2015-03-08 23:23:24.203961615 +0100 @@ -713,6 +713,17 @@ (search-forward generate-autoload-section-trailer) (delete-region begin (point))) +(defun was-file-modified (md5-or-mtime file) + (if (stringp md5-or-mtime) + ; md5-or-mtime is an MD5 checksum. + (let ((last-md5 md5-or-mtime) + (file-md5 (md5 file))) + (string= last-md5 file-md5)) + ; md5-or-mtime is a time structure. + (let ((last-time md5-or-mtime) + (file-time (nth 5 (file-attriutes file)))) + (not (time-less-p last-time file-time))))) + ;;;###autoload (defun update-directory-autoloads (&rest dirs) "Update autoload definitions for Lisp files in the directories DIRS. @@ -781,8 +792,7 @@ (member (expand-file-name file) autoload-excludes)) ;; Remove the obsolete section. (autoload-remove-section (match-beginning 0))) - ((not (time-less-p (nth 4 form) - (nth 5 (file-attributes file)))) + ((was-file-modified (nth 4 form) file) ;; File hasn't changed. nil) (t