From 89ec8b4c594135ab2ccc7bb3105a81fd3d4672be Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 9 Sep 2009 21:09:41 +0000 Subject: Add proof-re-search-forward-safe --- generic/proof-syntax.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'generic/proof-syntax.el') diff --git a/generic/proof-syntax.el b/generic/proof-syntax.el index 50ef90b1..bfa7b6e4 100644 --- a/generic/proof-syntax.el +++ b/generic/proof-syntax.el @@ -68,6 +68,12 @@ nil if a region cannot be found." (let ((case-fold-search proof-case-fold-search)) (re-search-backward regexp bound noerror count))) +(defsubst proof-re-search-forward-safe (regexp &optional bound noerror count) + "Like re-search-forward, but set case-fold-search to proof-case-fold-search." + (and regexp + (let ((case-fold-search proof-case-fold-search)) + (re-search-forward regexp bound noerror count)))) + (defsubst proof-string-match (regexp string &optional start) "Like string-match, but set case-fold-search to proof-case-fold-search." (let ((case-fold-search proof-case-fold-search)) -- cgit v1.2.3