]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/gmm-utils.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / gnus / gmm-utils.el
index 71a0662f35a1374e566c9ac408e85ec890fcc22f..d0e2c08bc7e3e336368b1ee8afcf58aea79f081e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gmm-utils.el --- Utility functions for Gnus, Message and MML
 
-;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Reiner Steib <reiner.steib@gmx.de>
 ;; Keywords: news
@@ -49,6 +49,19 @@ jabbering all the time."
   :type 'integer
   :group 'gmm)
 
+;;;###autoload
+(defun gmm-regexp-concat (regexp)
+  "Potentially concat a list of regexps into a single one.
+The concatenation is done with logical ORs."
+  (cond ((null regexp)
+        nil)
+       ((stringp regexp)
+        regexp)
+       ((listp regexp)
+        (mapconcat (lambda (elt) (concat "\\(" elt "\\)"))
+                   regexp
+                   "\\|"))))
+
 ;;;###autoload
 (defun gmm-message (level &rest args)
   "If LEVEL is lower than `gmm-verbose' print ARGS using `message'.