aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2011-02-03 05:21:20 +0000
committerKatsumi Yamaoka2011-02-03 05:21:20 +0000
commitc61a8b440411b9864ff9fa4aac313b6328e8c809 (patch)
tree9ce7c0fd95cdc04909fdf91b05344059076b5660
parent7f13c2e2d952ac66c992f6c1d5a8bc941939cd05 (diff)
downloademacs-c61a8b440411b9864ff9fa4aac313b6328e8c809.tar.gz
emacs-c61a8b440411b9864ff9fa4aac313b6328e8c809.zip
gnus-art.el (gnus-article-date-headers): Rip out the old -treat-date-* stuff, since it didn't really work with defcustom.
(article-update-date-lapsed): Make sure the window start doesn't move, either.
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/gnus-art.el36
2 files changed, 19 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f3a404338e9..5dcbd8f5ce0 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -2,6 +2,10 @@
2 2
3 * gnus-art.el (gnus-article-setup-buffer): Stop the date timer if 3 * gnus-art.el (gnus-article-setup-buffer): Stop the date timer if
4 gnus-article-update-date-headers is nil. 4 gnus-article-update-date-headers is nil.
5 (gnus-article-date-headers): Rip out the old -treat-date-* stuff, since
6 it didn't really work with defcustom.
7 (article-update-date-lapsed): Make sure the window start doesn't move,
8 either.
5 9
62011-02-01 Julien Danjou <julien@danjou.info> 102011-02-01 Julien Danjou <julien@danjou.info>
7 11
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index bddcaa9fd9d..e9a02619e6f 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1014,24 +1014,7 @@ on parts -- for instance, adding Vcard info to a database."
1014 :group 'gnus-article-mime 1014 :group 'gnus-article-mime
1015 :type '(repeat (cons :format "%v" (string :tag "MIME type") function))) 1015 :type '(repeat (cons :format "%v" (string :tag "MIME type") function)))
1016 1016
1017(defcustom gnus-article-date-headers 1017(defcustom gnus-article-date-headers '(combined-lapsed)
1018 (let ((types '(ut local english lapsed combined-lapsed
1019 iso8601 original user-defined))
1020 default)
1021 ;; Try to respect the legacy `gnus-treat-date-*' variables, if
1022 ;; they're set.
1023 (dolist (type types)
1024 (let ((variable (intern (format "gnus-treat-date-%s" type))))
1025 (when (and (boundp variable)
1026 (symbol-value variable))
1027 (push type default))))
1028 (when (and (or (not (boundp (intern "gnus-article-date-lapsed-new-header")))
1029 (not (symbol-value (intern "gnus-article-date-lapsed-new-header"))))
1030 (memq 'lapsed default))
1031 (setq default (delq 'lapsed default)))
1032 (or default
1033 ;; If they weren't set, we default to `combined-lapsed'.
1034 '(combined-lapsed)))
1035 "A list of Date header formats to display. 1018 "A list of Date header formats to display.
1036Valid formats are `ut' (universal time), `local' (local time 1019Valid formats are `ut' (universal time), `local' (local time
1037zone), `english' (readable English), `lapsed' (elapsed time), 1020zone), `english' (readable English), `lapsed' (elapsed time),
@@ -3645,14 +3628,25 @@ function and want to see what the date was before converting."
3645 (set-buffer (window-buffer w)) 3628 (set-buffer (window-buffer w))
3646 (when (eq major-mode 'gnus-article-mode) 3629 (when (eq major-mode 'gnus-article-mode)
3647 (let ((old-line (count-lines (point-min) (point))) 3630 (let ((old-line (count-lines (point-min) (point)))
3648 (old-column (- (point) (line-beginning-position)))) 3631 (old-column (- (point) (line-beginning-position)))
3632 (window-start
3633 (window-start (get-buffer-window (current-buffer)))))
3649 (goto-char (point-min)) 3634 (goto-char (point-min))
3650 (while (re-search-forward "^Date:" nil t) 3635 (while (re-search-forward "^Date:" nil t)
3651 (let ((type (get-text-property (match-beginning 0) 'gnus-date-type))) 3636 (let ((type (get-text-property (match-beginning 0)
3637 'gnus-date-type)))
3652 (when (memq type '(lapsed combined-lapsed user-format)) 3638 (when (memq type '(lapsed combined-lapsed user-format))
3639 (unless (= window-start
3640 (save-excursion
3641 (forward-line 1)
3642 (point)))
3643 (setq window-start nil))
3653 (save-excursion 3644 (save-excursion
3654 (article-date-ut type t (match-beginning 0))) 3645 (article-date-ut type t (match-beginning 0)))
3655 (forward-line 1)))) 3646 (forward-line 1)
3647 (when window-start
3648 (set-window-start (get-buffer-window (current-buffer))
3649 (point))))))
3656 (goto-char (point-min)) 3650 (goto-char (point-min))
3657 (when (> old-column 0) 3651 (when (> old-column 0)
3658 (setq old-line (1- old-line))) 3652 (setq old-line (1- old-line)))