From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Proposed enhancement for `split-string' Date: Tue, 15 Jul 2014 09:03:26 +0900 Message-ID: <87zjgbcwtt.fsf@uwakimon.sk.tsukuba.ac.jp> References: <7025b422-78b5-4b17-b199-70cbb1f6de93@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1405382680 6357 80.91.229.3 (15 Jul 2014 00:04:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jul 2014 00:04:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 15 02:04:33 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X6qER-0006X6-Gf for ged-emacs-devel@m.gmane.org; Tue, 15 Jul 2014 02:04:31 +0200 Original-Received: from localhost ([::1]:60629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6qER-0003Lh-3r for ged-emacs-devel@m.gmane.org; Mon, 14 Jul 2014 20:04:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6qEH-0003LX-IE for emacs-devel@gnu.org; Mon, 14 Jul 2014 20:04:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6qEA-0006aJ-3F for emacs-devel@gnu.org; Mon, 14 Jul 2014 20:04:21 -0400 Original-Received: from mgmt1.sk.tsukuba.ac.jp ([130.158.97.223]:49048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6qE9-0005yS-IZ for emacs-devel@gnu.org; Mon, 14 Jul 2014 20:04:13 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt1.sk.tsukuba.ac.jp (Postfix) with ESMTP id 7D0913FA0B3C; Tue, 15 Jul 2014 09:03:26 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 6D2301A2F0A; Tue, 15 Jul 2014 09:03:26 +0900 (JST) In-Reply-To: <7025b422-78b5-4b17-b199-70cbb1f6de93@default> X-Mailer: VM undefined under 21.5 (beta34) "kale" acf1c26e3019 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 130.158.97.223 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173028 Archived-At: Drew Adams writes: > The second arg, HOW, can be a regexp, giving the same behavior as now. > Alternatively, HOW can be (1) a character predicate or (2) a doubleton > plist (PROPERTY VALUE), where PROPERTY is a text property and VALUE is > one of its possible values. Why not just allow it to be any function returning an interval (with implicit argument =3D (point)), and provide appropriate functions to accomplish the tasks you propose? > By providing non-nil TEST you can test, for example: >=20 > * Whether the actual value of text property `invisible' belongs to the > current `buffer-invisibility-spec'. >=20 > * Whether a particular face is among the faces that are the value of > property `face'. A general predicate for HOW could do this, too. > Non-nil optional arg FLIP simply swaps the separators and the kept > substrings - regardless of HOW the separating is defined. This can be done for the "standard" functions by providing an optional FLIP argument, and using (lambda () (how-func 'flip-me)) as the HOW. Alternatively you could provide flipped standard HOW functions. I have no objection to a new function `split-string-=C3=A0-la-drew' with any signature you like, but `split-string' should keep as simple a signature as possible.