[PATCH] emacs: derive correct timestamp in FCC unique name
authorJesse Rosenthal <jrosenthal@jhu.edu>
Wed, 13 Jun 2012 20:01:27 +0000 (16:01 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:40 +0000 (09:47 -0800)
60/d3b09b94eaa653eb8034c199d4e5d4e206c6b5 [new file with mode: 0644]

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