On 11/05/2022 23:24, Paul Eggert wrote: > The comments don't seem to match the code here. > >> +  (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))) > > Although this looks correct, there's no need to go to the work of > computing file-mtime in the common case where tangled-mtime is nil. Thank you, I missed such case. I discovered that the code below recompiles an .el file even the .elc one is newer, moreover loading of compiled file is broken by another modernization of emacs code (see the dedicated thread). That is why I did not bother if the code may be optimized a bit. Finally I have found `file-newer-than-file-p' that looks suitable for such case.