[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master dbef214 10/13: Simplify by using format-time-string
From: |
Paul Eggert |
Subject: |
master dbef214 10/13: Simplify by using format-time-string |
Date: |
Mon, 6 Dec 2021 02:24:23 -0500 (EST) |
branch: master
commit dbef2145c78a8b6cd913d677e50a0b7df0b1b831
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Simplify by using format-time-string
* lisp/mail/sendmail.el (mail-do-fcc):
* lisp/net/tramp.el (tramp-debug-message):
Prefer format-time-string to doing time formatting by hand.
---
lisp/mail/sendmail.el | 14 +++++---------
lisp/net/tramp.el | 4 +---
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index d0aff09..d1e8a2f 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1391,8 +1391,7 @@ just append to the file, in Babyl format if necessary."
(unless (markerp header-end)
(error "Value of `header-end' must be a marker"))
(let (fcc-list
- (mailbuf (current-buffer))
- (time (current-time)))
+ (mailbuf (current-buffer)))
(save-excursion
(goto-char (point-min))
(let ((case-fold-search t))
@@ -1408,14 +1407,11 @@ just append to the file, in Babyl format if necessary."
(with-temp-buffer
;; This initial newline is not written out if we create a new
;; file (see below).
- (insert "\nFrom " (user-login-name) " " (current-time-string time) "\n")
- ;; Insert the time zone before the year.
- (forward-char -1)
- (forward-word-strictly -1)
(require 'mail-utils)
- (insert (mail-rfc822-time-zone time) " ")
- (goto-char (point-max))
- (insert "Date: " (message-make-date) "\n")
+ (insert "\nFrom " (user-login-name) " "
+ (let ((system-time-locale "C"))
+ (format-time-string "%a %b %e %T %z %Y"))
+ "\nDate: " (message-make-date) "\n")
(insert-buffer-substring mailbuf)
;; Make sure messages are separated.
(goto-char (point-max))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index f43c1d8..552788b 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2014,9 +2014,7 @@ ARGUMENTS to actually emit the message (if applicable)."
(unless (bolp)
(insert "\n"))
;; Timestamp.
- (let ((now (current-time)))
- (insert (format-time-string "%T." now))
- (insert (format "%06d " (nth 2 now))))
+ (insert (format-time-string "%T.%6N "))
;; Calling Tramp function. We suppress compat and trace
;; functions from being displayed.
(let ((btn 1) btf fn)
- master updated (4434dea -> c1145c3), Paul Eggert, 2021/12/06
- master c1145c3 13/13: Update org-compat doc string, Paul Eggert, 2021/12/06
- master 084f440 06/13: Simplify message-make-expires, Paul Eggert, 2021/12/06
- master dbef214 10/13: Simplify by using format-time-string,
Paul Eggert <=
- master 83fa35b 02/13: Use time-equal-p to compare timestamps in tests, Paul Eggert, 2021/12/06
- master 524c42f 04/13: Prefer nil to (current-time) when either will do, Paul Eggert, 2021/12/06
- master 19932c3 11/13: Avoid timestamp info loss in mh-alias-tstamp, Paul Eggert, 2021/12/06
- master 2bda029 07/13: Use time-convert in with-decoded-time-value, Paul Eggert, 2021/12/06
- master 15f20c0 09/13: Simplify RFC 5322 time zone generation, Paul Eggert, 2021/12/06
- master f4d7ca7 05/13: Simplify message-unique-id etc., Paul Eggert, 2021/12/06
- master 1866373 08/13: Fix image load timekeeping bug, Paul Eggert, 2021/12/06
- master af60618 03/13: Simplify cedet-utest-elapsed-time, Paul Eggert, 2021/12/06
- master 0d88c3c 01/13: Add time-convert tests, Paul Eggert, 2021/12/06
- master a21b8c5 12/13: Fix minor clock skew issues, Paul Eggert, 2021/12/06