emacs-devel
[Top][All Lists]
Advanced

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

Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines


From: Eli Zaretskii
Subject: Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines
Date: Sat, 30 Apr 2022 16:29:37 +0300

> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sat, 30 Apr 2022 15:00:34 +0200
> Cc: Lars Ingebrigtsen <larsi@gnus.org>
> 
> On Apr 30 2022, Lars Ingebrigtsen wrote:
> 
> > diff --git a/lisp/subr.el b/lisp/subr.el
> > index 9623ea63b5..14cab04d42 100644
> > --- a/lisp/subr.el
> > +++ b/lisp/subr.el
> > @@ -6646,10 +6646,36 @@ is inserted before adjusting the number of empty 
> > lines."
> >       ((< (- (point) start) lines)
> >        (insert (make-string (- lines (- (point) start)) ?\n))))))
> >  
> > -(defun string-lines (string &optional omit-nulls)
> > +(defun string-lines (string &optional omit-nulls keep-newlines)
> >    "Split STRING into a list of lines.
> > -If OMIT-NULLS, empty lines will be removed from the results."
> > -  (split-string string "\n" omit-nulls))
> > +If OMIT-NULLS, empty lines will be removed from the results.
> > +If KEEP-NEWLINES, don't strip trailing newlines from the result
> > +lines."
> > +  (let ((lines nil)
> > +        (start 0))
> > +    (while (< start (length string))
> > +      (if-let ((newline (string-search "\n" string start)))
> 
> That breaks bootstrap.

Yes, I've just seen this as well, and reported as a bug.

Thanks.



reply via email to

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