From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Add some aliases for re-related functions Date: Sat, 2 May 2020 15:44:23 -0700 (PDT) Message-ID: <29721725-0696-4dcf-b5de-36924a5de259@default> References: <7976B8C1-AFC7-4662-B750-6492EB70C0D5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="130644"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Stefan Monnier , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 03 00:45:08 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jV0se-000XtG-1H for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 00:45:08 +0200 Original-Received: from localhost ([::1]:58308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jV0sc-0002sq-Tp for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 18:45:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV0s3-0002Jx-7c for emacs-devel@gnu.org; Sat, 02 May 2020 18:44:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jV0s2-0003JA-C2 for emacs-devel@gnu.org; Sat, 02 May 2020 18:44:30 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:56872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jV0s1-0003HV-RM for emacs-devel@gnu.org; Sat, 02 May 2020 18:44:30 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 042Mh70o066010; Sat, 2 May 2020 22:44:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=pxItc8soreUAwyUdkLMKdnAP+lO3E+UF4bFtoFf7WdM=; b=L5PFWpWhrZJrFSIKgGnZRhbOpv3HyWuvFmX1t8vXV0qD41boAJMZ5tUUGbj8JrmzmZyk BhLSfwmo9RZnz6k6waP6d+UuGPVdatpfn0s/Bam7P6uT7rCGp1NLbZS0BRGFdSNnUjoI 5Gu/tUdVPnRzomAT4dZ09BxTk/zZf+JJ3znUQZCRii8z86ReIFJelnxiD4QXPnBlaSF/ DfQ+uP3dCiZ0uCkLhZ24Htu0nO4UswtQZzsJ5T595U1fmXoBJ2ydyDLMt6FczXG+c4oZ w7MpwstjNKLcwy+jWpyyAdRcZCOOp0vw3MC/3/fn8AKxHtDvL4RYcRttCEXcmOCz8w5u jw== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 30s0tm1xd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 02 May 2020 22:44:27 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 042MbVwA085951; Sat, 2 May 2020 22:44:27 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 30rwysvfxm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 02 May 2020 22:44:26 +0000 Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 042MiQ9A005109; Sat, 2 May 2020 22:44:26 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4993.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9609 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005020200 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9609 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005020201 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 12:49:53 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248603 Archived-At: > > replace-regexp-in-string=09re-replace-in-string > LGTM. >=20 > > replace-match=09=09=09re-replace-match > Maybe this can be shortened to `re-replace`? >=20 > > string-match=09=09=09re-search-in-string > > string-match-p=09=09re-match-in-string-p > Hmm... a bit long for my taste. How 'bout `re-search(-p)`? >=20 > > match-string=09=09=09re-matched-string > > match-string-no-properties=09re-matched-string-no-properties > > match-beginning=09=09re-match-beginning > > match-end=09=09=09re-match-end > How 'bout `re-submatch(-no-properties|beg|end)`? >=20 > > looking-at=09=09=09re-match-after-point > > looking-back=09=09=09re-match-before-point > [ I'm trying to use "search" and "match" in the way it's used in > traditional regexp libraries. ] > `re-match` and `re-match-back`? >=20 > The problem with this is that I proposed `re-search` to apply to > strings whereas I now propose `re-match` to apply to buffers. So maybe i= t > should be `re-match-forward` and `re-match-backward`? >=20 > OTOH I really want to discourage the use of `looking-back` because it's > a inefficient hack with a weird semantics, so giving it a name > symmetric to that of `looking-at` is a bad idea. >=20 > > posix-=09=09re-posix- > Sounds good, but it should also follow the renaming of the non-posix > version of the function. I really cannot wait till you get to renaming functions concerning lines: `line-...' or perhaps `lines-...'. And their aliases... keep-lines -> lines-keep-re? lines-re-keep? re-lines-keep? re-keep-lines? delete-non-matching-lines -> lines-delete-re-non-matching? lines-re-delete-non-matching? re-lines-delete-non-matching? re-delete-non-matching-lines? flush-lines -> lines-flush-re? lines-re-flush? re-lines-flush? re-flush-lines? delete-matching-lines -> lines-delete-re-matching? lines-re-delete-matching? re-lines-delete-matching? re-delete-matching-lines? There'll truly be no end to this fun. I can finally imagine what the expected hoard of new Emacs developers will be working on. Are we having fun yet? ;-)