From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Add some aliases for re-related functions Date: Sat, 2 May 2020 15:48:34 -0400 Message-ID: <7ABED17F-513E-4EF0-AF63-B8B58BB856D0@gmail.com> References: <7976B8C1-AFC7-4662-B750-6492EB70C0D5@gmail.com> <20200502192908.GD6832@ACM> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_D76EB94F-16B7-4A04-BAB9-76B21D251DBB" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="64220"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 21:49:31 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 1jUy8g-000Gcx-LQ for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 21:49:30 +0200 Original-Received: from localhost ([::1]:54806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUy8f-0006qv-O0 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 15:49:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUy7r-0006Nv-5w for emacs-devel@gnu.org; Sat, 02 May 2020 15:48:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUy7p-0006xP-U2 for emacs-devel@gnu.org; Sat, 02 May 2020 15:48:38 -0400 Original-Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]:45905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUy7p-0006vH-FJ for emacs-devel@gnu.org; Sat, 02 May 2020 15:48:37 -0400 Original-Received: by mail-qt1-x82c.google.com with SMTP id 71so10679710qtc.12 for ; Sat, 02 May 2020 12:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=6oxym6GjXnwNJ+p6uGw6t4ejQyipQk0T6ySp0oVTzeQ=; b=MaAjetZwLpGTg97SmtNmZS6or8tB5+DLVdKT4fo98OwZm0jynHDPq5/TD4lsa56Rrv dWlTiy9SQwWeeqwtUsXWYWvK46vXTYlaGZ4Q2EY/L48RiwCc/9ErxRLlq7QcKC/h0Wlj wqdXv3kcyIlK/Y1jP+E0GAgvy7xFgUv1OjZQNbB+qRdhOIu3SiFEgXFsARDE703ZDRWo CauDDretscYpVyziyLoYb+FSKo4/qlG6VBNuLS/ilQg33uqJA8fQk4LdGsWmhWqoDGQy Dnl3E02kgSQK7upig1M3KHPXsARvHs73Wo2ZSNTYcwS2KuvNerCoxqsB1bkcUHpDXw1y M1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=6oxym6GjXnwNJ+p6uGw6t4ejQyipQk0T6ySp0oVTzeQ=; b=Qt6fbSmeyx8GEVHr07jSI3b6FrJ00ACeC8DibCtfHf28iFqMICb9aTAjHAtfaiUMyL M7pOvSv/DVmOFkMP7w22VOEGkN+QUTSh5tCiW85jF5PnaChm3/GHYEH7ox35t814BBNT cob+lyIzXdepyG2R9M5oO6P1n+XDvQKCi8nDZL3SS/oNHPnXGSh8qaNPcDve8/0Tpu7H 8J1jpZuy90J4AnYa8aUmO5tALYMyFWhKlLbthrDt59nP1fW1xoRnYvn1NXzW8xUqGHdA UaY66N24R4s3mAF2+IMCV48bS5T+T7Se7A1qe1ZDrkM8RYR2EJ+PTP0a4nt77iIqOVPR sRfw== X-Gm-Message-State: AGi0PuZb2x520ycs6c74JxI0R51sxanTdqooghTTDUZrw2vNf3KclHSz YTVgFz1V8xTfSwXbx5f/qybeM5/zWlV4MOyS X-Google-Smtp-Source: APiQypL8v/gDgATWcDxU+r/F//jHoGietpmE5D//Bf8HjP8YrsWsR72Je7HVvX2Z8NEZ13H/DZXh6g== X-Received: by 2002:ac8:6d3b:: with SMTP id r27mr10310091qtu.55.1588448916031; Sat, 02 May 2020 12:48:36 -0700 (PDT) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id v27sm6461391qtb.35.2020.05.02.12.48.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 May 2020 12:48:35 -0700 (PDT) In-Reply-To: <20200502192908.GD6832@ACM> X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::82c; envelope-from=casouri@gmail.com; helo=mail-qt1-x82c.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::82c 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:248555 Archived-At: --Apple-Mail=_D76EB94F-16B7-4A04-BAB9-76B21D251DBB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 2, 2020, at 3:29 PM, Alan Mackenzie wrote: >=20 > Hello, Yuan. >=20 > On Sat, May 02, 2020 at 14:28:08 -0400, Yuan Fu wrote: >> While debating whether it=E2=80=99s effective to add prefixes to = increase >> discoverability, lets start with incremental and uncontroversial >> changes. >=20 > Ha! No chance! ;-( >=20 > I don't believe these proposed changes will increase discoverability = to > any important extent. More importantly, they will decrease the > usability of these functions, as they will be more of a hassle to type > in and (more importantly) make the functions they are in more = difficult > to read. >=20 >> Let=E2=80=99s start from re-related functions since it seems that = many people >> agree on this. Here is a list of functions that I think could benefit >> from an alias.=20 >=20 >> replace-regexp-in-string re-replace-in-string >> replace-match re-replace-match >> string-match re-search-in-string >> string-match-p re-match-in-string-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 >=20 >> looking-at re-match-after-point >> looking-back re-match-before-point >> looking-at-p re-match-after-point-p >> posix-search-forward re-posix-search-forward >> posix-search-backward re-posix-search-backward >> posix-looking-at re-posix-looking-at >> posix-search-in-string re-posix-search-in-string >=20 >> Let=E2=80=99s do it like this: if you don=E2=80=99t like adding alias = to a certain >> function (strongly), call it out and we will remove it from the list >> for now. >=20 > I strongly object to those aliases which make the function name = longer. > I particularly object to `re-match-after-point' for `looking-at'. Not > only is it much longer, it lacks the instant readibility of = looking-at, > and the slightly humorous notion of "looking", as though with ones = eyes. > I particularly object to `re-matched-string', which has double the > number of syllables in it as the original. >=20 > As a small point, you've erased the commonality between > match-beginning/end and match-string. This is a bad thing. >=20 >> Then we should have a small list that everybody agrees upon (or at >> least no one absolutely hates).=20 >=20 > I hate your list. ;-) (Nothing personal in that.) >=20 >> And please do not drift the topic away in this thread, which hinders >> the original purpose of the thread. Let=E2=80=99s focus on these = functions and >> only these functions. >=20 > As long as people do not take for granted that introducing lots of > aliases is a good thing. I believe it is not. >=20 >> Yuan >=20 > --=20 > Alan Mackenzie (Nuremberg, Germany). That=E2=80=99s ok. I guess my plan failed.=20 Yuan= --Apple-Mail=_D76EB94F-16B7-4A04-BAB9-76B21D251DBB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On May 2, 2020, at 3:29 PM, Alan Mackenzie <acm@muc.de> wrote:

Hello, = Yuan.

On Sat, May 02, 2020 at 14:28:08 -0400, Yuan Fu = wrote:
While = debating whether it=E2=80=99s effective to add prefixes to increase
discoverability, lets start with incremental and = uncontroversial
changes.

Ha!  No chance!  ;-(

I don't believe these proposed changes will increase = discoverability to
any important extent.  More importantly, they will = decrease the
usability of these functions, as they will be more of a = hassle to type
in and (more importantly) make the functions they are in more = difficult
to read.

Let=E2=80= =99s start from re-related functions since it seems that many people
agree on this. Here is a list of functions that I think could = benefit
from an alias. 

replace-regexp-in-string re-replace-in-string
replace-match re-replace-match
string-match re-search-in-string
string-match-p re-match-in-string-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

looking-at = re-match-after-point
looking-back = re-match-before-point
looking-at-p = re-match-after-point-p
posix-search-forward = re-posix-search-forward
posix-search-backward = re-posix-search-backward
posix-looking-at = re-posix-looking-at
posix-search-in-string = re-posix-search-in-string

Let=E2=80=99s do it like this: if you = don=E2=80=99t like adding alias to a certain
function = (strongly), call it out and we will remove it from the list
for now.

I strongly = object to those aliases which make the function name longer.
I particularly object to `re-match-after-point' for = `looking-at'.  Not
only is it much longer, it lacks the instant readibility of = looking-at,
and the slightly humorous notion of "looking", as though with = ones eyes.
I particularly object to `re-matched-string', which has = double the
number of syllables in it as the original.

As a small point, you've erased the commonality = between
match-beginning/end and match-string.  This is a bad = thing.

Then = we should have a small list that everybody agrees upon (or at
least no one absolutely hates). 

I hate your list.  ;-)  (Nothing personal in = that.)

And = please do not drift the topic away in this thread, which hinders
the original purpose of the thread. Let=E2=80=99s focus on = these functions and
only these functions.

As long as people do not take for granted that introducing = lots of
aliases is a good thing.  I believe it is not.

Yuan

-- Alan Mackenzie (Nuremberg, = Germany).

That=E2=80=99s ok. I guess my plan failed. 

Yuan
= --Apple-Mail=_D76EB94F-16B7-4A04-BAB9-76B21D251DBB--