[Top][All Lists]

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

Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification

From: Jean-Christophe Helary
Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification
Date: Mon, 8 May 2017 11:40:33 +0900

I'm sorry, my only use for groupings was for recording a regexp and referring 
to it later, so I pretty sure I don't understand what you discuss here. But I'd 
like to...

> On May 7, 2017, at 5:03, Eli Zaretskii <address@hidden> wrote:
>>>> I think regexp should be surrounded by a grouping construct, like:
>>>>   (concat "\\`\\(?:" (or  regexp "[ \t\n\r]+") "\\)")
>>>> And similarly for string-trim-right.
>>> Rationale?
>> regexp can contain \|
> Shouldn't such a regexp be surrounded by "\\(..\\)"?

So you both agree that the regexp should be surrounded by a grouping construct 
but you're arguing whether it should be a "normal" grouping or a shy grouping ?


>> This code performs string concatenation on a perfectly valid regexp
>> provided by the caller. IMO, it is this code's responsibility that the
>> result is sensible after the concatenation.
>> Are you saying this should be the caller's duty?
> I'm _asking_ whether it should be the caller's duty.

How does that relate to the "shy" vs "non-shy" thing above?


reply via email to

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