diff lisp/gnus/gnus-util.el @ 109764:f5fa348fd8eb

Add new gnus-sync.el library. From Ted Zlatanov <tzz@lifelogs.com>. * gnus-registry.el (gnus-registry-follow-group-p): Use `gnus-grep-in-list'. * gnus-util.el (gnus-grep-in-list): Moved from gnus-registry.el and renamed from `gnus-registry-grep-in-list'. * gnus-sync.el: New library for synchronization of marks.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 13 Aug 2010 10:39:16 +0000
parents b7963ca9e06e
children 8d09094063d0
line wrap: on
line diff
--- a/lisp/gnus/gnus-util.el	Fri Aug 13 10:32:35 2010 +0000
+++ b/lisp/gnus/gnus-util.el	Fri Aug 13 10:39:16 2010 +0000
@@ -1297,6 +1297,14 @@
 	(setq alist (delq entry alist)))
       alist)))
 
+(defun gnus-grep-in-list (word list)
+  "Find if a WORD matches any regular expression in the given LIST."
+  (when (and word list)
+    (catch 'found
+      (dolist (r list)
+	(when (string-match r word)
+	  (throw 'found r))))))
+
 (defmacro gnus-pull (key alist &optional assoc-p)
   "Modify ALIST to be without KEY."
   (unless (symbolp alist)