From: Jesse Rosenthal Date: Wed, 13 Jun 2012 20:01:27 +0000 (+2000) Subject: [PATCH] emacs: derive correct timestamp in FCC unique name X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ce7cd00a2040b30fae61d4e650a4d30970df2dda;p=notmuch-archives.git [PATCH] emacs: derive correct timestamp in FCC unique name --- diff --git a/60/d3b09b94eaa653eb8034c199d4e5d4e206c6b5 b/60/d3b09b94eaa653eb8034c199d4e5d4e206c6b5 new file mode 100644 index 000000000..610a84a58 --- /dev/null +++ b/60/d3b09b94eaa653eb8034c199d4e5d4e206c6b5 @@ -0,0 +1,87 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 107EC431FB6 + for ; Wed, 13 Jun 2012 14:09:16 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id T7OEqlhr8QAB for ; + Wed, 13 Jun 2012 14:09:15 -0700 (PDT) +X-Greylist: delayed 3603 seconds by postgrey-1.32 at olra; + Wed, 13 Jun 2012 14:09:15 PDT +Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu + [162.129.8.200]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 58DAE431FAE + for ; Wed, 13 Jun 2012 14:09:15 -0700 (PDT) +X-IronPort-Anti-Spam-Filtered: true +X-IronPort-Anti-Spam-Result: + AtoPAObl2E8KoSES/2dsb2JhbABFpRoBjnADgjqDQBQ0ASw0uUSJBIs6boF/gxsDmxcDjH+BOg +X-IronPort-AV: E=Sophos;i="4.75,765,1330923600"; d="scan'208";a="158399065" +Received: from unknown (HELO watt) ([10.161.33.18]) + by ipex1.johnshopkins.edu with ESMTP/TLS/AES256-SHA; + 13 Jun 2012 16:09:11 -0400 +Received: from jkr by watt with local (Exim 4.76) + (envelope-from ) + id 1SetsN-0001r8-S6; Wed, 13 Jun 2012 16:09:11 -0400 +From: Jesse Rosenthal +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: derive correct timestamp in FCC unique name +Date: Wed, 13 Jun 2012 16:01:27 -0400 +Message-ID: <87d353ezyw.fsf@jhu.edu> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 13 Jun 2012 21:09:16 -0000 + + +Previously, the timestamp at the beginning of the FCC maildir unique +maildir name was derived incorrectly, thanks to an integer +overflow. This changes the derivation of timestamp to float +arithmetic, and so gets the number correct. (It is still formatted +with "%d" so it will show up as an integer.) + +This change is mostly a question of consistency, since the unique name +is arbitrary anyway. But since most people use timestamps, and that was +the original intention here as well, we might as well. + +Signed-off-by: Jesse Rosenthal +--- + emacs/notmuch-maildir-fcc.el | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el +index dcfbc4b..6fd8ff9 100644 +--- a/emacs/notmuch-maildir-fcc.el ++++ b/emacs/notmuch-maildir-fcc.el +@@ -141,7 +141,7 @@ will NOT be removed or replaced." + + (defun notmuch-maildir-fcc-make-uniq-maildir-id () + (let* ((ct (current-time)) +- (timeid (+ (* (car ct) 65536) (cadr ct))) ++ (timeid (+ (* (car ct) 65536.0) (cadr ct))) + (microseconds (car (cdr (cdr ct)))) + (hostname (notmuch-maildir-fcc-host-fixer system-name))) + (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1)) +-- +1.7.9.5 + +