From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Add some aliases for re-related functions Date: Sat, 2 May 2020 21:09:12 +0000 Message-ID: <20200502210912.GE6832@ACM> References: <7976B8C1-AFC7-4662-B750-6492EB70C0D5@gmail.com> <20200502192908.GD6832@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23214"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , Emacs developers To: Philippe Vaucher Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 23:15:07 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 1jUzTV-0005pf-Mu for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 23:15:05 +0200 Original-Received: from localhost ([::1]:44070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUzTU-0007Hs-L2 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 17:15:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUzNv-0005w5-Hc for emacs-devel@gnu.org; Sat, 02 May 2020 17:09:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUzNu-0000d6-6S for emacs-devel@gnu.org; Sat, 02 May 2020 17:09:19 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:41893 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1jUzNs-0000bT-Qg for emacs-devel@gnu.org; Sat, 02 May 2020 17:09:17 -0400 Original-Received: (qmail 34037 invoked by uid 3782); 2 May 2020 21:09:14 -0000 Original-Received: from acm.muc.de (p2E5D51F4.dip0.t-ipconnect.de [46.93.81.244]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sat, 02 May 2020 23:09:13 +0200 Original-Received: (qmail 27757 invoked by uid 1000); 2 May 2020 21:09:12 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 15:29:11 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Received-From: 193.149.48.1 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:248576 Archived-At: Hello, Philippe. On Sat, May 02, 2020 at 22:10:29 +0200, Philippe Vaucher wrote: > > On Sat, May 02, 2020 at 14:28:08 -0400, Yuan Fu wrote: > > > While debating whether it’s 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. > Just wanted to explicit that this assume we know both function already. I don't think it does. > If I don't know `posix-search-forward` but know one exists, but cannot > remember if it's regexp-search-posix-forward or posix-regexp-forward or > forward-search-posix, in Yuan's proposal I could "C-h f re- TAB posix > TAB and select "re-posix-search-forward" quickly. In the current Emacs you can type in C-h f *posix and one of the alternatives (there are five) is posix-search-forward. But just how important are such search facilities, really? > Without that I have to C-h d "regexp posix" and curse because it > returns no result (Eli <--- please fix this), then search for C-h d > posix and only then find it. See above. If anything, the number of different ways to search for function names might be considered confusing, but that's a separate matter. > > 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. > Just to be clear, you don't like aliases because if they were to be used > you'd hate reading code using them, correct? I spend a fair amount of time debugging, other people's code as well as my own. If these long aliases get mechanically swapped in (as I presume is the intention), as well as having to decypher the new names, there will be more occasions when a line of code no longer fits within my 78 character wide follow-mode screen. Hassle. Debugging, which is already difficult enough, will get more difficult. > I mean you agree they won't take away your ability to use the old names? This old one! I disagree with you entirely, here. I debug other people's code as well as my own. I'd have to put up with "re-match-after-point" and friends, thus losing the ability to "use" the current names. And there's a good chance some "helpful" person will decide it's time to purge the traditional names from all code, including my code. Anyhow, why not look at existing examples from history? On 1991-07-25, Jim Blandy introduced the alias `search-forward-regexp' for `re-search-forward'. Why? Lost in the mists of time. Possibly for the same reasons people are advancing now - make all the search functions begin with "search-" for supposed easier searching (of their names). In master we currently have 3534 occurences of re-search-forward and 134 of search-forward-regexp. Would anybody here argue that Emacs is the better for these 134 alternatively named function calls? I'd say it was a mistake, and there is nothing positive to offset the confusion. Or `delete-backward-char' and its alias `backward-delete-char'. We have, respectively, 5 and 36 uses. To me, this is just confusion, whatever the original reason was for these aliases. I say we shouldn't add to such confusion. > Philippe -- Alan Mackenzie (Nuremberg, Germany).