all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* rmail-spam-filter.el - avoiding cl at runtime
@ 2003-02-19 14:39 John Paul Wallington
  0 siblings, 0 replies; only message in thread
From: John Paul Wallington @ 2003-02-19 14:39 UTC (permalink / raw)
  Cc: emacs-devel

How about the following patch to avoid loading cl at runtime?

--- rmail-spam-filter.el	19 Feb 2003 02:51:22 -0000	1.2
+++ rmail-spam-filter.el	19 Feb 2003 14:20:50 -0000
@@ -49,7 +49,7 @@
 ;;; (*) Block future mail with the subject or sender of a message
 ;;; while reading it in RMAIL: just click on the "Spam" item on the
 ;;; menubar, and add the subject or sender to the list of spam
-;;; definitions using the mouse and the appropriate menu item. Â  You
+;;; definitions using the mouse and the appropriate menu item.  You
 ;;; need to later also save the list of spam definitions using the
 ;;; same menu item, or alternatively, see variable
 ;;; `rmail-spam-filter-autosave-newly-added-spam-definitions'.
@@ -77,8 +77,8 @@
 
 (require 'rmail)
 
-;; For find-if and other cool common lisp functions we may want to use. (EDB)
-(require 'cl)				
+(eval-when-compile
+  (require 'cl))
 
 (defgroup rmail-spam-filter nil
   "Spam filter for RMAIL, the mail reader for Emacs."
@@ -234,27 +234,29 @@
 					    rmail-spam-definitions-alist))
 
 	;;; do we want to ignore case in spam definitions:
-	  (setq case-fold-search rmail-spam-filter-ignore-case)
+	(setq case-fold-search rmail-spam-filter-ignore-case)
 	
 	;; Check for blind CC condition.  Set vars such that while
 	;; loop will be bypassed and spam condition will trigger (EDB)
 	(if (and rmail-spam-no-blind-cc
 		 (null message-recipients))
-	    (progn
-	      (setq exit-while-loop t)
-	      (setq maybe-spam t)
-	      (setq this-is-a-spam-email t)))
+	    (setq exit-while-loop t
+		  maybe-spam t
+		  this-is-a-spam-email t))
+	
+	;; Check white list, and likewise cause while loop
+	;;  bypass. (EDB)
+	(if (let ((white-list rmail-spam-white-list)
+		  (found nil))
+	      (while (and (not found) white-list)
+		(if (string-match (car white-list) message-sender)
+		    (setq found t)
+		  (setq white-list (cdr white-list))))
+	      found)
+	    (setq exit-while-loop t
+		  maybe-spam nil
+		  this-is-a-spam-email nil))
 	
-	  ;; Check white list, and likewise cause while loop
-	  ;;  bypass. (EDB)
-	  (if (find-if '(lambda (white-str)
-			  (string-match white-str message-sender))
-		       rmail-spam-white-list)
-	      (progn
-		(setq exit-while-loop t)
-		(setq maybe-spam nil)
-		(setq this-is-a-spam-email nil)))
-	    
 	;; scan all elements of the list rmail-spam-definitions-alist
 	(while (and
 		(< num-element num-spam-definition-elements)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-19 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-19 14:39 rmail-spam-filter.el - avoiding cl at runtime John Paul Wallington

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.