From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.bugs Subject: bug#26925: Improve /doc/lispref/strings.texi (split-string) documentation Date: Mon, 15 May 2017 00:45:34 +0900 Message-ID: <93AB3C85-27C1-48FF-8C3D-B90B4CF33670@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B07BDC46-D0EF-4F8C-B58C-49E0D895A976" X-Trace: blaine.gmane.org 1494776773 20457 195.159.176.226 (14 May 2017 15:46:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 May 2017 15:46:13 +0000 (UTC) To: 26925@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 14 17:46:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9vii-0005Cc-U2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 May 2017 17:46:09 +0200 Original-Received: from localhost ([::1]:33102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9vio-000135-HH for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 May 2017 11:46:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9vig-00012z-8I for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9vic-0002Os-Ry for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9vic-0002Ok-EQ for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d9vic-00028t-2W for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jean-Christophe Helary Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 May 2017 15:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26925 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14947767548214 (code B ref -1); Sun, 14 May 2017 15:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2017 15:45:54 +0000 Original-Received: from localhost ([127.0.0.1]:44955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9viT-00028Q-QN for submit@debbugs.gnu.org; Sun, 14 May 2017 11:45:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9viR-00028C-SI for submit@debbugs.gnu.org; Sun, 14 May 2017 11:45:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9viL-0002J3-6n for submit@debbugs.gnu.org; Sun, 14 May 2017 11:45:45 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42034) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9viL-0002Ix-3w for submit@debbugs.gnu.org; Sun, 14 May 2017 11:45:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9viK-00012l-4h for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:45:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9viH-0002Hh-1R for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:45:44 -0400 Original-Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:33225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9viG-0002HH-Qs for bug-gnu-emacs@gnu.org; Sun, 14 May 2017 11:45:40 -0400 Original-Received: by mail-pf0-x229.google.com with SMTP id e193so51101392pfh.0 for ; Sun, 14 May 2017 08:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=wt2m4YC3z72cEBTFeXGGr0cZKnxrChn6oa0oBvfBPwc=; b=rriNtZqqPOBQJTjq78Wo1Wpd+GFbM6GW99QdLzO5KKBC/c9Qwm2b4MNPSyKg23sklH AhRG1t5nQiEJA58Yf3enjmtnmvwZtwiCVUdBA5ZglCUUzCLA6SXjwHJzblwb5rXuQa3H gy0SO2rsm6xvIlMh/vXfGdNruHNCeaMCDOYyNSBIkMHQC/YIvEJZDPT107fIyLESxgmC B/L4RRi3AG9kWXubJjZX2zEpIcI3/Sw0ZY6T+2TM4RoccCSzDvaK40Xt5bRnvk+Ym9ep S6TlCB/yyeH9G1n1BeLimV5dYIHmENOuHd8Xo2jLbp25wuYR31oKjsppBFYH7CG9uT32 UnkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=wt2m4YC3z72cEBTFeXGGr0cZKnxrChn6oa0oBvfBPwc=; b=IrZipX2wPl5wxMWLCE0n0aMgBRcH2xS7VKSjNzLqde1xuoCioMPJ0u+kbKDDlQ/7Q4 yz2U22dJJCrMLxjRfTMC52SxJnQy2pwyD+dp86bIXrJpWCn/04+rPlhmlX43r6v9d90X n8aEK18C8GodKzZN2FtdNuq4uqREgAAG+73wwXSCoh+b8zzeXQ4r61/7Bptx6yYWyt16 DiqCayZiI3ew6yw7tuY5FJ3NVfpvbbu5S+veo1qVkdlvSHSuscACRHiKgmWjfgie9a5q snq6VmwThYcfzGpV1dH4H9QuYWKGUCAQ4icLnu9S5hqbve5lAvbDwV/9cVhBzI9yqBCB DkhA== X-Gm-Message-State: AODbwcBkqP4eambBLU0rK+5TucummPZ5R2q6jetHr7408JzfsRiLCYT8 PRCxcvrBJbNUTdhf6jY= X-Received: by 10.99.232.69 with SMTP id a5mr1892216pgk.167.1494776738953; Sun, 14 May 2017 08:45:38 -0700 (PDT) Original-Received: from [192.168.24.54] (pl25298.ag0304.nttpc.ne.jp. [133.232.153.210]) by smtp.gmail.com with ESMTPSA id s68sm15336502pgc.5.2017.05.14.08.45.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 May 2017 08:45:37 -0700 (PDT) X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132501 Archived-At: --Apple-Mail=_B07BDC46-D0EF-4F8C-B58C-49E0D895A976 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I slightly changed the paragraph order in the documentation to = (split-string) to make it more readable. Jean-Christophe=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Improve documentation of (split-string) * /doc/lispref/strings.texi (split-string): change paragraph order to improve readability. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D --Apple-Mail=_B07BDC46-D0EF-4F8C-B58C-49E0D895A976 Content-Disposition: attachment; filename=strings.texi.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="strings.texi.diff" Content-Transfer-Encoding: 7bit diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 1d766869b1..be87fbd2c3 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -279,17 +279,26 @@ expression @var{separators} (@pxref{Regular Expressions}). Each match for @var{separators} defines a splitting point; the substrings between splitting points are made into a list, which is returned. +If @var{separators} is @code{nil} (or omitted), the default is the +value of @code{split-string-default-separators} and @var{omit-nulls} +is forced to @code{t} + If @var{omit-nulls} is @code{nil} (or omitted), the result contains null strings whenever there are two consecutive matches for @var{separators}, or a match is adjacent to the beginning or end of @var{string}. If @var{omit-nulls} is @code{t}, these null strings are omitted from the result. -If @var{separators} is @code{nil} (or omitted), the default is the -value of @code{split-string-default-separators}. +If the optional argument @var{trim} is non-@code{nil}, it should be a +regular expression to match text to trim from the beginning and end of +each substring. If trimming makes the substring empty, it is treated +as null. + +If you need to split a string into a list of individual command-line +arguments suitable for @code{call-process} or @code{start-process}, +see @ref{Shell Arguments, split-string-and-unquote}. -As a special case, when @var{separators} is @code{nil} (or omitted), -null strings are always omitted from the result. Thus: +Examples: @example (split-string " two words ") @@ -306,8 +315,6 @@ useful. If you need such a result, use an explicit value for @result{} ("" "two" "words" "") @end example -More examples: - @example (split-string "Soup is good food" "o") @result{} ("S" "up is g" "" "d f" "" "d") @@ -354,15 +361,6 @@ practice: (split-string "ooo" "\\|o+" t) @result{} ("o" "o" "o") @end example - -If the optional argument @var{trim} is non-@code{nil}, it should be a -regular expression to match text to trim from the beginning and end of -each substring. If trimming makes the substring empty, it is treated -as null. - -If you need to split a string into a list of individual command-line -arguments suitable for @code{call-process} or @code{start-process}, -see @ref{Shell Arguments, split-string-and-unquote}. @end defun @defvar split-string-default-separators --Apple-Mail=_B07BDC46-D0EF-4F8C-B58C-49E0D895A976--