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: Drew Adams
Subject: RE: Add some aliases for re-related functions
Date: Sat, 2 May 2020 15:44:23 -0700 (PDT)

> > replace-regexp-in-string    re-replace-in-string
> LGTM.
> 
> > replace-match                       re-replace-match
> Maybe this can be shortened to `re-replace`?
> 
> > string-match                        re-search-in-string
> > string-match-p              re-match-in-string-p
> Hmm... a bit long for my taste.  How 'bout `re-search(-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
> How 'bout `re-submatch(-no-properties|beg|end)`?
> 
> > looking-at                  re-match-after-point
> > looking-back                        re-match-before-point
> [ I'm trying to use "search" and "match" in the way it's used in
>   traditional regexp libraries.  ]
> `re-match` and `re-match-back`?
> 
> The problem with this is that I proposed `re-search` to apply to
> strings whereas I now propose `re-match` to apply to buffers.  So maybe it
> should be `re-match-forward` and `re-match-backward`?
> 
> OTOH I really want to discourage the use of `looking-back` because it's
> a inefficient hack with a weird semantics, so giving it a name
> symmetric to that of `looking-at` is a bad idea.
> 
> > posix-              re-posix-
> Sounds good, but it should also follow the renaming of the non-posix
> version of the function.

I really cannot wait till you get to renaming
functions concerning lines: `line-...' or
perhaps `lines-...'.  And their aliases...

keep-lines                -> lines-keep-re?
                             lines-re-keep?
                             re-lines-keep?
                             re-keep-lines?
delete-non-matching-lines -> lines-delete-re-non-matching?
                             lines-re-delete-non-matching?
                             re-lines-delete-non-matching?
                             re-delete-non-matching-lines?
flush-lines               -> lines-flush-re?
                             lines-re-flush?
                             re-lines-flush?
                             re-flush-lines?
delete-matching-lines     -> lines-delete-re-matching?
                             lines-re-delete-matching?
                             re-lines-delete-matching?
                             re-delete-matching-lines?

There'll truly be no end to this fun.  I can
finally imagine what the expected hoard of new
Emacs developers will be working on.

Are we having fun yet?

;-)



reply via email to

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