+ (let* ((tangled-file (concat (file-name-sans-extension file) ".el"))
+ (file-mtime (file-attribute-modification-time
+ (file-attributes (file-truename file))))
+ (tangled-mtime (file-attribute-modification-time
+ (file-attributes (file-truename tangled-file)))))
+ ;; Tangle only if the Elisp file is older than the Org file.
+ ;; Filesystem may have coarse timestamp resolution (HFS+, FAT)
+ ;; so no need to update if timestamps are equal and thus
+ ;; `org-file-newer-than-p' can not be used here.
+ (unless (and file-mtime
+ tangled-mtime
+ (not (time-less-p tangled-mtime file-mtime)))