emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add some aliases for re-related functions


From: Philippe Vaucher
Subject: Re: Add some aliases for re-related functions
Date: Sat, 2 May 2020 23:51:13 +0200

> > 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".
 
> 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 :-)
 
> 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? 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.
 
> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]