changeset 111294:cda54a3ff09d

gnus-util.el (gnus-string-match-p): New function, that is an alias to string-match-p in Emacs >=23. gnus-msg.el (gnus-configure-posting-styles) nnir.el (nnir-run-gmane): Use gnus-string-match-p.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 01 Nov 2010 03:58:53 +0000
parents b486cbc37541
children fca66d4226a6
files lisp/gnus/ChangeLog lisp/gnus/gnus-msg.el lisp/gnus/gnus-util.el lisp/gnus/nnir.el
diffstat 4 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Sun Oct 31 23:20:57 2010 -0400
+++ b/lisp/gnus/ChangeLog	Mon Nov 01 03:58:53 2010 +0000
@@ -1,3 +1,11 @@
+2010-11-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-string-match-p): New function, that is an alias to
+	string-match-p in Emacs >=23.
+
+	* gnus-msg.el (gnus-configure-posting-styles)
+	* nnir.el (nnir-run-gmane): Use gnus-string-match-p.
+
 2010-11-01  Glenn Morris  <rgm@gnu.org>
 
 	* nnir.el (declare-function): Add compat stub.
--- a/lisp/gnus/gnus-msg.el	Sun Oct 31 23:20:57 2010 -0400
+++ b/lisp/gnus/gnus-msg.el	Mon Nov 01 03:58:53 2010 +0000
@@ -1892,7 +1892,7 @@
 		  (cond
 		   ((stringp value)
 		    (if (and (stringp match)
-			     (string-match-p "\\\\[&[:digit:]]" value)
+			     (gnus-string-match-p "\\\\[&[:digit:]]" value)
 			     (match-beginning 1))
 			(gnus-match-substitute-replacement value nil nil group)
 		      value))
--- a/lisp/gnus/gnus-util.el	Sun Oct 31 23:20:57 2010 -0400
+++ b/lisp/gnus/gnus-util.el	Mon Nov 01 03:58:53 2010 +0000
@@ -2010,6 +2010,14 @@
 				  (match-data t)))
 	  (replace-match replacement fixedcase literal match subexp)))))))
 
+(if (fboundp 'string-match-p)
+    (defalias 'gnus-string-match-p 'string-match-p)
+  (defsubst gnus-string-match-p (regexp string &optional start)
+    "\
+Same as `string-match' except this function does not change the match data."
+    (save-match-data
+      (string-match regexp string start))))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
--- a/lisp/gnus/nnir.el	Sun Oct 31 23:20:57 2010 -0400
+++ b/lisp/gnus/nnir.el	Mon Nov 01 03:58:53 2010 +0000
@@ -1392,7 +1392,7 @@
 ;; gmane interface
 (defun nnir-run-gmane (query srv &optional groups)
   "Run a search against a gmane back-end server."
-  (if (string-match-p "gmane" srv)
+  (if (gnus-string-match-p "gmane" srv)
       (let* ((case-fold-search t)
 	     (qstring (cdr (assq 'query query)))
 	     (server (cadr (gnus-server-to-method srv)))