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.devel Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Date: Mon, 8 May 2017 11:40:33 +0900 Message-ID: References: <87vapij1l7.fsf@holos> <6870A2B6-F685-4955-9C0A-256601DB47BC@gmail.com> <51D5E92C-F125-4ADE-8C55-E3513C00ECDC@gmail.com> <8F6958D6-3E13-4C31-B1F8-AF10A8FC8FC6@gmail.com> <838tmafigi.fsf@gnu.org> <7C79DA34-96F2-4D9F-9E9C-01574AE00F12@gmail.com> <8360hefepp.fsf@gnu.org> <0E129E02-FA64-4664-825B-8854A66CA9C6@gmail.com> <3D0BA0E6-02E2-4E90-8A59-121065547E1C@gmail.com> <87ziepho0q.fsf@gnu.org> <83vapderm3.fsf@gnu.org> <87vapdhi9j.fsf@gnu.org> <83tw4xeorf.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494211253 30538 195.159.176.226 (8 May 2017 02:40:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 May 2017 02:40:53 +0000 (UTC) Cc: mvoteiza@udel.edu, emacs-devel@gnu.org, =?utf-8?Q?Johan_Bockg=C3=A5rd?= , tino.calancha@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 08 04:40:49 2017 Return-path: Envelope-to: ged-emacs-devel@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 1d7YbQ-0007qO-8N for ged-emacs-devel@m.gmane.org; Mon, 08 May 2017 04:40:48 +0200 Original-Received: from localhost ([::1]:57372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7YbU-0004Ko-B0 for ged-emacs-devel@m.gmane.org; Sun, 07 May 2017 22:40:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7YbO-0004KW-Hm for emacs-devel@gnu.org; Sun, 07 May 2017 22:40:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7YbN-0000yl-Na for emacs-devel@gnu.org; Sun, 07 May 2017 22:40:46 -0400 Original-Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:34862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7YbH-0000x4-OY; Sun, 07 May 2017 22:40:39 -0400 Original-Received: by mail-pg0-x241.google.com with SMTP id i63so8518213pgd.2; Sun, 07 May 2017 19:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gsztf1Z0aaxnhrpwkMDhPFt+NwuG907UJpDMJC1FNI0=; b=IipvgNxgyv7dEwtw4n72iMCdxxFSUHRUMN7a753R19eD9O7jMeT+m8LIdigIcc3vlQ 2mY42x7bOgHftb8br/jLW8X5nU+UkFISSAN+pr2W3CIRTXoVhg+hwmswH/Yim12uvC7X OvZ1jMvoo2UXtwlLQ5rAxKprNyezu1EMCvJnLhihs4tHqe0M/whMc2ZweQgaUTnDjQ4f 46dvacRyo1k1oM8W9uyA/8WCoRMSy5100H+ZhUiBTObJGwZVTkf2EyQZFtE86ZEPOG6/ cKDzaC4objjg2Hoj4/jj2Hs1M88MimyVqcGFHwZmnfBuXCoKALqcz/f/TML1BcnrV0c+ Oz0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gsztf1Z0aaxnhrpwkMDhPFt+NwuG907UJpDMJC1FNI0=; b=OdEtdEqwy4q6zmUv98aikPv0A7dsMw5xZkFkoN8Y7CiGNHRq6w9pSwTrd9Ib0eql94 fgEjLDz3RR/INoF3VJuV3Qz3B4cEZ53rHvqOyulyeON+rMh07jCecP8mZ/k3bSgfwn7z RVthhKuwHfS/c5GnMlbpf0PvCFM4BcLbNoJcXRCEo5mgqeToYCYvugMWaM9I4bpJaxkW w4U8Yr8OGMEyMR34isjpYFpEmLkUda3rrAJ7SXXFWkpRJnB5icVagytc67Hd2ToI0Re7 gML1jQNL1N8rPMDSTBdTQqIJWXWtij87xAvVZu1L7QKqgWyfN0PeIGb1TkE8Kv6iVyAz HhOg== X-Gm-Message-State: AN3rC/6k++PG4cJGrvsB9SXWjfBLNHdik8N75WUTtMbRbjUL2+Bublli YHV51MdZBLIZXA== X-Received: by 10.99.127.80 with SMTP id p16mr15708372pgn.180.1494211238165; Sun, 07 May 2017 19:40: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 a24sm18163492pfl.70.2017.05.07.19.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 May 2017 19:40:37 -0700 (PDT) In-Reply-To: <83tw4xeorf.fsf@gnu.org> X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:214688 Archived-At: I'm sorry, my only use for groupings was for recording a regexp and = referring to it later, so I pretty sure I don't understand what you = discuss here. But I'd like to... > On May 7, 2017, at 5:03, Eli Zaretskii wrote: >=20 >>>> I think regexp should be surrounded by a grouping construct, like: >>>>=20 >>>> (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") >>>>=20 >>>> And similarly for string-trim-right. >>>=20 >>> Rationale? >>=20 >> regexp can contain \| >=20 > Shouldn't such a regexp be surrounded by "\\(..\\)"? So you both agree that the regexp should be surrounded by a grouping = construct but you're arguing whether it should be a "normal" grouping or = a shy grouping ? Also, >> This code performs string concatenation on a perfectly valid regexp >> provided by the caller. IMO, it is this code's responsibility that = the >> result is sensible after the concatenation. >>=20 >> Are you saying this should be the caller's duty? >=20 > I'm _asking_ whether it should be the caller's duty. How does that relate to the "shy" vs "non-shy" thing above? Jean-Christophe=20=