aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-07-10 03:54:30 +0000
committerRichard M. Stallman2007-07-10 03:54:30 +0000
commit45595a4fae2dd3c322bd8991dcc2bdc42dcb00bc (patch)
tree33f92f3dab976419a757f870316b6d38eab3ad05
parentef8878109c47998abea49be9965c757af12cdd64 (diff)
downloademacs-45595a4fae2dd3c322bd8991dcc2bdc42dcb00bc.tar.gz
emacs-45595a4fae2dd3c322bd8991dcc2bdc42dcb00bc.zip
(looking-at-p, string-match-p): New functions.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog22
-rw-r--r--lisp/subr.el12
3 files changed, 28 insertions, 9 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 290fe0f6c7b..4323f6ff1cf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -131,6 +131,9 @@ but obeys file handlers. The file handler is chosen based on
131With this paramter passed non-nil, it is checked whether a remote 131With this paramter passed non-nil, it is checked whether a remote
132connection has been established already. 132connection has been established already.
133 133
134** The two new functions `looking-at-p' and `string-match-p' can do
135the same matching as `looking-at' and `string-match' without changing
136the match data.
134 137
135* New Packages for Lisp Programming in Emacs 23.1 138* New Packages for Lisp Programming in Emacs 23.1
136 139
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 58cfca107cb..4a95fd8d96d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,13 +1,6 @@
12007-07-08 Katsumi Yamaoka <yamaoka@jpl.org> 12007-07-10 Guanpeng Xu <herberteuler@hotmail.com>
2
3 * cus-start.el (file-coding-system-alist): Fix custom type.
4
52007-07-08 Chong Yidong <cyd@stupidchicken.com>
6 2
7 * longlines.el (longlines-wrap-region): Avoid marking buffer as 3 * subr.el (looking-at-p, string-match-p): New functions.
8 modified.
9 (longlines-auto-wrap, longlines-window-change-function): Remove
10 unnecessary calls to set-buffer-modified-p.
11 4
122007-07-09 Reiner Steib <Reiner.Steib@gmx.de> 52007-07-09 Reiner Steib <Reiner.Steib@gmx.de>
13 6
@@ -31,6 +24,17 @@
31 24
32 * cus-start.el (file-coding-system-alist): Fix custom type. 25 * cus-start.el (file-coding-system-alist): Fix custom type.
33 26
272007-07-08 Chong Yidong <cyd@stupidchicken.com>
28
29 * longlines.el (longlines-wrap-region): Avoid marking buffer as
30 modified.
31 (longlines-auto-wrap, longlines-window-change-function): Remove
32 unnecessary calls to set-buffer-modified-p.
33
342007-07-08 Katsumi Yamaoka <yamaoka@jpl.org>
35
36 * cus-start.el (file-coding-system-alist): Fix custom type.
37
342007-07-08 Stefan Monnier <monnier@iro.umontreal.ca> 382007-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
35 39
36 * vc-cvs.el (vc-cvs-revert): Use vc-default-revert. 40 * vc-cvs.el (vc-cvs-revert): Use vc-default-revert.
diff --git a/lisp/subr.el b/lisp/subr.el
index f890caf66e4..3804624b0b9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2668,6 +2668,18 @@ of a match for REGEXP."
2668 (looking-at (concat "\\(?:" regexp "\\)\\'"))))) 2668 (looking-at (concat "\\(?:" regexp "\\)\\'")))))
2669 (not (null pos)))) 2669 (not (null pos))))
2670 2670
2671(defsubst looking-at-p (regexp)
2672 "\
2673Same as `looking-at' except this function does not change the match data."
2674 (let ((inhibit-changing-match-data t))
2675 (looking-at regexp)))
2676
2677(defsubst string-match-p (regexp string &optional start)
2678 "\
2679Same as `string-match' except this function does not change the match data."
2680 (let ((inhibit-changing-match-data t))
2681 (string-match regexp string start)))
2682
2671(defun subregexp-context-p (regexp pos &optional start) 2683(defun subregexp-context-p (regexp pos &optional start)
2672 "Return non-nil if POS is in a normal subregexp context in REGEXP. 2684 "Return non-nil if POS is in a normal subregexp context in REGEXP.
2673A subregexp context is one where a sub-regexp can appear. 2685A subregexp context is one where a sub-regexp can appear.