]> git.eshelyaron.com Git - emacs.git/commitdiff
gnus-util.el (gnus-string-match-p): New function, that is an alias to string-match...
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 1 Nov 2010 03:58:53 +0000 (03:58 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 1 Nov 2010 03:58:53 +0000 (03:58 +0000)
gnus-msg.el (gnus-configure-posting-styles)
nnir.el (nnir-run-gmane): Use gnus-string-match-p.

lisp/gnus/ChangeLog
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-util.el
lisp/gnus/nnir.el

index 37c262ad3d01d1257ca2d4917080cd5fdde6337e..1e42c4dc12ef8e713e744928a15039e912b7e18a 100644 (file)
@@ -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.
index 46cbc75f2a5f8f14a6febc0b827c625f3bb21156..544aa7776a84eed5c64162331352578669c89903 100644 (file)
@@ -1892,7 +1892,7 @@ this is a reply."
                  (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))
index 239d81075dd02212e1fab2d423533976a8d17b46..94b7c6331969471d811ce86440fc1f3fbea2fc73 100644 (file)
@@ -2010,6 +2010,14 @@ This is the definition of match-substitute-replacement in subr.el from GNU Emacs
                                  (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
index 073df1928bc8ed1c98e4ab1298b6f2e9867c5f11..bfe4df8ee1b0f00dbbd18ea14a645dfe5af6b168 100644 (file)
@@ -1392,7 +1392,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
 ;; 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)))