[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: Michael Heerdegen
Subject: Re: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification
Date: Tue, 09 May 2017 14:05:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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).
Allowing only a subset of possible regexps would be quite strange.
Would there be any advantages?


reply via email to

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