diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 22:43:55 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-05 23:24:09 -0800 |
commit | 15f20c0bd06a25bbb4ea90e501ef85290509c43b (patch) | |
tree | e1adafdd3420ecd38459628115baf1f05affb906 /lisp/mail/feedmail.el | |
parent | 186637314dfa287b4b8178b668de92ecb57fdf1a (diff) | |
download | emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.tar.gz emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.tar.bz2 emacs-15f20c0bd06a25bbb4ea90e501ef85290509c43b.zip |
Simplify RFC 5322 time zone generation
* lisp/mail/feedmail.el (feedmail-rfc822-time-zone)
(feedmail-rfc822-date, feedmail-default-message-id-generator):
* lisp/mail/mail-utils.el (mail-rfc822-time-zone, mail-rfc822-date):
* lisp/timezone.el (timezone-make-arpa-date):
Simplify by using format-time-string with %z.
* lisp/mail/feedmail.el (feedmail-rfc822-time-zone):
* lisp/mail/mail-utils.el (mail-rfc822-time-zone):
Mark these should-have-been-internal functions obsolete.
Diffstat (limited to 'lisp/mail/feedmail.el')
-rw-r--r-- | lisp/mail/feedmail.el | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index fe686cb6f86..32edc292619 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -2336,19 +2336,14 @@ mapped to mostly alphanumerics for safety." ;; from a similar function in mail-utils.el (defun feedmail-rfc822-time-zone (time) + (declare (obsolete format-time-string "29.1")) (feedmail-say-debug ">in-> feedmail-rfc822-time-zone %s" time) - (let* ((sec (or (car (current-time-zone time)) 0)) - (absmin (/ (abs sec) 60))) - (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60)))) + (format-time-string "%z" time)) (defun feedmail-rfc822-date (arg-time) (feedmail-say-debug ">in-> feedmail-rfc822-date %s" arg-time) - (let ((time (or arg-time (current-time))) - (system-time-locale "C")) - (concat - (format-time-string "%a, %e %b %Y %T " time) - (feedmail-rfc822-time-zone time) - ))) + (let ((system-time-locale "C")) + (format-time-string "%a, %e %b %Y %T %z" arg-time))) (defun feedmail-send-it-immediately-wrapper () "Wrapper to catch skip-me-i." @@ -2847,10 +2842,9 @@ probably not appropriate for you." (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file) (setq date-time (file-attribute-modification-time (file-attributes maybe-file)))) - (format "<%d-%s%s%s>" + (format "<%d-%s%s>" (mod (random) 10000) - (format-time-string "%a%d%b%Y%H%M%S" date-time) - (feedmail-rfc822-time-zone date-time) + (format-time-string "%a%d%b%Y%H%M%S%z" date-time) end-stuff)) ) |