From: Alan Mackenzie <acm@muc.de>
To: Philippe Vaucher <philippe.vaucher@gmail.com>
Cc: Yuan Fu <casouri@gmail.com>, Emacs developers <emacs-devel@gnu.org>
Subject: Re: Add some aliases for re-related functions
Date: Sun, 3 May 2020 09:43:42 +0000 [thread overview]
Message-ID: <20200503094342.GA5721@ACM> (raw)
In-Reply-To: <CAGK7Mr6AsmjiVfX+7ycydAkd8nM4niN6m0LPZL4xsyEjHv7dEw@mail.gmail.com>
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).
next prev parent reply other threads:[~2020-05-03 9:43 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 18:28 Add some aliases for re-related functions Yuan Fu
2020-05-02 18:39 ` Eli Zaretskii
2020-05-02 18:43 ` Yuan Fu
2020-05-02 21:21 ` Stefan Monnier
2020-05-02 22:27 ` Drew Adams
2020-05-03 8:33 ` Michael Albinus
2020-05-03 19:07 ` Drew Adams
2020-05-02 19:29 ` Alan Mackenzie
2020-05-02 19:48 ` Yuan Fu
2020-05-02 20:10 ` Philippe Vaucher
2020-05-02 20:13 ` Philippe Vaucher
2020-05-03 14:16 ` Eli Zaretskii
2020-05-04 3:09 ` Richard Stallman
2020-05-04 14:28 ` Eli Zaretskii
2020-05-04 17:12 ` Dmitry Gutov
2020-05-04 17:35 ` Eli Zaretskii
2020-05-04 17:42 ` Dmitry Gutov
2020-05-04 17:46 ` Eli Zaretskii
2020-05-04 17:53 ` Dmitry Gutov
2020-05-02 21:09 ` Alan Mackenzie
2020-05-02 21:51 ` Philippe Vaucher
2020-05-03 9:43 ` Alan Mackenzie [this message]
2020-05-03 15:00 ` 조성빈
2020-05-02 22:41 ` Stefan Monnier
2020-05-03 17:14 ` Alan Mackenzie
2020-05-04 10:07 ` João Távora
2020-05-03 14:16 ` Eli Zaretskii
2020-05-03 16:20 ` Yuri Khan
2020-05-03 16:42 ` Eli Zaretskii
2020-05-03 16:50 ` Dmitry Gutov
2020-05-02 21:33 ` Stefan Monnier
2020-05-02 22:10 ` Dmitry Gutov
2020-05-02 22:18 ` Eric Abrahamsen
2020-05-02 22:49 ` Stefan Monnier
2020-05-02 23:13 ` Dmitry Gutov
2020-05-03 3:55 ` Stefan Monnier
2020-05-04 0:29 ` Dmitry Gutov
2020-05-04 3:11 ` Stefan Monnier
2020-05-02 22:44 ` Drew Adams
2020-05-03 3:26 ` Stefan Monnier
2020-05-03 4:37 ` Drew Adams
2020-05-03 8:05 ` Philippe Vaucher
2020-05-03 9:55 ` Alan Mackenzie
2020-05-03 10:26 ` tomas
2020-05-03 15:15 ` Eli Zaretskii
2020-05-03 19:47 ` Drew Adams
2020-05-04 7:32 ` Philippe Vaucher
2020-05-04 8:20 ` Sending plaintext with Gmail (was: Add some aliases for re-related functions) Kévin Le Gouguec
2020-05-04 8:45 ` Philippe Vaucher
2020-05-04 15:09 ` Sending plaintext with Gmail Stefan Monnier
2020-05-04 15:25 ` Kévin Le Gouguec
2020-05-04 15:29 ` Lars Ingebrigtsen
2020-05-05 8:13 ` HTML display in Gnus (was: Sending plaintext with Gmail) Kévin Le Gouguec
2020-05-05 8:24 ` HTML display in Gnus Lars Ingebrigtsen
2020-05-05 9:26 ` Kévin Le Gouguec
2020-07-17 17:14 ` Kévin Le Gouguec
2020-05-04 15:39 ` Sending plaintext with Gmail Andreas Schwab
2020-05-04 16:51 ` Add some aliases for re-related functions Drew Adams
2020-05-04 17:10 ` Drew Adams
2020-05-04 18:17 ` Philippe Vaucher
2020-05-04 18:33 ` Drew Adams
2020-05-05 2:48 ` Richard Stallman
2020-05-04 3:08 ` Richard Stallman
2020-05-04 10:16 ` João Távora
2020-05-04 3:04 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200503094342.GA5721@ACM \
--to=acm@muc.de \
--cc=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=philippe.vaucher@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).