Mercurial > emacs
changeset 81783:f1d802f34413
(looking-at-p, string-match-p): New functions.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 10 Jul 2007 03:50:54 +0000 |
parents | f5f311fab8e4 |
children | f2e9e14a1ef2 |
files | lisp/subr.el |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Tue Jul 10 03:49:44 2007 +0000 +++ b/lisp/subr.el Tue Jul 10 03:50:54 2007 +0000 @@ -2668,6 +2668,18 @@ (looking-at (concat "\\(?:" regexp "\\)\\'"))))) (not (null pos)))) +(defsubst looking-at-p (regexp) + "\ +Same as `looking-at' except this function does not change the match data." + (let ((inhibit-changing-match-data t)) + (looking-at regexp))) + +(defsubst string-match-p (regexp string &optional start) + "\ +Same as `string-match' except this function does not change the match data." + (let ((inhibit-changing-match-data t)) + (string-match regexp string start))) + (defun subregexp-context-p (regexp pos &optional start) "Return non-nil if POS is in a normal subregexp context in REGEXP. A subregexp context is one where a sub-regexp can appear.