(setq found t
cache nil)))
found))
+
+(defun spam-display-buffer-contents ()
+ "Display contents of the current buffer in the echo area if possible,
+otherwise pop-up the buffer itself."
+ (unless (zerop (buffer-size))
+ (if (<= (count-lines (point-min) (point-max)) 1)
+ (progn
+ (goto-char (point-max))
+ (when (bolp)
+ (backward-char 1))
+ (message "%s" (buffer-substring (point-min) (point))))
+ (goto-char (point-min))
+ (display-buffer (current-buffer)))))
+
\f
;;;; Training via Bogofilter. Last updated 2002-09-02.
(spam-bogofilter-articles nil "-v" (list (gnus-summary-article-number)))
(save-excursion
(set-buffer spam-output-buffer-name)
- (unless (= (point-min) (point-max))
- (display-message-or-buffer (current-buffer)
- spam-output-buffer-name)))))
+ (spam-display-buffer-contents))))
(defun spam-bogofilter-register-routine ()
(when (and spam-use-bogofilter spam-bogofilter-path)