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: Sun, 07 May 2017 19:53:01 +0300

> From: Johan Bockgård <address@hidden>
> Cc: address@hidden,  address@hidden,  address@hidden,  address@hidden
> Date: Sun, 07 May 2017 18:23:56 +0200
> 
> Eli Zaretskii <address@hidden> writes:
> 
> >> >> 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 "\\(..\\)"?
> 
> 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.



reply via email to

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