comparison lisp/subr.el @ 15965:daebc0d7f610

(save-match-data): Fix previous change.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Aug 1996 01:54:43 +0000
parents 32d772cba2c1
children 9a41bae14122
comparison
equal deleted inserted replaced
15964:0e6def53a74f 15965:daebc0d7f610
746 ;; that works ok in practice (people should not use that variable elsewhere). 746 ;; that works ok in practice (people should not use that variable elsewhere).
747 ;; We used to use an uninterned symbol; the compiler handles that properly 747 ;; We used to use an uninterned symbol; the compiler handles that properly
748 ;; now, but it generates slower code. 748 ;; now, but it generates slower code.
749 (defmacro save-match-data (&rest body) 749 (defmacro save-match-data (&rest body)
750 "Execute the BODY forms, restoring the global value of the match data." 750 "Execute the BODY forms, restoring the global value of the match data."
751 `(let ((save-match-data-variable '(match-data))) 751 `(let ((save-match-data-internal '(match-data)))
752 (unwind-protect 752 (unwind-protect
753 (progn ,@body) 753 (progn ,@body)
754 (store-match-data save-match-data-variable))))) 754 (store-match-data save-match-data-internal))))
755 755
756 (defun match-string (num &optional string) 756 (defun match-string (num &optional string)
757 "Return string of text matched by last search. 757 "Return string of text matched by last search.
758 NUM specifies which parenthesized expression in the last regexp. 758 NUM specifies which parenthesized expression in the last regexp.
759 Value is nil if NUMth pair didn't match, or there were less than NUM pairs. 759 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.