aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
authorKatsumi Yamaoka <[email protected]>2010-11-01 03:58:53 +0000
committerKatsumi Yamaoka <[email protected]>2010-11-01 03:58:53 +0000
commit87732ef36ad03013efe8a6a29bdf9389f0abade3 (patch)
treed79c0aae5c0095ff94ef8ae3c39f6a0eee11302a /lisp/gnus
parent42d9cffad26ec6ac1738b252d4f7937361b45412 (diff)
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.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-util.el8
-rw-r--r--lisp/gnus/nnir.el2
4 files changed, 18 insertions, 2 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 37c262ad3d..1e42c4dc12 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-01 Katsumi Yamaoka <[email protected]>
+
+ * 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 <[email protected]>
* nnir.el (declare-function): Add compat stub.
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 46cbc75f2a..544aa7776a 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -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))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 239d81075d..94b7c63319 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -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
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 073df1928b..bfe4df8ee1 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -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)))