From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master aab5d7b3f3 1/3: Add a KEEP-NEWLINES argument to string-lines Date: Sat, 30 Apr 2022 16:29:37 +0300 Message-ID: <838rrm8zsu.fsf@gnu.org> References: <165131624741.1244.15268609038476764727@vcs2.savannah.gnu.org> <20220430105728.52694C0631B@vcs2.savannah.gnu.org> <8735hu9159.fsf@igel.home> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14878"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 30 15:32:04 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nknCe-0003ff-4x for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 15:32:04 +0200 Original-Received: from localhost ([::1]:43426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nknCc-0007is-Pt for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Apr 2022 09:32:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknAG-0004ct-RI for emacs-devel@gnu.org; Sat, 30 Apr 2022 09:29:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknAF-0006CV-N7; Sat, 30 Apr 2022 09:29:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=d+s5rje9hyIdMnbfBRITq3CAW2Pg/2AV5FDzgXQGIOo=; b=bUfylewxjJJf 4yfsjOsixI2n3K5PA7ACZM73ADR0c+v3dbaVbN8VA43YEtSIGRCHgr22j+xFctCJY4dS2GYkp1RII BQqIkC4UWIP39zUBj4dpTlR6+jxx76GhOAzdY2Oa6n9NLJ3HngiyLNe/o+e3BLDbRLKFFCo/Nm04L pHOwQ0NXG84WqZDFca3ZvBaSf++VFNs7i7FpTH3VHicxdxJxBWFT5BMsc01EUum2BiUNjl23pJVAE 4xlMXynNNUOZjozqrxq2sztCsorjm/SItyz61cgiNzCQJbw4eaQ+za2CSvCK6zE5ST9CpPMxZ3v5m K4kVpVAxUxbgSD1p+3nazA==; Original-Received: from [87.69.77.57] (port=4725 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknAE-0004hG-6E; Sat, 30 Apr 2022 09:29:35 -0400 In-Reply-To: <8735hu9159.fsf@igel.home> (message from Andreas Schwab on Sat, 30 Apr 2022 15:00:34 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289054 Archived-At: > From: Andreas Schwab > Date: Sat, 30 Apr 2022 15:00:34 +0200 > 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. Yes, I've just seen this as well, and reported as a bug. Thanks.