From: yamaoka Date: Fri, 18 Oct 2002 14:44:42 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_8-05-quimby~23 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4da83aaf4a7c93df4af001cb7139f4171a58cc5;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07ed89d..be4bc33 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2002-10-18 Kai Gro,A_(Bjohann + + * gnus-spec.el (gnus-make-format-preserve-properties) + (gnus-xmas-format, gnus-parse-simple-format): Preserve text + properties also on XEmacs. `gnus-xmas-format' is like format but + preserves text properties on XEmacs (though it only understands + simple format specs). The variable + `gnus-make-format-preserve-properties' controls whether the + function is used, and is checked in `gnus-parse-simple-format'. + Patch by Paul Moore . + + * gnus-agent.el (gnus-agent-fetch-articles): More debugging + output. + (gnus-agent-consider-all-articles): New variable. + (gnus-agent-get-undownloaded-list): Comment that marks todo item. + (gnus-agent-fetch-headers): Depending on + gnus-agent-consider-all-articles, maybe get all articles. + (gnus-category-predicate-alist, gnus-agent-read-p): New predicate + `read'. + 2002-10-18 Katsumi Yamaoka * message.el (message-send-mail): Make it possible to perform diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index e3af154..079f294 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -152,6 +152,12 @@ If this is `ask' the hook will query the user." :type '(repeat (symbol :tag "Mark")) :group 'gnus-agent) +(defcustom gnus-agent-consider-all-articles nil + "If non-nil, consider also the read articles for downloading." + :version "21.4" + :type 'boolean + :group 'gnus-agent) + ;;; Internal variables (defvar gnus-agent-history-buffers nil) @@ -738,6 +744,7 @@ the actual number of articles toggled is returned." (gnus-agent-method-p gnus-command-method)) (gnus-agent-load-alist gnus-newsgroup-name) ;; First mark all undownloaded articles as undownloaded. + ;; CCC kaig: Maybe change here to consider all headers. (let ((articles (mapcar (lambda (header) (mail-header-number header)) gnus-newsgroup-headers)) (agent-articles gnus-agent-article-alist) @@ -1006,6 +1013,8 @@ This can be added to `gnus-select-article-hook' or (with-temp-buffer (let (article) (while (setq article (pop articles)) + (gnus-message 10 "Fetching article %s for %s..." + article group) (when (or (gnus-backlog-request-article group article nntp-server-buffer) @@ -1097,7 +1106,10 @@ This can be added to `gnus-select-article-hook' or (pop gnus-agent-group-alist)))) (defun gnus-agent-fetch-headers (group &optional force) - (let* ((articles (gnus-list-of-unread-articles group)) + (let* ((articles + (if gnus-agent-consider-all-articles + (gnus-uncompress-range (gnus-active group)) + (gnus-list-of-unread-articles group))) (len (length articles)) (gnus-decode-encoded-word-function 'identity) (file (gnus-agent-article-name ".overview" group)) @@ -1611,6 +1623,7 @@ The following commands are available: (long . gnus-agent-long-p) (low . gnus-agent-low-scored-p) (high . gnus-agent-high-scored-p) + (read . gnus-agent-read-p) (true . gnus-agent-true) (false . gnus-agent-false)) "Mapping from short score predicate symbols to predicate functions.") @@ -1642,6 +1655,11 @@ The following commands are available: "Say whether an article has a high score or not." (> gnus-score gnus-agent-high-score)) +(defun gnus-agent-read-p () + "Say whether an article is read or not." + (gnus-member-of-range (mail-header-number gnus-headers) + (gnus-info-read (gnus-get-info gnus-newsgroup-name)))) + (defun gnus-category-make-function (cat) "Make a function from category CAT." (let ((func (gnus-category-make-function-1 cat))) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 55af072..237505e 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -37,6 +37,12 @@ :group 'gnus-format :type 'boolean) +(defcustom gnus-make-format-preserve-properties (featurep 'xemacs) + "*If non-nil, use a replacement `format' function which preserves +text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." + :group 'gnus-format + :type 'boolean) + ;;; Internal variables. (defvar gnus-summary-mark-positions nil) @@ -506,6 +512,41 @@ characters when given a pad value." (nth 1 sform))))) form))) + +(defun gnus-xmas-format (fstring &rest args) + "A version of `format' which preserves text properties. + +Required for XEmacs, where the built in `format' function strips all text +properties from both the format string and any inserted strings. + +Only supports the format sequence %s, and %% for inserting +literal % characters. A pad width and an optional - (to right pad) +are supported for %s." + (let ((re "%%\\|%\\(-\\)?\\([1-9][0-9]*\\)?s") + (n (length args))) + (with-temp-buffer + (insert-string fstring) + (goto-char (point-min)) + (while (re-search-forward re nil t) + (goto-char (match-end 0)) + (cond + ((string= (match-string 0) "%%") + (delete-char -1)) + (t + (if (null args) + (error 'wrong-number-of-arguments #'my-format n fstring)) + (let* ((minlen (string-to-int (or (match-string 2) ""))) + (arg (car args)) + (str (if (stringp arg) arg (format "%s" arg))) + (lpad (null (match-string 1))) + (padlen (max 0 (- minlen (length str))))) + (replace-match "") + (if lpad (insert-char ?\ padlen)) + (insert str) + (unless lpad (insert-char ?\ padlen)) + (setq args (cdr args)))))) + (buffer-string)))) + (defun gnus-parse-simple-format (format spec-alist &optional insert) ;; This function parses the FORMAT string with the help of the ;; SPEC-ALIST and returns a list that can be eval'ed to return a @@ -671,6 +712,13 @@ characters when given a pad value." ;; A single string spec in the end of the spec. ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring) (list (match-string 1 fstring) (car flist))) + ;; Only string (and %) specs (XEmacs only!) + ((and (featurep 'xemacs) + gnus-make-format-preserve-properties + (string-match + "\\`\\([^%]*\\(%%\\|%-?\\([1-9][0-9]*\\)?s\\)\\)*[^%]*\\'" + fstring)) + (list (cons 'gnus-xmas-format (cons fstring (nreverse flist))))) ;; A more complex spec. (t (list (cons 'format (cons fstring (nreverse flist))))))) diff --git a/lisp/spam.el b/lisp/spam.el index 4a22b9a..040b47e 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -62,20 +62,20 @@ (defvar spam-use-blacklist t "True if the blacklist should be used.") -(defvar spam-use-whitelist t +(defvar spam-use-whitelist nil "True if the whitelist should be used.") (defvar spam-use-blackholes nil ;; FIXME! Turned off for now. The DNS routines are said to be flaky. "True if blackholes should be used.") -(defvar spam-use-bogofilter t +(defvar spam-use-bogofilter nil "True if bogofilter should be used.") -(defvar spam-use-bbdb t +(defvar spam-use-bbdb nil "True if BBDB should be used.") -(defvar spam-use-bbdb t +(defvar spam-use-ifile nil "True if ifile should be used.") (defvar spam-split-group "spam"