• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/gnus/

Lines Matching +defs:gnus +defs:article +defs:buffer

38 ;; `spam-stat-buffer-is-spam' -- called in a buffer, that buffer is
42 ;; `spam-stat-buffer-is-non-spam' -- called in a buffer, that buffer
46 ;; `spam-stat-buffer-change-to-spam' -- called in a buffer, that
47 ;; buffer is no longer considered to be normal mail but spam; use this
51 ;; `spam-stat-buffer-change-to-non-spam' -- called in a buffer, that
52 ;; buffer is no longer considered to be spam but normal mail; use this
64 ;; `spam-stat-score-buffer' -- return the spam score for a buffer
69 ;; This requires the following in your ~/.gnus file:
110 ;; buffer and saves the hash table when leaving Gnus. More testing:
127 (defvar gnus-original-article-buffer)
133 whether a buffer contains spam or not."
135 :group 'gnus)
160 (defcustom spam-stat-max-buffer-length 10240
193 (defvar spam-stat-buffer nil
197 (defvar spam-stat-buffer-name " *spam stat buffer*"
198 "Name of the `spam-stat-buffer'.")
214 Evaluate BODY with syntax table of current buffer set to a copy of TABLE.
215 The syntax table of the current buffer is saved, BODY is evaluated, and the
219 (old-buffer (make-symbol "buffer")))
221 (,old-buffer (current-buffer)))
226 (save-current-buffer
227 (set-buffer ,old-buffer)
232 (defun spam-stat-store-current-buffer ()
233 "Store a copy of the current buffer in `spam-stat-buffer'."
235 (let ((str (buffer-string)))
236 (set-buffer (get-buffer-create spam-stat-buffer-name))
237 (erase-buffer)
239 (setq spam-stat-buffer (current-buffer)))))
241 (defun spam-stat-store-gnus-article-buffer ()
242 "Store a copy of the current article in `spam-stat-buffer'.
243 This uses `gnus-article-buffer'."
245 (set-buffer gnus-original-article-buffer)
246 (spam-stat-store-current-buffer)))
316 (defmacro with-spam-stat-max-buffer-size (&rest body)
317 "Narrows the buffer down to the first 4k characters, then evaluates BODY."
321 spam-stat-max-buffer-length)
323 (+ (point-min) spam-stat-max-buffer-length)))
326 (defun spam-stat-buffer-words ()
327 "Return a hash table of words and number of occurrences in the buffer."
328 (with-spam-stat-max-buffer-size
340 (defun spam-stat-buffer-is-spam ()
341 "Consider current buffer to be a new spam mail."
351 (spam-stat-buffer-words))
354 (defun spam-stat-buffer-is-non-spam ()
355 "Consider current buffer to be a new non-spam mail."
365 (spam-stat-buffer-words))
368 (defun spam-stat-buffer-change-to-spam ()
369 "Consider current buffer no longer normal mail but spam."
376 (error "This buffer has unknown words in it")
381 (spam-stat-buffer-words))
384 (defun spam-stat-buffer-change-to-non-spam ()
385 "Consider current buffer no longer spam but normal mail."
392 (error "This buffer has unknown words in it")
397 (spam-stat-buffer-words))
407 (with-temp-buffer
408 (let ((standard-output (current-buffer))
457 "Raw data used in the last run of `spam-stat-score-buffer'.")
465 (defun spam-stat-buffer-words-with-scores ()
466 "Process current buffer, return the 15 most conspicuous words.
470 (with-spam-stat-max-buffer-size
477 (spam-stat-buffer-words))
482 (defun spam-stat-score-buffer ()
483 "Return a score describing the spam-probability for this buffer."
484 (setq spam-stat-score-data (spam-stat-buffer-words-with-scores))
493 the raw data used for the last run of `spam-stat-score-buffer',
497 (set-buffer spam-stat-buffer)
499 (when (> (spam-stat-score-buffer) spam-stat-split-fancy-spam-threshhold)
515 (with-temp-buffer
524 (erase-buffer))))))
529 (spam-stat-process-directory dir 'spam-stat-buffer-is-spam))
534 (spam-stat-process-directory dir 'spam-stat-buffer-is-non-spam))
552 (with-temp-buffer
561 (when (> (spam-stat-score-buffer) 0.9)
563 (erase-buffer))))
586 'spam-stat-store-current-buffer)
587 (add-hook 'gnus-select-article-hook
588 'spam-stat-store-gnus-article-buffer))
597 'spam-stat-store-current-buffer)
598 (remove-hook 'gnus-select-article-hook
599 'spam-stat-store-gnus-article-buffer))