unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: derive correct timestamp in FCC unique name
@ 2012-06-13 20:01 Jesse Rosenthal
  2012-06-14  9:43 ` Tomi Ollila
  2012-06-14 17:16 ` [PATCHv2] " Jesse Rosenthal
  0 siblings, 2 replies; 6+ messages in thread
From: Jesse Rosenthal @ 2012-06-13 20:01 UTC (permalink / raw)
  To: notmuch


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 <jrosenthal@jhu.edu>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-22 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 20:01 [PATCH] emacs: derive correct timestamp in FCC unique name Jesse Rosenthal
2012-06-14  9:43 ` Tomi Ollila
2012-06-14 16:35   ` Jesse Rosenthal
2012-06-14 17:16 ` [PATCHv2] " Jesse Rosenthal
2012-06-14 19:04   ` Tomi Ollila
2012-06-22 10:45   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).