From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SPlBInjje2Jz1QAAbAwnHQ (envelope-from ) for ; Wed, 11 May 2022 18:25:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wGoXInjje2KorwAAauVa8A (envelope-from ) for ; Wed, 11 May 2022 18:25:28 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9FED411349 for ; Wed, 11 May 2022 18:25:27 +0200 (CEST) Received: from localhost ([::1]:46284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nop9R-00033R-Vb for larch@yhetil.org; Wed, 11 May 2022 12:25:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nop8I-0002FG-76 for emacs-orgmode@gnu.org; Wed, 11 May 2022 12:24:14 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nop88-00087O-Cb; Wed, 11 May 2022 12:24:06 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6F77A160126; Wed, 11 May 2022 09:24:01 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 4vsp_yuSSFIH; Wed, 11 May 2022 09:24:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BBB1016012F; Wed, 11 May 2022 09:24:00 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6s_b14TRGvTC; Wed, 11 May 2022 09:24:00 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9144E160126; Wed, 11 May 2022 09:24:00 -0700 (PDT) Message-ID: Date: Wed, 11 May 2022 09:24:00 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US To: Max Nikulin Cc: emacs-orgmode , Bastien References: <106f5128-680b-f25e-1316-f7308c49b625@gmail.com> <439411c0-7dae-9dfd-373a-c3779469003f@gmail.com> <2db7387c-4cbc-a7d2-9fa0-74f4d62d8a59@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: [PATCH] org-macs.el: Do not compare wall time and file modification time In-Reply-To: <2db7387c-4cbc-a7d2-9fa0-74f4d62d8a59@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652286328; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rU5Bp//yDhGGIQO1vetUnkIasshqfTx6570RJmmCLM0=; b=kgF0ZvRF66FYJ6APCjStD+qJZM2JAd8mkRU76zcUJ/pR4f9vPIB+Rf8K7cGXcwrDiVEiZ7 1wL1b8U6BznySjyMBIYYl2Xp5kTGdqVsvLWbW3f343qYHEyW3DDx6fMYUIedq0zW3lJy3S ADlps8xNQBfLR0YlR39xNRPZBIqfsuiNf+b5MfLSfsxlX4nYI9qzAMnC8lDkSgBxE87Ttc Ek6KlEfTHXBqwPVdWIq8xi1UnytKlf2NzVJ+r6fvhRS3L0EQhhTPoPZWig0aWzKBin3d/f WjacWICazHW7bpg7AiDCU9QUm4Ogwtc12i5L/u9zRa6s5jMYOe6POiNEuUFijQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652286328; a=rsa-sha256; cv=none; b=luD815hRWwXxpd0Gm7X9Yc3tFs0uRqXfGuHs69sg1f0e8CGRyvv9HGDidHSQnF4TvpU5uO s6FmP3Jn97zeaBRy2jVzTG900ctO5Sso9kLPM42zW/l0kRJ6F62J+25o4+TSEhA8W9zHO5 oQOFFEe/DGmWFwUrrCU/3lwCfJ4gF0ojn38d5IsH13SpMO7P5vCST2qQq5c8tXh3I2mvVU kVcJiaAw2CWUdAn8jI4My7zCwhhu+9HDjqUyLtAMhbczoJcS2ccO/vXhZvnLBigr2AbCBe csjc+mQyBA/9idzxa7MHgna5KmdsFKRcplsyi08R1TieYKc6l7/lUHhudXhfEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9FED411349 X-Spam-Score: -3.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: 7iWK/1XlxLdr 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.