Mercurial > emacs
comparison lisp/progmodes/vera-mode.el @ 81993:83f3a5b8e58f
(vera-re-search-forward, vera-re-search-backward):
Remove use of store-match-data.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 20 Jul 2007 04:11:14 +0000 |
parents | d4e68ecdb000 |
children | 10d258c6090d |
comparison
equal
deleted
inserted
replaced
81992:df7b7863742c | 81993:83f3a5b8e58f |
---|---|
842 (goto-char (nth 8 state)) | 842 (goto-char (nth 8 state)) |
843 t))) | 843 t))) |
844 | 844 |
845 (defsubst vera-re-search-forward (regexp &optional bound noerror) | 845 (defsubst vera-re-search-forward (regexp &optional bound noerror) |
846 "Like `re-search-forward', but skips over matches in literals." | 846 "Like `re-search-forward', but skips over matches in literals." |
847 (store-match-data '(nil nil)) | 847 (let (ret) |
848 (while (and (re-search-forward regexp bound noerror) | 848 (while (and (setq ret (re-search-forward regexp bound noerror)) |
849 (vera-skip-forward-literal) | 849 (vera-skip-forward-literal) |
850 (progn (store-match-data '(nil nil)) | 850 (if bound (< (point) bound) t))) |
851 (if bound (< (point) bound) t)))) | 851 ret)) |
852 (match-end 0)) | |
853 | 852 |
854 (defsubst vera-re-search-backward (regexp &optional bound noerror) | 853 (defsubst vera-re-search-backward (regexp &optional bound noerror) |
855 "Like `re-search-backward', but skips over matches in literals." | 854 "Like `re-search-backward', but skips over matches in literals." |
856 (store-match-data '(nil nil)) | 855 (let (ret) |
857 (while (and (re-search-backward regexp bound noerror) | 856 (while (and (setq ret (re-search-backward regexp bound noerror)) |
858 (vera-skip-backward-literal) | 857 (vera-skip-backward-literal) |
859 (progn (store-match-data '(nil nil)) | 858 (if bound (> (point) bound) t))) |
860 (if bound (> (point) bound) t)))) | 859 ret)) |
861 (match-end 0)) | |
862 | 860 |
863 (defun vera-forward-syntactic-ws (&optional lim skip-directive) | 861 (defun vera-forward-syntactic-ws (&optional lim skip-directive) |
864 "Forward skip of syntactic whitespace." | 862 "Forward skip of syntactic whitespace." |
865 (save-restriction | 863 (save-restriction |
866 (let* ((lim (or lim (point-max))) | 864 (let* ((lim (or lim (point-max))) |