all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: emacs-devel@gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines
Date: Sat, 30 Apr 2022 15:00:34 +0200	[thread overview]
Message-ID: <8735hu9159.fsf@igel.home> (raw)
In-Reply-To: <20220430105728.52694C0631B@vcs2.savannah.gnu.org> (Lars Ingebrigtsen's message of "Sat, 30 Apr 2022 06:57:28 -0400 (EDT)")

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



       reply	other threads:[~2022-04-30 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165131624741.1244.15268609038476764727@vcs2.savannah.gnu.org>
     [not found] ` <20220430105728.52694C0631B@vcs2.savannah.gnu.org>
2022-04-30 13:00   ` Andreas Schwab [this message]
2022-04-30 13:29     ` master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735hu9159.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.