From: Paul Eggert Date: Fri, 1 Jul 2011 01:46:17 +0000 (-0700) Subject: * gnus-util.el (gnus-message-with-timestamp-1): Use format-time-string X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~294 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b06823b67d921e74323cab25477fd7256cb6df08;p=emacs.git * gnus-util.el (gnus-message-with-timestamp-1): Use format-time-string rather than decoding time stamps by hand. This is simpler, and insulates the code from changes to time stamp formats. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 08bd159c330..009e8b32bd9 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2011-07-01 Paul Eggert + + * gnus-util.el (gnus-message-with-timestamp-1): Use format-time-string + rather than decoding time stamps by hand. This is simpler, and + insulates the code from changes to time stamp formats. + 2011-06-30 Katsumi Yamaoka * mml2015.el (mml2015-use): Replace string-match-p with string-match diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 3f66b45aaab..7155c7f9607 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -540,8 +540,7 @@ but also to the ones displayed in the echo area." (eval-when-compile (defmacro gnus-message-with-timestamp-1 (format-string args) - (let ((timestamp '((format-time-string "%Y%m%dT%H%M%S" time) - "." (format "%03d" (/ (nth 2 time) 1000)) "> "))) + (let ((timestamp '(format-time-string "%Y%m%dT%H%M%S.%3N> " time))) (if (featurep 'xemacs) `(let (str time) (if (or (and (null ,format-string) (null ,args)) @@ -554,10 +553,10 @@ but also to the ones displayed in the echo area." (cond ((eq gnus-add-timestamp-to-message 'log) (setq time (current-time)) (display-message 'no-log str) - (log-message 'message (concat ,@timestamp str))) + (log-message 'message (concat ,timestamp str))) (gnus-add-timestamp-to-message (setq time (current-time)) - (display-message 'message (concat ,@timestamp str))) + (display-message 'message (concat ,timestamp str))) (t (display-message 'message str)))) str) @@ -571,7 +570,7 @@ but also to the ones displayed in the echo area." (setq time (current-time)) (with-current-buffer (get-buffer-create "*Messages*") (goto-char (point-max)) - (insert ,@timestamp str "\n") + (insert ,timestamp str "\n") (forward-line (- message-log-max)) (delete-region (point-min) (point)) (goto-char (point-max)))) @@ -585,7 +584,7 @@ but also to the ones displayed in the echo area." (and ,format-string str) (message nil)) (setq time (current-time)) - (message "%s" (concat ,@timestamp str)) + (message "%s" (concat ,timestamp str)) str)) (t (apply 'message ,format-string ,args))))))))