From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Add some aliases for re-related functions Date: Sat, 02 May 2020 17:33:27 -0400 Message-ID: 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="104701"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Emacs developers To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 23:34:10 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 1jUzly-000R95-5T for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 23:34:10 +0200 Original-Received: from localhost ([::1]:39858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUzlx-0007ro-4y for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 17:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUzlN-0007T0-7e for emacs-devel@gnu.org; Sat, 02 May 2020 17:33:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUzlM-0004Sf-BT for emacs-devel@gnu.org; Sat, 02 May 2020 17:33:32 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUzlL-0004QX-TK for emacs-devel@gnu.org; Sat, 02 May 2020 17:33:32 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C1023100F40; Sat, 2 May 2020 17:33:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 249FF100978; Sat, 2 May 2020 17:33:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1588455209; bh=wKqK2oh2eYsxZ78fh0DCyjaPkitHsYg7YqF5JoJeXqg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Vp3dRgRBswkadSDbqgOlbGiPQlHMhuPXCaUrQSmyeaKCFLxZJiG9k0QBOc3uwGoP9 nCdj/+QojS6y8WkSsbczousAd9FO7IDxkJhMrp2hQVGcwbo5Om0nOlij82lIoxaA62 D4i6khcIzS/liBxQDh2MxSehfMuQWXtIIP83eP/88vZeMlPDGkcl7pl/VCTh61zaQd iwWbqlws0bTAYN0I1+AUeE4DCbOiePIhZnfpsQ2ZoKT0jUAgT/7S7GPJ+qv2Ysj1Bf H5XWBS1TKKMCNDKnsuhVXfRzL+chXgFxifttQOjqUJr9A17KpdEWCywRdjxgdm9abX cwLse4wOHXlJw== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AF2DB1202FF; Sat, 2 May 2020 17:33:28 -0400 (EDT) In-Reply-To: <7976B8C1-AFC7-4662-B750-6492EB70C0D5@gmail.com> (Yuan Fu's message of "Sat, 2 May 2020 14:28:08 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 16:40:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:248587 Archived-At: > While debating whether it=E2=80=99s effective to add prefixes to increase > discoverability, lets start with incremental and uncontroversial > changes. Let=E2=80=99s start from re-related functions since it seems tha= t many > people agree on this. Here is a list of functions that I think could bene= fit > from an alias.=20 I don't have an opinion on the "re-" vs "regexp-" prefix, so I'll concentrate on the non-prefix part, where the problem is to try and keep things short. > replace-regexp-in-string re-replace-in-string LGTM. > replace-match re-replace-match Maybe this can be shortened to `re-replace`? > string-match re-search-in-string > string-match-p re-match-in-string-p Hmm... a bit long for my taste. How 'bout `re-search(-p)`? > match-string re-matched-string > match-string-no-properties re-matched-string-no-properties > match-beginning re-match-beginning > match-end re-match-end How 'bout `re-submatch(-no-properties|beg|end)`? > looking-at re-match-after-point > looking-back re-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`? 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 it should be `re-match-forward` and `re-match-backward`? 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. > posix- re-posix- Sounds good, but it should also follow the renaming of the non-posix version of the function. Stefan