unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines
       [not found] ` <20220430105728.52694C0631B@vcs2.savannah.gnu.org>
@ 2022-04-30 13:00   ` Andreas Schwab
  2022-04-30 13:29     ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2022-04-30 13:00 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

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.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines
  2022-04-30 13:00   ` master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines Andreas Schwab
@ 2022-04-30 13:29     ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2022-04-30 13:29 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: larsi, emacs-devel

> 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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-30 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <165131624741.1244.15268609038476764727@vcs2.savannah.gnu.org>
     [not found] ` <20220430105728.52694C0631B@vcs2.savannah.gnu.org>
2022-04-30 13:00   ` master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines Andreas Schwab
2022-04-30 13:29     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).