From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: Proposed enhancement for `split-string' Date: Fri, 18 Jul 2014 15:24:00 +0300 Message-ID: References: <7025b422-78b5-4b17-b199-70cbb1f6de93@default> <87zjgbcwtt.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="53c911e0_2443a858_daeb" X-Trace: ger.gmane.org 1405686269 22185 80.91.229.3 (18 Jul 2014 12:24:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2014 12:24:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Stephen J. Turnbull" , Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 18 14:24:20 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 1X87D1-0004qo-6m for ged-emacs-devel@m.gmane.org; Fri, 18 Jul 2014 14:24:19 +0200 Original-Received: from localhost ([::1]:49564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X87D0-0008LP-PR for ged-emacs-devel@m.gmane.org; Fri, 18 Jul 2014 08:24:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X87Cs-0008ET-PQ for emacs-devel@gnu.org; Fri, 18 Jul 2014 08:24:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X87Cn-0007tn-B1 for emacs-devel@gnu.org; Fri, 18 Jul 2014 08:24:10 -0400 Original-Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:58705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X87Cm-0007td-W0 for emacs-devel@gnu.org; Fri, 18 Jul 2014 08:24:05 -0400 Original-Received: by mail-wi0-f169.google.com with SMTP id n3so1083650wiv.0 for ; Fri, 18 Jul 2014 05:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=bndshDssKUNkmQSs+qD1+L7vJAvf3kUeOibxouLgMCQ=; b=p4YFO4KSTbxJ+3ooM9pvzeNU2eeAMgzWrWK/lQY3FlqoU7/nOgKp5QoYLEiSWe8QnV jh5W2BcFSpKvwUfhGQnQy6OLsU76UsYIgXOz5duR+zpmdkxxiTRfpSwcbamNJG8iWsv/ Eze1EGVG6b8c1IZQKKtP0LxzvBYH6MBwlMMQ5fzavpEgKKxRZz/yuchO2xZa8pusKGXS mB8fFIt+w9dRGB126afue129N9Bg6/DTVVvgQ9ebn3KPy+Dk3o2PmLVwnhqnGgpCex+F azoS+iUUrkbtHpq8M3haKlRTJIcWaaWVFls3PIEn/AjrN/L5EdrmussYCCfZO8hDWJ7H PObQ== X-Received: by 10.194.71.52 with SMTP id r20mr5855725wju.113.1405686243874; Fri, 18 Jul 2014 05:24:03 -0700 (PDT) Original-Received: from Bozhidars-MacBook-Pro.local ([95.87.231.111]) by mx.google.com with ESMTPSA id ey16sm6185097wid.14.2014.07.18.05.24.02 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 05:24:03 -0700 (PDT) In-Reply-To: <87zjgbcwtt.fsf@uwakimon.sk.tsukuba.ac.jp> X-Mailer: Airmail (237) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 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:173054 Archived-At: --53c911e0_2443a858_daeb Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Drew=E2=80=99s suggestion can be implemented a different function in subr= -x I guess. =E2=80=94 Cheers,=C2=A0 Bozhidar On July 15, 2014 at 3:04:48 AM, Stephen J. Turnbull (stephen=40xemacs.org= ) wrote: Drew Adams writes: =20 > The second arg, HOW, can be a regexp, giving the same behavior as now. = =20 > Alternatively, HOW can be (1) a character predicate or (2) a doubleton = =20 > plist (PROPERTY VALUE), where PROPERTY is a text property and VALUE is = =20 > one of its possible values. =20 Why not just allow it to be any function returning an interval (with =20 implicit argument =3D (point)), and provide appropriate functions to =20 accomplish the tasks you propose=3F =20 > By providing non-nil TEST you can test, for example: =20 > =20 > * Whether the actual value of text property =60invisible' belongs to th= e =20 > current =60buffer-invisibility-spec'. =20 > =20 > * Whether a particular face is among the faces that are the value of =20 > property =60face'. =20 A general predicate for HOW could do this, too. =20 > Non-nil optional arg =46LIP simply swaps the separators and the kept =20 > substrings - regardless of HOW the separating is defined. =20 This can be done for the =22standard=22 functions by providing an optiona= l =20 =46LIP argument, and using (lambda () (how-func 'flip-me)) as the HOW. =20 Alternatively you could provide flipped standard HOW functions. =20 I have no objection to a new function =60split-string-=C3=A0-la-drew' wit= h =20 any signature you like, but =60split-string' should keep as simple a =20 signature as possible. =20 --53c911e0_2443a858_daeb Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline