From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#53853: [PATCH] Don't use string-replace in flymake Date: Tue, 08 Feb 2022 02:17:44 +0000 Message-ID: References: <87r18e7fb7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40486"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53853@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 08 03:22:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nHG9G-000ANC-F3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 03:22:30 +0100 Original-Received: from localhost ([::1]:42342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHG9E-0004pj-Vi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Feb 2022 21:22:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHG8x-0004pK-Ru for bug-gnu-emacs@gnu.org; Mon, 07 Feb 2022 21:22:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHG8o-0007Hn-RZ for bug-gnu-emacs@gnu.org; Mon, 07 Feb 2022 21:22:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHG8o-0003GE-Hz for bug-gnu-emacs@gnu.org; Mon, 07 Feb 2022 21:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Feb 2022 02:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53853 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53853-submit@debbugs.gnu.org id=B53853.164428687212477 (code B ref 53853); Tue, 08 Feb 2022 02:22:02 +0000 Original-Received: (at 53853) by debbugs.gnu.org; 8 Feb 2022 02:21:12 +0000 Original-Received: from localhost ([127.0.0.1]:44408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHG80-0003FA-37 for submit@debbugs.gnu.org; Mon, 07 Feb 2022 21:21:12 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:38389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHG7w-0003Ei-7x for 53853@debbugs.gnu.org; Mon, 07 Feb 2022 21:21:10 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A6C67240027 for <53853@debbugs.gnu.org>; Tue, 8 Feb 2022 03:21:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1644286861; bh=z8xN8qlz1GWii8L6se0OSg+nJCQI6T2mxNX809WV3hY=; h=From:To:Cc:Subject:Date:From; b=CYNurVQTuBavSk/tznSm8wlcrG1kVBjwTCXqhsLTT3l7t8aYsZaVP/d1aNjiOV52v qJ+vQP9+I26JMcpefdgP/Isxbt7d//xAwgzcQSqfXPEr4U4P+u2FB12gD1redjmaFm nO4hfYnMupLKyyq4WnW8Jti9N02tOd/DCekzIthrfTo8qYe3k7PNEc5OSLFyIUK64c XM84uzjBAf1PltwkIWI5tPt3bMmAfWF/X8nnpDQacgC/kHiT8rapfo+KwebLJHmoX7 WeTj14Sv1gwNwXlzsZS2Sb6ZIjo8nK593GvIz6ME96/5sSEKtbGV/CEZsTledIMATn rTkAesOXp6W1A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Jt6F76qSXz9rxF; Tue, 8 Feb 2022 03:20:59 +0100 (CET) In-reply-to: <87r18e7fb7.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226302 Archived-At: --=-=-= Content-Type: text/plain; format=flowed OK, I've updated the patch per your suggestions. I've also made the commit apply to the emacs-28 branch, as opposed to the master branch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-flymake-Ensure-compatibility-with-older-Emacsen.patch >From afa46b0808384a90d760262bf8bf676a509aa194 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Mon, 7 Feb 2022 07:56:13 -0800 Subject: [PATCH] flymake: Ensure compatibility with older Emacsen * lisp/progmodes/flymake.el (flymake--log-1): Use replace-regexp-in-string instead of Emacs 28's string-replace. (bug#53853) --- lisp/progmodes/flymake.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 0c16ddedcb..e369cb1f21 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -267,8 +267,8 @@ If set to nil, don't suppress any zero counters." (format " [%s %s]" (or sublog 'flymake) ;; Handle file names with "%" correctly. (Bug#51549) - (string-replace "%" "%%" - (buffer-name (current-buffer)))))) + (replace-regexp-in-string "%" "%%" + (buffer-name (current-buffer)))))) (display-warning (list 'flymake sublog) (apply #'format-message msg args) (if (numberp level) -- 2.34.1 --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Robert Pluim writes: >>>>>> On Mon, 07 Feb 2022 16:11:28 +0000, Brian Leung=20 >>>>>> said: > > Brian> From e08cd430e2c0acbf063ad2d6a2d8d093745a5c7c Mon Sep=20 > 17 00:00:00 2001 > Brian> From: Brian Leung > Brian> Date: Mon, 7 Feb 2022 07:56:13 -0800 > Brian> Subject: [PATCH] Don't use string-replace in flymake > > Brian> * lisp/progmodes/flymake.el (flymake--log-1): Stay=20 > compatible with > Brian> older Emacsen. > > This bit is the 'why', and thus needs to be in the preamble. In=20 > the > ChangeLog entry you should explain what change you=CA=BCre making=20 > "use > replace-regexp-in-string instead..." . And please put=20 > (Bug#53853) > somewhere in the commit message. > > Brian> --- > Brian> lisp/progmodes/flymake.el | 4 ++-- > Brian> 1 file changed, 2 insertions(+), 2 deletions(-) > > Brian> diff --git a/lisp/progmodes/flymake.el=20 > b/lisp/progmodes/flymake.el > Brian> index 0c16ddedcb..e369cb1f21 100644 > Brian> --- a/lisp/progmodes/flymake.el > Brian> +++ b/lisp/progmodes/flymake.el > Brian> @@ -267,8 +267,8 @@ If set to nil, don't suppress any=20 > zero counters." > Brian> (format " [%s %s]" > Brian> (or sublog 'flymake) > Brian> ;; Handle file names with "%"=20 > correctly. (Bug#51549) > Brian> - (string-replace "%" "%%" > Brian> - (buffer-name=20 > (current-buffer)))))) > Brian> + (replace-regexp-in-string "%" "%%" > Brian> +=20 > (buffer-name (current-buffer)))))) > Brian> (display-warning (list 'flymake sublog) > Brian> (apply #'format-message msg=20 > args) > Brian> (if (numberp level) > Brian> --=20 > Brian> 2.34.1 > > > > Robert --=-=-=--