GNU bug report logs - #78690
31.0.50; split string: args out of range with TRIM

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Wed, 4 Jun 2025 02:35:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78690 <at> debbugs.gnu.org
Subject: bug#78690: 31.0.50; split string: args out of range with TRIM
Date: Thu, 12 Jun 2025 10:42:42 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> > #+begin_src emacs-lisp
> > (let ((text " -*- lexical-binding: t; -*-")
> >       ;;    ^^^ see here
> >       (seps "-\\*-")
> >       (trim "[ \t\n\r-]+"))
> >   (split-string text seps nil trim))
> > #+end_src
> > 
> >   ~~> split-string: Args out of range: " -*- lexical-binding: t; -*-", 2, 1
> > 
> > Could you please have a look?
>
> Thanks.  I guess I've found something similar independently, because
> the changes I have stashed (reproduced below) don't signal an error in
> this case.  With those changes, I get what I think is the expected
> value
>
>   ("" "lexical-binding: t;" "")

> Here's the up-to-date version of the patch:
> [...]

Confirmed - works for me, thank you.

BTW, I tried to follow the code and find it a bit troublesome.  If you
would want to try to give some local variables a bit more meaningful
names where possible, or want to add some very short comments, I would
not be opposed to that.

Michael.




This bug report was last modified 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.