Update.
[elisp/wanderlust.git] / wl / wl-util.el
index 6ad81f5..cd24a30 100644 (file)
@@ -803,11 +803,13 @@ This function is imported from Emacs 20.7."
   (fset 'wl-biff-start 'ignore)))
 
 (defsubst wl-biff-notify (new-mails notify-minibuf)
+  (when (and (not wl-modeline-biff-status) (> new-mails 0))
+    (run-hooks 'wl-biff-notify-hook))
   (setq wl-modeline-biff-status (> new-mails 0))
   (force-mode-line-update t)
   (when notify-minibuf
     (cond ((zerop new-mails) (message "No mail."))
-         ((eq 1 new-mails) (message "You have a new mail."))
+         ((= 1 new-mails) (message "You have a new mail."))
          (t (message "You have %d new mails." new-mails)))))
 
 ;; Internal variable.
@@ -876,6 +878,18 @@ This function is imported from Emacs 20.7."
                        notify-minibuf)
        (setq wl-biff-check-folders-running nil)))))
 
+(if (and (fboundp 'regexp-opt)
+        (not (featurep 'xemacs)))
+    (defalias 'wl-regexp-opt 'regexp-opt)
+  (defun wl-regexp-opt (strings &optional paren)
+    "Return a regexp to match a string in STRINGS.
+Each string should be unique in STRINGS and should not contain any regexps,
+quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
+is enclosed by at least one regexp grouping construct."
+    (let ((open-paren (if paren "\\(" "")) (close-paren (if paren "\\)" "")))
+      (concat open-paren (mapconcat 'regexp-quote strings "\\|")
+             close-paren))))
+
 (require 'product)
 (product-provide (provide 'wl-util) (require 'wl-version))