+2002-10-18 Kai Gro\e,A_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * 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 <gustav@morpheus.demon.co.uk>.
+
+ * 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 <yamaoka@jpl.org>
* message.el (message-send-mail): Make it possible to perform
: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)
(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)
(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)
(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))
(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.")
"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)))
: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)
(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
;; 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)))))))
(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"