From unknown Sat Aug 16 13:42:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34520 <34520@debbugs.gnu.org> To: bug#34520 <34520@debbugs.gnu.org> Subject: Status: delete-matching-lines should report how many lines it deleted Reply-To: bug#34520 <34520@debbugs.gnu.org> Date: Sat, 16 Aug 2025 20:42:40 +0000 retitle 34520 delete-matching-lines should report how many lines it deleted reassign 34520 emacs submitter 34520 =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson severity 34520 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 17 20:51:21 2019 Received: (at submit) by debbugs.gnu.org; 18 Feb 2019 01:51:21 +0000 Received: from localhost ([127.0.0.1]:51881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvY5Z-00087B-4Y for submit@debbugs.gnu.org; Sun, 17 Feb 2019 20:51:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvY5W-00086y-Sk for submit@debbugs.gnu.org; Sun, 17 Feb 2019 20:51:19 -0500 Received: from lists.gnu.org ([209.51.188.17]:47436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvY5R-0000I9-Hu for submit@debbugs.gnu.org; Sun, 17 Feb 2019 20:51:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvY5P-0004zp-SZ for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 20:51:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvY5O-0000HS-7W for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 20:51:11 -0500 Received: from ladybird.maple.relay.mailchannels.net ([23.83.214.98]:22639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvY5N-0000Fw-RZ for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 20:51:10 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 77B2F5C3C07 for ; Mon, 18 Feb 2019 01:51:05 +0000 (UTC) Received: from pdx1-sub0-mail-a67.g.dreamhost.com (unknown [100.96.36.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 18BDD5C3CA8 for ; Mon, 18 Feb 2019 01:51:05 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a67.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Mon, 18 Feb 2019 01:51:05 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Slimy-Occur: 0f8ed5e40d3880b6_1550454665194_729498865 X-MC-Loop-Signature: 1550454665194:61733942 X-MC-Ingress-Time: 1550454665193 Received: from pdx1-sub0-mail-a67.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a67.g.dreamhost.com (Postfix) with ESMTP id B0BC080AB4 for ; Sun, 17 Feb 2019 17:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=jidanni.org; bh=oXHAK+YUAF5SZzB1XB Norwrnv3I=; b=jbFDVCg3G64KQQyQk6Zvx69SUhuoL9nyM6nyL/YwBR4ZWFUNFT //KtiPIrzZfQ3+9zJ/3iXH4bfGPPehIY9V0oMBSPMGD/wZl2AxDLD+nf9YEjFyFM Hfyivv6fadmQn+vJBwFjf4FTt5boiYf99zkNtyyIpbtCoU2CWgpXJOqyE= Received: from jidanni.org (114-41-7-45.dynamic-ip.hinet.net [114.41.7.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a67.g.dreamhost.com (Postfix) with ESMTPSA id 4281E8228D for ; Sun, 17 Feb 2019 17:51:04 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a67 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-gnu-emacs@gnu.org Subject: delete-matching-lines should report how many lines it deleted Date: Mon, 18 Feb 2019 08:35:08 +0800 Message-ID: <87o97aq6gz.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrudduvddggeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthekredttddtjeenucfhrhhomhepnjjnnjcuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqnecuffhomhgrihhnpegvlhdrihhtnecukfhppeduudegrdeguddrjedrgeehnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjihgurghnnhhirdhorhhgpdhinhgvthepuddugedrgedurdejrdeghedprhgvthhurhhnqdhprghthheppeeruhhtfhdqkeerueerheeimhfphefnihehhegsveekreepucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqedpmhgrihhlfhhrohhmpehjihgurghnnhhisehjihgurghnnhhirdhorhhgpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.98 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) delete-matching-lines is an alias for =E2=80=98flush-lines=E2=80=99 in =E2= =80=98replace.el=E2=80=99. It works great... or does it? Can't often tell. That's because well, if there are matching lines off the screen, you won't really know, so you have to go down there to have a look... and well, need eagle eyes often too depending on the pattern and how many similar lines there still are. Got an idea!: Simply keep a count of how many lines were deleted, and report that in the minibuffer, if using interactively. What if there were no matching lines? Then say Deleted 0 matching lines. Or beep "No matching lines!" Try this with matching lines all below the visible part of the buffer: C-x h [mark-whole-buffer] M-x delete-matching-lines zzzzz See the feeling (felt nothing, did it work in the first place one wonders= ?) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 18 01:07:07 2019 Received: (at 34520) by debbugs.gnu.org; 18 Feb 2019 06:07:07 +0000 Received: from localhost ([127.0.0.1]:51960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvc55-0005sp-8R for submit@debbugs.gnu.org; Mon, 18 Feb 2019 01:07:07 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:37500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvc52-0005q7-Hb for 34520@debbugs.gnu.org; Mon, 18 Feb 2019 01:07:05 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 2708FE6833; Mon, 18 Feb 2019 07:07:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DagunEUJdX5Y; Mon, 18 Feb 2019 07:06:59 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id ED0DEE66A3; Mon, 18 Feb 2019 07:06:58 +0100 (CET) References: <87o97aq6gz.fsf@jidanni.org> User-agent: mu4e 1.1.0; emacs 27.0.50 From: Marcin Borkowski To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted In-reply-to: <87o97aq6gz.fsf@jidanni.org> Date: Mon, 18 Feb 2019 07:06:05 +0100 Message-ID: <87lg2dpr5e.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2019-02-18, at 01:35, =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson wrote: > delete-matching-lines is an alias for =E2=80=98flush-lines=E2=80=99 in = =E2=80=98replace.el=E2=80=99. > > It works great... or does it? Can't often tell. That's because well, > if there are matching lines off the screen, you won't really know, so > you have to go down there to have a look... and well, need eagle eyes > often too depending on the pattern and how many similar lines there > still are. > > Got an idea!: Simply keep a count of how many lines were deleted, and > report that in the minibuffer, if using interactively. I like this a lot. I use delete-matching-lines (and delete-non-matching-lines) a lot, both would be greatly enhanced with such a feature. Best, --=20 Marcin Borkowski http://mbork.pl From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 27 16:38:24 2019 Received: (at 34520) by debbugs.gnu.org; 27 Feb 2019 21:38:24 +0000 Received: from localhost ([127.0.0.1]:54449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz6uG-0005mk-GQ for submit@debbugs.gnu.org; Wed, 27 Feb 2019 16:38:24 -0500 Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:64084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gz6uD-0005mW-Uq for 34520@debbugs.gnu.org; Wed, 27 Feb 2019 16:38:23 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B2FA85C40A4; Wed, 27 Feb 2019 21:38:19 +0000 (UTC) Received: from pdx1-sub0-mail-a65.g.dreamhost.com (unknown [100.96.35.41]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 494835C4494; Wed, 27 Feb 2019 21:38:19 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a65.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Wed, 27 Feb 2019 21:38:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Bored-Shade: 13b65002551beabe_1551303499519_4179143905 X-MC-Loop-Signature: 1551303499519:2819318205 X-MC-Ingress-Time: 1551303499519 Received: from pdx1-sub0-mail-a65.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTP id E3053819A3; Wed, 27 Feb 2019 13:38:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Z7A32yRMeI2BIrFR+PCf9bi9axU=; b= opDRwngPmVfL0AiE1upRjE4O4rSyzst9vDNFfHHgSFBQanuuDjAUW6bf2pGoUFVa Qq6yftVuPREeMTEMyoxzfE0z7IMbat4mMEaCGZlFQy2LGAfbYr1tN0oHwz2eG6sM I+e2g2JAF86r6ruyOmAPunZQOJ3ZoWzxe5gv+5XPJPE= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a65.g.dreamhost.com (Postfix) with ESMTPSA id 4B23B819A0; Wed, 27 Feb 2019 13:38:16 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a65 From: Juri Linkov To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted Organization: LINKOV.NET References: <87o97aq6gz.fsf@jidanni.org> Date: Wed, 27 Feb 2019 23:36:53 +0200 In-Reply-To: <87o97aq6gz.fsf@jidanni.org> (=?utf-8?B?IuepjeS4ueWwvA==?= Dan Jacobson"'s message of "Mon, 18 Feb 2019 08:35:08 +0800") Message-ID: <87tvgoud56.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrvddugdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleekrddutdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleekrddutdefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepjhhiuggrnhhnihesjhhiuggrnhhnihdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > Got an idea!: Simply keep a count of how many lines were deleted, and > report that in the minibuffer, if using interactively. Good idea, this will bring deleting the lines under control: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=flush-lines-count.patch diff --git a/lisp/replace.el b/lisp/replace.el index b482d76afc..c3d8278936 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -953,7 +953,10 @@ flush-lines If a match is split across lines, all the lines it lies in are deleted. They are deleted _before_ looking for the next match. Hence, a match -starting on the same line at which another match ended is ignored." +starting on the same line at which another match ended is ignored. + +Return the number of deleted lines. When called interactively, +also print the number." (interactive (progn (barf-if-buffer-read-only) @@ -968,7 +971,8 @@ flush-lines (setq rstart (point) rend (point-max-marker))) (goto-char rstart)) - (let ((case-fold-search + (let ((count 0) + (case-fold-search (if (and case-fold-search search-upper-case) (isearch-no-upper-case-p regexp t) case-fold-search))) @@ -978,9 +982,13 @@ flush-lines (delete-region (save-excursion (goto-char (match-beginning 0)) (forward-line 0) (point)) - (progn (forward-line 1) (point)))))) - (set-marker rend nil) - nil) + (progn (forward-line 1) (point))) + (setq count (1+ count)))) + (set-marker rend nil) + (when interactive (message "Deleted %d matching line%s" + count + (if (= count 1) "" "s"))) + count)) (defun how-many (regexp &optional rstart rend interactive) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 27 22:34:58 2019 Received: (at 34520) by debbugs.gnu.org; 28 Feb 2019 03:34:58 +0000 Received: from localhost ([127.0.0.1]:54675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzCTJ-0006LW-Rb for submit@debbugs.gnu.org; Wed, 27 Feb 2019 22:34:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzCTG-0006LE-Pa for 34520@debbugs.gnu.org; Wed, 27 Feb 2019 22:34:55 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzCT2-0003kz-Rb; Wed, 27 Feb 2019 22:34:43 -0500 Received: from [176.228.60.248] (port=3337 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gzCSo-0001DM-UU; Wed, 27 Feb 2019 22:34:31 -0500 Date: Thu, 28 Feb 2019 05:34:13 +0200 Message-Id: <83o96wk2mi.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87tvgoud56.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 27 Feb 2019 23:36:53 +0200) Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Juri Linkov > Date: Wed, 27 Feb 2019 23:36:53 +0200 > Cc: 34520@debbugs.gnu.org > > + (when interactive (message "Deleted %d matching line%s" > + count > + (if (= count 1) "" "s"))) > + count)) The concatenation of "s" trick works only in English, so please avoid that. This needs NEWS and manual updates. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 16:33:43 2019 Received: (at 34520-done) by debbugs.gnu.org; 28 Feb 2019 21:33:43 +0000 Received: from localhost ([127.0.0.1]:55596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzTJG-00016G-W5 for submit@debbugs.gnu.org; Thu, 28 Feb 2019 16:33:43 -0500 Received: from eastern.maple.relay.mailchannels.net ([23.83.214.55]:57214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzTJF-000168-8o for 34520-done@debbugs.gnu.org; Thu, 28 Feb 2019 16:33:42 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 087A85E414F; Thu, 28 Feb 2019 21:33:40 +0000 (UTC) Received: from pdx1-sub0-mail-a27.g.dreamhost.com (unknown [100.96.29.216]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B61715E4128; Thu, 28 Feb 2019 21:33:39 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a27.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Thu, 28 Feb 2019 21:33:39 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Towering-Bored: 248d8e754c5039eb_1551389619863_2445603235 X-MC-Loop-Signature: 1551389619862:1138280946 X-MC-Ingress-Time: 1551389619861 Received: from pdx1-sub0-mail-a27.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTP id 7A7407F1C3; Thu, 28 Feb 2019 13:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=ZQghFa BcjeV/3FmmsbuBYFyVgrc=; b=cfm6c50kj34Rpk1kj77I054L4JrgoRvac3y9Do +oWQ0x78ZhUsO4/JdDw3/o7i0CT63hkmOPzv6F2Qc8XBLwzcxC2HC5kB1dT11h1p ULT6FpBeeIL+LQenmO21R0vVgfkoYn3XN0TVJ0aK6oiCqkUWgRYKAKrkEbdvbqqz CFS4A= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTPSA id 759F37F1B1; Thu, 28 Feb 2019 13:33:36 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a27 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted Organization: LINKOV.NET References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> <83o96wk2mi.fsf@gnu.org> Date: Thu, 28 Feb 2019 23:33:10 +0200 In-Reply-To: <83o96wk2mi.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Feb 2019 05:34:13 +0200") Message-ID: <87k1hjfvjd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrvdefgdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleekrddutdefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleekrddutdefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34520-done Cc: 34520-done@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> + (when interactive (message "Deleted %d matching line%s" >> + count >> + (if (=3D count 1) "" "s"))) >> + count)) > > The concatenation of "s" trick works only in English, so please avoid > that. Ok, waiting for the times when =E2=80=98gettext=E2=80=99 will arrive to E= macs. > This needs NEWS and manual updates. Done. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 22:59:25 2019 Received: (at 34520) by debbugs.gnu.org; 1 Mar 2019 03:59:25 +0000 Received: from localhost ([127.0.0.1]:55703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzZKX-0003xZ-7F for submit@debbugs.gnu.org; Thu, 28 Feb 2019 22:59:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzZKV-0003xN-Kq for 34520@debbugs.gnu.org; Thu, 28 Feb 2019 22:59:23 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzZKP-0001jC-Nb; Thu, 28 Feb 2019 22:59:17 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1gzZKP-0000kS-Iw; Thu, 28 Feb 2019 22:59:17 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Juri Linkov In-Reply-To: <87k1hjfvjd.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 28 Feb 2019 23:33:10 +0200) Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> <83o96wk2mi.fsf@gnu.org> <87k1hjfvjd.fsf@mail.linkov.net> Message-Id: Date: Thu, 28 Feb 2019 22:59:17 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org, jidanni@jidanni.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Ok, waiting for the times when ‘gettext’ will arrive to Emacs. It would be very desirable to make Emacs support gettext-style translations. I have a feeling that it can't use the same code as gettext -- but with all of Emacs's other facilities, I think that transposing the useful part of gettext into Emacs won't be a big job. Would someone like to do this? -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 16:25:38 2019 Received: (at 34520) by debbugs.gnu.org; 2 Mar 2019 21:25:38 +0000 Received: from localhost ([127.0.0.1]:57922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0C8X-0004Kj-UL for submit@debbugs.gnu.org; Sat, 02 Mar 2019 16:25:38 -0500 Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:30665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0C8U-0004KU-Ts for 34520@debbugs.gnu.org; Sat, 02 Mar 2019 16:25:36 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 6A11F5C4A41; Sat, 2 Mar 2019 21:25:32 +0000 (UTC) Received: from pdx1-sub0-mail-a27.g.dreamhost.com (unknown [100.96.36.131]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 072245C4851; Sat, 2 Mar 2019 21:25:32 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a27.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Sat, 02 Mar 2019 21:25:32 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Average-Broad: 5d78de415189f787_1551561932255_4065775607 X-MC-Loop-Signature: 1551561932255:1300030879 X-MC-Ingress-Time: 1551561932254 Received: from pdx1-sub0-mail-a27.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTP id A736C80452; Sat, 2 Mar 2019 13:25:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=ijanWA vPKhnH4bZtOSL89NY30fY=; b=C6P0XOlXs4+7p7GO9E96W32qGjgp2bIoxQJ71X WRfks/H8CQzLiGanHfzEmxKVjWmeWubTqDqRZXkspJHLlcDGZysQ21JV8HJLp892 s+loUELedFCj8ddfUywk7iNIYRVLO9oBUnlRa69V5ksE5lKBISdWd8bQ3FiMDQdr /A7qg= Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTPSA id 3F1C480442; Sat, 2 Mar 2019 13:25:28 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a27 From: Juri Linkov To: Richard Stallman Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted Organization: LINKOV.NET References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> <83o96wk2mi.fsf@gnu.org> <87k1hjfvjd.fsf@mail.linkov.net> Date: Sat, 02 Mar 2019 22:55:52 +0200 In-Reply-To: (Richard Stallman's message of "Thu, 28 Feb 2019 22:59:17 -0500") Message-ID: <871s3p0zdz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrvdejgdduheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehrmhhssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Ok, waiting for the times when =E2=80=98gettext=E2=80=99 will arriv= e to Emacs. > > It would be very desirable to make Emacs support gettext-style > translations. I have a feeling that it can't use the same > code as gettext -- but with all of Emacs's other facilities, > I think that transposing the useful part of gettext into > Emacs won't be a big job. > > Would someone like to do this? Emacs can do much better job of text translation than gettext. It's easy to translate text transparently to the caller, i.e. without changing the caller code at all, by adding a new intermediate layer to some text output functions that will translate their string arguments to the language of the default language environment. Here is an experimental but extensible implementation that handles the case of formatting the recently added message taking into account grammatical number of its argument: (defvar i18n-translations-hash (make-hash-table :test 'equal)) (defun i18n-add-translation (_language-environment from to) (puthash from to i18n-translations-hash)) (i18n-add-translation "English" "Deleted %d matching lines" (lambda (format-string count) (if (=3D count 1) "Deleted %d matching line" "Deleted %d matching lines"))) (defun i18n-get-translation (format-string &rest args) (pcase (gethash format-string i18n-translations-hash) ((and (pred functionp) f) (apply f format-string args)) ((and (pred stringp) s) s) (_ format-string))) (advice-add 'message :around (lambda (orig-fun format-string &rest args) (apply orig-fun (apply 'i18n-get-translation format-strin= g args) args)) '((name . message-i18n))) In addition to translating format strings of the function 'message', doing the same for more text output functions like 'describe-function', 'describe-variable' and 'menu-item' in 'define-key' would cover most of the internationalization needs. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 02 18:39:54 2019 Received: (at 34520) by debbugs.gnu.org; 2 Mar 2019 23:39:54 +0000 Received: from localhost ([127.0.0.1]:57951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0EEU-0007QK-0Z for submit@debbugs.gnu.org; Sat, 02 Mar 2019 18:39:54 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:37734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0EER-0007Q5-TA for 34520@debbugs.gnu.org; Sat, 02 Mar 2019 18:39:52 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x22NdDrj059961; Sat, 2 Mar 2019 23:39:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=RMcYwqprBj/2Gi8KtLI1Y3fQi4xX9XABwzlD7+PAMHM=; b=zDUxkoh2oa1DRiUiB+mWVjQqb5ZpxF0GnB9ZRV+J0elMom3fp2nwagJrI2d1DR+4icO+ 4J4tXavIRIUOUlRN4Gn7n2yt/0CCufnVI3qsKWahG+KV7fkjA5y4z6OtUmrD++UEIs1R 8JeGSItEEtdlHFscZc9UdbNPlB8SGL8+FCbRB0KPRX8p1xi1HKaoW+u92ereOSxOgU0a FvvkBKKKeoUJajGPfV4biPELhvVVtRbgGYqOxKmyJdm5ZhiqGzMpYFOACX/Iz06iU/HT p89iYesGolv7lBd7EYH5RUHtNvr3AWLk8R0u1pXpdJ7T9gI8GRDYDh1iMWeqTT3y/crf 3g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2qyjfr1vbq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 02 Mar 2019 23:39:45 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x22NddvK022661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 2 Mar 2019 23:39:39 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x22NdcsO003908; Sat, 2 Mar 2019 23:39:38 GMT MIME-Version: 1.0 Message-ID: <8a1656f8-c425-4c95-927c-237ba902f456@default> Date: Sat, 2 Mar 2019 15:39:37 -0800 (PST) From: Drew Adams To: Juri Linkov , Richard Stallman Subject: RE: bug#34520: delete-matching-lines should report how many lines it deleted References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> <83o96wk2mi.fsf@gnu.org> <87k1hjfvjd.fsf@mail.linkov.net> <871s3p0zdz.fsf@mail.linkov.net> In-Reply-To: <871s3p0zdz.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9183 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=948 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903020178 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34520 Cc: 34520@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > > Ok, waiting for the times when =E2=80=98gettext=E2=80=99 will arriv= e to Emacs. > > > > It would be very desirable to make Emacs support gettext-style > > translations. I have a feeling that it can't use the same > > code as gettext -- but with all of Emacs's other facilities, > > I think that transposing the useful part of gettext into > > Emacs won't be a big job. > > > > Would someone like to do this? >=20 > Emacs can do much better job of text translation than gettext. >=20 > It's easy to translate text transparently to the caller, > i.e. without changing the caller code at all, by adding > a new intermediate layer to some text output functions > that will translate their string arguments to the > language of the default language environment. Is this bug thread really the place for such a discussion? Don't you want to create a dedicated emacs-devel discussion for this instead (restarting from the beginning)? From unknown Sat Aug 16 13:42:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Mar 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator