all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Paul Wallington <jpw@gnu.org>
Cc: emacs-devel@gnu.org
Subject: rmail-spam-filter.el - avoiding cl at runtime
Date: Wed, 19 Feb 2003 14:39:28 +0000	[thread overview]
Message-ID: <E18lVNg-0006IJ-00@china.shootybangbang.com> (raw)

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)

                 reply	other threads:[~2003-02-19 14:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E18lVNg-0006IJ-00@china.shootybangbang.com \
    --to=jpw@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.