# HG changeset patch # User Katsumi Yamaoka # Date 1288583933 0 # Node ID cda54a3ff09d9f9a0894b65ffd0aeb01f569182e # Parent b486cbc37541a8c3e1a9a4645958b77f545024d6 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. diff -r b486cbc37541 -r cda54a3ff09d lisp/gnus/ChangeLog --- 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 + + * 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 * nnir.el (declare-function): Add compat stub. diff -r b486cbc37541 -r cda54a3ff09d lisp/gnus/gnus-msg.el --- 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)) diff -r b486cbc37541 -r cda54a3ff09d lisp/gnus/gnus-util.el --- 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 diff -r b486cbc37541 -r cda54a3ff09d lisp/gnus/nnir.el --- 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)))