comparison lisp/subr.el @ 44158:8bfb4deffa5f

(substring-no-properties): Function deleted (now in C).
author Richard M. Stallman <rms@gnu.org>
date Tue, 26 Mar 2002 09:17:56 +0000
parents 444bd245e176
children 3900f65547f0
comparison
equal deleted inserted replaced
44157:1965fb963598 44158:8bfb4deffa5f
1481 '((save-match-data-internal (match-data))) 1481 '((save-match-data-internal (match-data)))
1482 (list 'unwind-protect 1482 (list 'unwind-protect
1483 (cons 'progn body) 1483 (cons 'progn body)
1484 '(set-match-data save-match-data-internal)))) 1484 '(set-match-data save-match-data-internal))))
1485 1485
1486 (defun substring-no-properties (string &optional from to)
1487 "Return a substring of STRING, with no text properties.
1488 The substring starts at index FROM and ends before TO.
1489 If FROM is nil or omitted, it defaults to the beginning of STRING.
1490 If TO is nil or omitted, it defaults to the end of STRING.
1491 If FROM or TO is negative, it counts from the end.
1492
1493 Simply (substring-no-properties STRING) copies a string without
1494 its properties."
1495 (let ((str (substring string (or from 0) to)))
1496 (set-text-properties 0 (length str) nil str)
1497 str))
1498
1499 (defun match-string (num &optional string) 1486 (defun match-string (num &optional string)
1500 "Return string of text matched by last search. 1487 "Return string of text matched by last search.
1501 NUM specifies which parenthesized expression in the last regexp. 1488 NUM specifies which parenthesized expression in the last regexp.
1502 Value is nil if NUMth pair didn't match, or there were less than NUM pairs. 1489 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
1503 Zero means the entire text matched by the whole regexp or whole string. 1490 Zero means the entire text matched by the whole regexp or whole string.