X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-art.el;h=50363b6c9de5330ac58fe56f21dd3ea9136778d3;hb=e2696774a2e225ea60d46cc665d4232c80412731;hp=19624e764478de4aa88c6dc5d91a709de32a0ec4;hpb=290d6d8315bd0bf575178c4518ed00e57a0cd7ac;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 19624e7..50363b6 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -450,14 +450,14 @@ Example: (_/*word*/_)." "Face used for displaying highlighted words." :group 'gnus-article-emphasis) -(defcustom gnus-article-time-format "%a, %b %d %Y %T %Z" +(defcustom gnus-article-time-format "%a, %d %b %Y %T %Z" "Format for display of Date headers in article bodies. See `format-time-string' for the possible values. The variable can also be function, which should return a complete Date header. The function is called with one argument, the time, which can be fed to `format-time-string'." - :type '(choice string symbol) + :type '(choice string function) :link '(custom-manual "(gnus)Article Date") :group 'gnus-article-washing) @@ -1701,6 +1701,7 @@ Initialized from `text-mode-syntax-table.") (case-fold-search t) (max (1+ (length gnus-sorted-header-list))) (inhibit-point-motion-hooks t) + (cur (current-buffer)) ignored visible beg) (save-excursion ;; `gnus-ignored-headers' and `gnus-visible-headers' may be @@ -1723,7 +1724,7 @@ Initialized from `text-mode-syntax-table.") (mapconcat 'identity gnus-visible-headers "\\|"))))) - (set-buffer gnus-article-buffer)) + (set-buffer cur)) (save-restriction ;; First we narrow to just the headers. (article-narrow-to-head) @@ -3002,10 +3003,8 @@ should replace the \"Date:\" one, or should be added below it." (forward-line -1) ;; Do highlighting. (when (looking-at "\\([^:]+\\): *\\(.*\\)$") - (put-text-property (match-beginning 1) (1+ (match-end 1)) - 'original-date date) - (put-text-property (match-beginning 1) (1+ (match-end 1)) - 'face bface) + (add-text-properties (match-beginning 1) (1+ (match-end 1)) + (list 'original-date date 'face bface)) (put-text-property (match-beginning 2) (match-end 2) 'face eface)))))))) @@ -3018,22 +3017,21 @@ should replace the \"Date:\" one, or should be added below it." (cond ;; Convert to the local timezone. ((eq type 'local) - (let ((tz (car (current-time-zone time)))) - (format "Date: %s %s%02d%02d" (current-time-string time) - (if (> tz 0) "+" "-") (/ (abs tz) 3600) - (/ (% (abs tz) 3600) 60)))) + (concat "Date: " (message-make-date time))) ;; Convert to Universal Time. ((eq type 'ut) (concat "Date: " - (current-time-string - (let* ((e (parse-time-string date)) - (tm (apply 'encode-time e)) - (ms (car tm)) - (ls (- (cadr tm) (car (current-time-zone time))))) - (cond ((< ls 0) (list (1- ms) (+ ls 65536))) - ((> ls 65535) (list (1+ ms) (- ls 65536))) - (t (list ms ls))))) - " UT")) + (substring + (message-make-date + (let* ((e (parse-time-string date)) + (tm (apply 'encode-time e)) + (ms (car tm)) + (ls (- (cadr tm) (car (current-time-zone time))))) + (cond ((< ls 0) (list (1- ms) (+ ls 65536))) + ((> ls 65535) (list (1+ ms) (- ls 65536))) + (t (list ms ls))))) + 0 -5) + "UT")) ;; Get the original date from the article. ((eq type 'original) (concat "Date: " (if (string-match "\n+$" date) @@ -5391,6 +5389,7 @@ Argument LINES specifies lines to be scrolled up." (save-excursion (save-restriction (widen) + (forward-line) (eobp)))) ;Real end-of-buffer? (progn (when gnus-article-over-scroll