X-Git-Url: https://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fgnus-art.el;h=19eee78ab17ff8fd5f499b950df4d4573cf367a9;hp=07eabd98a6d7131fd85c554a944f18cc5ab0ed46;hb=fb32cb1d5435873a7d172b0af2e9c58784ab5e6f;hpb=9c48c2d0cd1604f30884219a536d0c3c4048330e diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 07eabd98a..19eee78ab 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -683,7 +683,7 @@ beginning of a line." :type 'regexp :group 'gnus-article-various) -(defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m" +(defcustom gnus-article-mode-line-format "Gnus: %g %S%m" "*The format specification for the article mode line. See `gnus-summary-mode-line-format' for a closer description. @@ -691,6 +691,7 @@ The following additional specs are available: %w The article washing status. %m The number of MIME parts in the article." + :version "24.1" :type 'string :group 'gnus-article-various) @@ -1014,24 +1015,7 @@ on parts -- for instance, adding Vcard info to a database." :group 'gnus-article-mime :type '(repeat (cons :format "%v" (string :tag "MIME type") function))) -(defcustom gnus-article-date-headers - (let ((types '(ut local english lapsed combined-lapsed - iso8601 original user-defined)) - default) - ;; Try to respect the legacy `gnus-treat-date-*' variables, if - ;; they're set. - (dolist (type types) - (let ((variable (intern (format "gnus-treat-date-%s" type)))) - (when (and (boundp variable) - (symbol-value variable)) - (push type default)))) - (when (and (or (not (boundp (intern "gnus-article-date-lapsed-new-header"))) - (not (symbol-value (intern "gnus-article-date-lapsed-new-header")))) - (memq 'lapsed default)) - (setq default (delq 'lapsed default))) - (or default - ;; If they weren't set, we default to `combined-lapsed'. - '(combined-lapsed))) +(defcustom gnus-article-date-headers '(combined-lapsed) "A list of Date header formats to display. Valid formats are `ut' (universal time), `local' (local time zone), `english' (readable English), `lapsed' (elapsed time), @@ -3420,6 +3404,7 @@ possible values." (inhibit-read-only t) (inhibit-point-motion-hooks t) (first t) + (visible-date (mail-fetch-field "Date")) pos date bface eface) (save-excursion (save-restriction @@ -3443,6 +3428,9 @@ possible values." (delete-region (point-at-bol) (progn (gnus-article-forward-header) (point)))) + (when (and (not date) + visible-date) + (setq date visible-date)) (when date (article-transform-date date type bface eface))))))) @@ -3645,14 +3633,26 @@ function and want to see what the date was before converting." (set-buffer (window-buffer w)) (when (eq major-mode 'gnus-article-mode) (let ((old-line (count-lines (point-min) (point))) - (old-column (current-column))) + (old-column (- (point) (line-beginning-position))) + (window-start + (window-start (get-buffer-window (current-buffer))))) (goto-char (point-min)) (while (re-search-forward "^Date:" nil t) - (let ((type (get-text-property (match-beginning 0) 'gnus-date-type))) + (let ((type (get-text-property (match-beginning 0) + 'gnus-date-type))) (when (memq type '(lapsed combined-lapsed user-format)) + (when (and window-start + (not (= window-start + (save-excursion + (forward-line 1) + (point))))) + (setq window-start nil)) (save-excursion (article-date-ut type t (match-beginning 0))) - (forward-line 1)))) + (forward-line 1) + (when window-start + (set-window-start (get-buffer-window (current-buffer)) + (point)))))) (goto-char (point-min)) (when (> old-column 0) (setq old-line (1- old-line))) @@ -4505,9 +4505,13 @@ commands: (setq gnus-summary-buffer (gnus-summary-buffer-name gnus-newsgroup-name)) (gnus-summary-set-local-parameters gnus-newsgroup-name) - (when (and gnus-article-update-date-headers - (not article-lapsed-timer)) + (cond + ((and gnus-article-update-date-headers + (not article-lapsed-timer)) (gnus-start-date-timer gnus-article-update-date-headers)) + ((and (not gnus-article-update-date-headers) + article-lapsed-timer) + (gnus-stop-date-timer))) (current-buffer))))) ;; Set article window start at LINE, where LINE is the number of lines @@ -4633,6 +4637,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (forward-line -1)) (set-window-point (get-buffer-window (current-buffer)) (point)) (gnus-configure-windows 'article) + (gnus-run-hooks 'gnus-article-prepare-hook) t)))))) ;;;###autoload @@ -4650,8 +4655,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." gnus-article-image-alist nil) (gnus-run-hooks 'gnus-tmp-internal-hook) (when gnus-display-mime-function - (funcall gnus-display-mime-function)) - (gnus-run-hooks 'gnus-article-prepare-hook))) + (funcall gnus-display-mime-function)))) ;;; ;;; Gnus Sticky Article Mode @@ -4876,8 +4880,6 @@ General format specifiers can also be used. See Info node (when (zerop parts) (error "No such part")) (pop-to-buffer gnus-article-buffer) - ;; FIXME: why is it necessary? - (sit-for 0) (or n (setq n (if (= parts 1) 1 @@ -6320,7 +6322,8 @@ specifies." (defun gnus-article-next-page-1 (lines) (condition-case () - (let ((scroll-in-place nil)) + (let ((scroll-in-place nil) + (auto-window-vscroll nil)) (scroll-up lines)) (end-of-buffer ;; Long lines may cause an end-of-buffer error. @@ -7340,9 +7343,6 @@ as a symbol to FUN." (defvar gnus-button-handle-describe-prefix "^\\(C-h\\|?\\)") -;; FIXME: Maybe we should merge some of the functions that do quite similar -;; stuff? - (defun gnus-button-handle-describe-function (url) "Call `describe-function' when pushing the corresponding URL button." (describe-function