comparison lisp/subr.el @ 2138:2f37290328b0

[xemacs-hg @ 2004-06-17 11:29:37 by stephent] docstring kaizen <87k6y6l8zy.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 17 Jun 2004 11:29:39 +0000
parents e6d43c299b9c
children 52f00344a629
comparison
equal deleted inserted replaced
2137:67e24d0cc80f 2138:2f37290328b0
667 The beginning and end of STRING, and each match for SEPARATORS, are 667 The beginning and end of STRING, and each match for SEPARATORS, are
668 splitting points. The substrings matching SEPARATORS are removed, and 668 splitting points. The substrings matching SEPARATORS are removed, and
669 the substrings between the splitting points are collected as a list, 669 the substrings between the splitting points are collected as a list,
670 which is returned. 670 which is returned.
671 671
672 If SEPARATORS is non-nil, it should be a regular expression matching text 672 If SEPARATORS is non-`nil', it should be a regular expression matching text
673 which separates, but is not part of, the substrings. If nil it defaults to 673 which separates, but is not part of, the substrings. If `nil' it defaults to
674 `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and 674 `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
675 OMIT-NULLS is forced to t. 675 OMIT-NULLS is forced to `t'.
676 676
677 If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so 677 If OMIT-NULLS is `t', zero-length substrings are omitted from the list \(so
678 that for the default value of SEPARATORS leading and trailing whitespace 678 that for the default value of SEPARATORS leading and trailing whitespace
679 are effectively trimmed). If nil, all zero-length substrings are retained, 679 are effectively trimmed). If `nil', all zero-length substrings are retained,
680 which correctly parses CSV format, for example. 680 which correctly parses CSV format, for example.
681 681
682 Note that the effect of `(split-string STRING)' is the same as 682 Note that the effect of `(split-string STRING)' is the same as
683 `(split-string STRING split-string-default-separators t)'). In the rare 683 `(split-string STRING split-string-default-separators t)'). In the rare
684 case that you wish to retain zero-length substrings when splitting on 684 case that you wish to retain zero-length substrings when splitting on
685 whitespace, use `(split-string STRING split-string-default-separators nil)'. 685 whitespace, use `(split-string STRING split-string-default-separators nil)'.
686 686
687 Modifies the match data; use `save-match-data' if necessary." 687 Modifies the match data when successful; use `save-match-data' if necessary."
688 688
689 (let ((keep-nulls (not (if separators omit-nulls t))) 689 (let ((keep-nulls (not (if separators omit-nulls t)))
690 (rexp (or separators split-string-default-separators)) 690 (rexp (or separators split-string-default-separators))
691 (start 0) 691 (start 0)
692 notfirst 692 notfirst