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: Sun, 3 May 2020 09:43:42 +0000 Message-ID: <20200503094342.GA5721@ACM> References: <7976B8C1-AFC7-4662-B750-6492EB70C0D5@gmail.com> <20200502192908.GD6832@ACM> <20200502210912.GE6832@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="100317"; 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 Sun May 03 11:44:25 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 1jVBAf-000Pzm-3f for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 11:44:25 +0200 Original-Received: from localhost ([::1]:46632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVBAe-00062o-55 for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 05:44:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVBA3-0004sj-Ok for emacs-devel@gnu.org; Sun, 03 May 2020 05:43:47 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:45884 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1jVBA1-000631-DF for emacs-devel@gnu.org; Sun, 03 May 2020 05:43:47 -0400 Original-Received: (qmail 56459 invoked by uid 3782); 3 May 2020 09:43:43 -0000 Original-Received: from acm.muc.de (p2E5D57CC.dip0.t-ipconnect.de [46.93.87.204]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 03 May 2020 11:43:42 +0200 Original-Received: (qmail 5725 invoked by uid 1000); 3 May 2020 09:43:42 -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/03 05:43:43 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:248666 Archived-At: Hello, Philippe. On Sat, May 02, 2020 at 23:51:13 +0200, Philippe Vaucher wrote: > > > Just to be clear, you don't like aliases because if they were to be used > > > you'd hate reading code using them, correct? > > (snip) > > > 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. > I think you misunderstood me there. Literally one sentence ago I said that > you don't like aliases because you'd dislike reading code using them, so I > understood your concern. I also find your definition of "use" a bit > surprising, but ok I note that for you "use" means "write code with that > name as well as read code with that name". In my definition it just means > "write code with that name". It's good to understand what we mean by simple words like "use". It seemed to me like you were regarding the reading of code as a minor unimportant thing. I think reading code (including all the things which require it, such as debugging) is the most important thing we do with code, bar executing it. So, if by "use", you mean just "writing", I'd say that's not of the highest importance. > > 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. > That's indeed a valid concern. That said at the current pace of how things > goes on that topic, I think even if *some* things were to change your code > would still be untouched for at least 20 years :-) The point is that this proposal is so disruptive that ALL code will have to change. And all the documentation. > > 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. > Interesting. Is one of the alias deprecated now? What prevents us from > massively rename every search-forward-regexp to re-search-forward? Nothing. Just we can't get rid of the alias because it will be being used by lots of external code. Aliases are a lot easier to introduce than to get rid of. > I understand it's not your point but I don't understand why this isn't > fixed yet. > > 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. > Same question as above. Same answer. > > I say we shouldn't add to such confusion. > That's an interesting point. At the same time it gives me this impression > that following this logic everything is written in stone forever because > any change would be confusing. Lots of things change continually in Emacs. Mostly, they are sensible amendments which are restricted in scope, and well tried out before hand. This proposal, the wholesale renaming of function names, for what purpose seems to have been forgotten, will overturn decades of history. Yes, `looking-at' should stay looking-at forever, because it is an established name and is a good name. It is not that the proposed change would be "confusing". It is that the change would be bad. Of all the things we do with source code, reading it is the most important. The change would render Emacs less readable. The rationale for this change has got lost in the flurry of bikeshedding. Eli, early on, tried to explore this rationale and come up with less disruptive ways of achieving it. It seems to me entirely possible that somebody decided they wanted to rename Emacs functions, and came up with a justification for it, rather than the other way around. `looking-at' is a far better name than `re-matched-after-point'. Let's just stick with it. -- Alan Mackenzie (Nuremberg, Germany).