emacs-devel
[Top][All Lists]
Advanced

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

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


From: Eli Zaretskii
Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification
Date: Mon, 08 May 2017 17:28:36 +0300

> From: Jean-Christophe Helary <address@hidden>
> Date: Mon, 8 May 2017 11:40:33 +0900
> Cc: Johan Bockgård <address@hidden>,
>  address@hidden,
>  address@hidden,
>  address@hidden
> 
> >>>> 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 ?

No, the issue is whether the function should enclose the argument in a
grouping constructs of any kind, or should this be the caller's
responsibility when the regexp includes \|.

> > I'm _asking_ whether it should be the caller's duty.
> 
> How does that relate to the "shy" vs "non-shy" thing above?

It doesn't.



reply via email to

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