diff options
author | 2005-09-01 14:18:07 +0000 | |
---|---|---|
committer | 2005-09-01 14:18:07 +0000 | |
commit | f1328797b3efbc1163e57ed02528fbf209089bc6 (patch) | |
tree | d7591fa7ec2dfb0026540ac65e8510f8370911d1 /generic | |
parent | 93db85e34dae8006d1a0c6e5c5eea54d5ff2f12c (diff) |
added proof-search-forward, proof-replace-regexp-in-string;
avoid (re-)search-forward, which does not observe proof-case-fold-search;
Diffstat (limited to 'generic')
-rw-r--r-- | generic/proof-syntax.el | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/generic/proof-syntax.el b/generic/proof-syntax.el index 59a79361..db19ce4e 100644 --- a/generic/proof-syntax.el +++ b/generic/proof-syntax.el @@ -59,6 +59,18 @@ nil if a region cannot be found." ;; value of proof-case-fold-search. Last arg to string-match is not ;; applicable. +(defun proof-search-forward (string &optional bound noerror count) + "Like search-forward, but set case-fold-search to proof-case-fold-search." + (let + ((case-fold-search proof-case-fold-search)) + (search-forward string bound noerror count))) + +(defun proof-replace-regexp-in-string (regexp rep string) + "Like replace-regexp-in-string, but set case-fold-search to proof-case-fold-search." + (let + ((case-fold-search proof-case-fold-search)) + (replace-regexp-in-string regexp rep string))) + (defun proof-re-search-forward (regexp &optional bound noerror count) "Like re-search-forward, but set case-fold-search to proof-case-fold-search." (let @@ -112,12 +124,12 @@ If so, return non-nil." (defun proof-replace-string (string to-string) "Non-interactive version of `replace-string', which see." - (while (search-forward string nil t) + (while (proof-search-forward string nil t) (replace-match to-string nil t))) (defun proof-replace-regexp (regexp to-string) "Non-interactive version of `replace-regexp', which see." - (while (re-search-forward regexp nil t) + (while (proof-re-search-forward regexp nil t) (replace-match to-string nil nil))) @@ -145,7 +157,7 @@ Default is comma separated, or SEPREGEXP if set." (defun proof-zap-commas (limit) "Remove the face of all `,' from point to LIMIT. Meant to be used from `font-lock-keywords'." - (while (search-forward "," limit t) + (while (proof-search-forward "," limit t) (if (memq (get-text-property (1- (point)) 'face) '(proof-declaration-name-face font-lock-variable-name-face |