From bb9a7c3af0d9992e378c084b6fe834dd843d8059 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 10 Sep 1998 23:21:59 +0000 Subject: [PATCH] * lisp/gnus-art.el (article-make-date-line): Add TZ value to `local' and `ut' date. * lisp/gnus-art.el (article-make-date-line): Fix `ut' date. * lisp/parse-time.el (parse-time-string): The last element of the return list should be TZ. * lisp/message.el (message-send): Eval 'message-fix-before-sending' after encoding. A snapshot is available from ftp://ftp.jpl.org/pub/tmp/semi-gnus-pgnus-ichikawa-19980911-1.tar.gz --- ChangeLog | 13 +++++++++++++ lisp/gnus-art.el | 19 ++++++++++++++----- lisp/message.el | 2 +- lisp/parse-time.el | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62e7de3..16ae315 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +1998-09-11 Katsumi Yamaoka + + * lisp/gnus-art.el (article-make-date-line): Add TZ value to + `local' and `ut' date. + + * lisp/gnus-art.el (article-make-date-line): Fix `ut' date. + + * lisp/parse-time.el (parse-time-string): The last element of the + return list should be TZ. + + * lisp/message.el (message-send): Eval 'message-fix-before-sending' + after encoding. + 1998-09-10 Katsumi Yamaoka * lisp/gnus-spec.el (gnus-tilde-pad-form): Use old macro form. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index efe14d1..c99f47e 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1294,17 +1294,26 @@ how much time has lapsed since DATE." ;; functions since they aren't particularly resistant to ;; buggy dates. ((eq type 'local) - (concat "Date: " (current-time-string time))) + (let ((tz (car (current-time-zone)))) + (format "Date: %s %s%04d" (current-time-string time) + (if (> tz 0) "+" "-") (abs (/ tz 36))))) ;; Convert to Universal Time. ((eq type 'ut) (concat "Date: " (current-time-string - (let ((e (parse-time-string date))) - (setcar (last e) 0) - (apply 'encode-time e))))) + (let* ((e (parse-time-string date)) + (tm (apply 'encode-time e)) + (ms (car tm)) + (ls (- (cadr tm) (car (current-time-zone))))) + (cond ((< ls 0) (list (1- ms) (+ ls 65536))) + ((> ls 65535) (list (1+ ms) (- ls 65536))) + (t (list ms ls))))) + " UT")) ;; Get the original date from the article. ((eq type 'original) - (concat "Date: " date)) + (concat "Date: " (if (string-match "\n+$" date) + (substring date 0 (match-beginning 0)) + date))) ;; Let the user define the format. ((eq type 'user) (if (gnus-functionp gnus-article-time-format) diff --git a/lisp/message.el b/lisp/message.el index 48d0ce2..7996747 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -2101,7 +2101,6 @@ the user from the mailer." (undo-boundary) (let ((inhibit-read-only t)) (put-text-property (point-min) (point-max) 'read-only nil)) - (message-fix-before-sending) (run-hooks 'message-send-hook) (message "Sending...") (let ((message-encoding-buffer @@ -2116,6 +2115,7 @@ the user from the mailer." (erase-buffer) (insert-buffer message-edit-buffer) (funcall message-encode-function) + (message-fix-before-sending) (while (and success (setq elem (pop alist))) (when (and (or (not (funcall (cadr elem))) diff --git a/lisp/parse-time.el b/lisp/parse-time.el index d9514f6..48a0586 100644 --- a/lisp/parse-time.el +++ b/lisp/parse-time.el @@ -169,7 +169,7 @@ "Parse the time-string STRING into (SEC MIN HOUR DAY MON YEAR DOW DST TZ). The values are identical to those of `decode-time', but any values that are unknown are returned as nil." - (let ((time (list nil nil nil nil nil nil nil nil nil nil)) + (let ((time (list nil nil nil nil nil nil nil nil nil)) (temp (parse-time-tokenize (downcase string)))) (while temp (let ((elt (pop temp)) -- 1.7.10.4