[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: Tue, 9 May 2017 22:09:00 +0900

> On May 9, 2017, at 21:05, Michael Heerdegen <address@hidden> wrote:
> Jean-Christophe Helary <address@hidden> writes:
>>>   (split-string "abc, ;def g,hi" nil nil ",\\|;")
>>>   =>
>>>     ("abc" "def" "g")  ; BUG
>> Ok, and the way to get your result is:
>> (split-string "abc, ;def g,hi" nil nil "\\(,\\|;\\)")
>> which means that Emacs thinks it is the caller's duty to provide the
>> grouping construct, which also happens to be ugly, and non-intuitive
>> since ",\\|;" is an otherwise valid regexp...
>> So, how do we go about that? Do we report a bug? Or do we find a good
>> reason for that to happen and modify the documentation for
>> split-string ?
> I'm curious what could be reasons not to fix this (in the code).

Because split-string is used all over the place in Emacs and we'd have to check 
that the fix is not breaking some code somewhere in ways that we can't always 

> Allowing only a subset of possible regexps would be quite strange.

Not if you document the strangeness.

> Would there be any advantages?

Not having to modify a lot of other places in the Emacs code.


reply via email to

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