From: yamaoka Date: Thu, 28 Oct 2004 12:12:48 +0000 (+0000) Subject: Synch to No Gnus 200410281212. X-Git-Tag: t-gnus-6_17_4-quimby-~694 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0c94d05dffa58fdbbef5ebd6ed6eeb53d4f626d0;p=elisp%2Fgnus.git- Synch to No Gnus 200410281212. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a0503f..2af9172 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-10-28 Katsumi Yamaoka + + * gnus-sum.el (gnus-update-summary-mark-positions): Allow users to + use the same characters as the dummy marks; make it free from + getting affected by the language environment. + (gnus-summary-read-group-1): Update mark positions only when the + format spec is updated. + + * gnus-spec.el (gnus-update-format-specifications): Return a list + of updated types. + 2004-10-27 Katsumi Yamaoka * gnus-start.el (gnus-check-reasonable-setup): Use fboundp instead diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 5208b67..9424123 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -225,7 +225,8 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." (bury-buffer "*Compile-Log-Show*")))))))) (defun gnus-update-format-specifications (&optional force &rest types) - "Update all (necessary) format specifications." + "Update all (necessary) format specifications. +Return a list of updated types." ;; Make the indentation array. ;; See whether all the stored info needs to be flushed. (when force @@ -244,26 +245,28 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." gnus-format-specs-compiled (delq spec gnus-format-specs-compiled)))) ;; Go through all the formats and see whether they need updating. - (let (type val) + (let (type val updated) (save-excursion (while (setq type (pop types)) ;; Jump to the proper buffer to find out the value of the ;; variable, if possible. (It may be buffer-local.) - (let* ((new-format - (let ((buffer (intern (format "gnus-%s-buffer" type)))) - (when (and (boundp buffer) - (setq val (symbol-value buffer)) - (gnus-buffer-exists-p val)) - (set-buffer val)) - (symbol-value - (intern (format "gnus-%s-line-format" type)))))) - (or (gnus-update-format-specification-1 type new-format nil) - ;; This is a new format. - (gnus-update-format-specification-1 - type new-format - (gnus-search-or-regist-spec (gnus-format-specs - type new-format val entry elem) - (setq val (if (stringp new-format) + (let ((new-format + (let ((buffer (intern (format "gnus-%s-buffer" type)))) + (when (and (boundp buffer) + (setq val (symbol-value buffer)) + (gnus-buffer-exists-p val)) + (set-buffer val)) + (symbol-value + (intern (format "gnus-%s-line-format" type)))))) + (when + (or (gnus-update-format-specification-1 type new-format nil) + ;; This is a new format. + (gnus-update-format-specification-1 + type new-format + (gnus-search-or-regist-spec (gnus-format-specs + type new-format val entry elem) + (setq val + (if (stringp new-format) ;; This is a "real" format. (gnus-parse-format new-format @@ -273,7 +276,9 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." (not (string-match "mode$" (symbol-name type)))) ;; This is a function call or something. - new-format)))))))))) + new-format))))) + (push type updated))))) + updated)) (defvar gnus-mouse-face-0 'highlight) (defvar gnus-mouse-face-1 'highlight) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 55a449b..3f1164a 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -3268,45 +3268,56 @@ buffer that was in action when the last article was fetched." (save-excursion (when (gnus-buffer-exists-p gnus-summary-buffer) (set-buffer gnus-summary-buffer)) - (let ((gnus-replied-mark 129) - (gnus-score-below-mark 130) - (gnus-score-over-mark 130) - (gnus-undownloaded-mark 131) - (spec gnus-summary-line-format-spec) - gnus-visual pos) + (let ((spec gnus-summary-line-format-spec) + pos) (save-excursion (gnus-set-work-buffer) - (let ((gnus-summary-line-format-spec spec) + (let ((gnus-tmp-unread ?Z) + (gnus-replied-mark ?Z) + (gnus-score-below-mark ?Z) + (gnus-score-over-mark ?Z) + (gnus-undownloaded-mark ?Z) + (gnus-summary-line-format-spec spec) (gnus-newsgroup-downloadable '(0)) - marks) - (insert ?\200 "\200" ?\201 "\201" ?\202 "\202" ?\203 "\203") - (while (not (bobp)) - (push (buffer-substring (1- (point)) (point)) marks) - (backward-char)) + (header + (make-full-mail-header + 0 "" "nobody" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil)) + case-fold-search ignores) + ;; Here, all marks are bound to Z. + (gnus-summary-insert-line header + 0 nil t gnus-tmp-unread t nil "" nil 1) + (goto-char (point-min)) + ;; Memorize the positions of the same characters as dummy marks. + (while (re-search-forward "[A-D]" nil t) + (push (point) ignores)) (erase-buffer) - (gnus-summary-insert-line - (make-full-mail-header 0 "" "nobody" - "05 Apr 2001 23:33:09 +0400" - "" "" 0 0 "" nil) - 0 nil t 128 t nil "" nil 1) + ;; We use A-D as dummy marks in order to know column positions + ;; where marks should be inserted. + (setq gnus-tmp-unread ?A + gnus-replied-mark ?B + gnus-score-below-mark ?C + gnus-score-over-mark ?C + gnus-undownloaded-mark ?D) + (gnus-summary-insert-line header + 0 nil t gnus-tmp-unread t nil "" nil 1) + ;; Ignore characters which aren't dummy marks. + (dolist (p ignores) + (delete-region (goto-char (1- p)) p) + (insert ?Z)) (goto-char (point-min)) (setq pos (list (cons 'unread - (and (or (search-forward (nth 0 marks) nil t) - (search-forward (nth 1 marks) nil t)) + (and (search-forward "A" nil t) (- (point) (point-min) 1))))) (goto-char (point-min)) - (push (cons 'replied (and (or (search-forward (nth 2 marks) nil t) - (search-forward (nth 3 marks) nil t)) + (push (cons 'replied (and (search-forward "B" nil t) (- (point) (point-min) 1))) pos) (goto-char (point-min)) - (push (cons 'score (and (or (search-forward (nth 4 marks) nil t) - (search-forward (nth 5 marks) nil t)) + (push (cons 'score (and (search-forward "C" nil t) (- (point) (point-min) 1))) pos) (goto-char (point-min)) - (push (cons 'download (and (or (search-forward (nth 6 marks) nil t) - (search-forward (nth 7 marks) nil t)) + (push (cons 'download (and (search-forward "D" nil t) (- (point) (point-min) 1))) pos))) (setq gnus-summary-mark-positions pos)))) @@ -3618,9 +3629,11 @@ If SHOW-ALL is non-nil, already read articles are also listed." (gnus-active gnus-newsgroup-name))) ;; You can change the summary buffer in some way with this hook. (gnus-run-hooks 'gnus-select-group-hook) - (gnus-update-format-specifications - nil 'summary 'summary-mode 'summary-dummy) - (gnus-update-summary-mark-positions) + (when (memq 'summary (gnus-update-format-specifications + nil 'summary 'summary-mode 'summary-dummy)) + ;; The format specification for the summary line was updated, + ;; so we need to update the mark positions as well. + (gnus-update-summary-mark-positions)) ;; Do score processing. (when gnus-use-scoring (gnus-possibly-score-headers))