From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 26 13:26:54 2025 Received: (at submit) by debbugs.gnu.org; 26 Jan 2025 18:26:54 +0000 Received: from localhost ([127.0.0.1]:57835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tc7LS-0004mo-0h for submit@debbugs.gnu.org; Sun, 26 Jan 2025 13:26:54 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55750) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tc7LO-0004mN-Pa for submit@debbugs.gnu.org; Sun, 26 Jan 2025 13:26:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tc7LH-0005X7-Vm for bug-gnu-emacs@gnu.org; Sun, 26 Jan 2025 13:26:44 -0500 Received: from wilbur.contactoffice.com ([212.3.242.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tc7LF-0005tk-FF for bug-gnu-emacs@gnu.org; Sun, 26 Jan 2025 13:26:43 -0500 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id D61C2159D for ; Sun, 26 Jan 2025 19:26:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1737915992; s=20240605-akrp; d=mailfence.com; i=derek_upham@mailfence.com; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=fp9pQWFrE12fYNwNuC6fHxgeto8Ri/W/iV9eL7Iqu3c=; b=bSQBGymZ9iyUDkAUKTLA6bxqZvuwbXRb0KHtYZkUNX83mPmq2BvgispU5ENrZXZP 3wmACxTBcVgYQLsg/p8LykQGQ91BOnv06kzSJVwokEzk1v0HaH2E4bP4Xt2uwJcPytq A+4mHV7f7mK9bjhg3WaLwvZ94U9zeZmZ7wOnERdD+N0C60+oszJXqUqVuzTq4huf4dr BYRpN5R/O36Qd3+hPN6jQsWMZRqsbFQGgSeBijHfyYTchLdltgqfe5PZms1hrYr6iXc qXt+wyqqiMdqiaIwUEGfSroQoFpvtjq58Wf4Ef/NK2t3cv/2/1bxq2wmzrNuipuUbSz FBIaYMRTnw== Received: by smtp.mailfence.com with ESMTPSA for ; Sun, 26 Jan 2025 19:26:29 +0100 (CET) Received: from [::1] (helo=priss.frightenedpiglet.com) by priss.frightenedpiglet.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1tc7L1-00000005EhL-1JNZ; Sun, 26 Jan 2025 10:26:27 -0800 From: Derek Upham To: bug-gnu-emacs@gnu.org Subject: 30.0.91; dired-omit-expunge embeds unquoted filename in format string X-Debbugs-Cc: Date: Sun, 26 Jan 2025 10:26:27 -0800 Message-ID: <87bjvtxwh8.fsf@priss.frightenedpiglet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ContactOffice-Account: com:175140567 Received-SPF: pass client-ip=212.3.242.68; envelope-from=derek_upham@mailfence.com; helo=wilbur.contactoffice.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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.1 (/) Looking at =E2=80=9Cdired-omit-expunge=E2=80=9D in dired-x.el, in this bloc= k: (setq count (+ count (dired-do-kill-lines nil (if dired-omit-verbose (format "Omitted %%d line%%s in %s" (abbreviate-file-name dired-directory)) "") init-count))) Here that =E2=80=9Cformat=E2=80=9D call generates a format template, such t= hat =E2=80=9Cdired-do-kill-lines=E2=80=9D can invoke =E2=80=9Cmessage=E2=80=9D = with that text plus=20 count information. If the directory name contains embedded percentage characters,=20 then the template ends up with extra parameter slots. The call to=20 =E2=80=9Cmessage=E2=80=9D fails with an error and Dired does not present the directory. (error "Not enough arguments for format string") (In case someone is curious =E2=80=9CWhy put percentages in the names at=20 all?=E2=80=9D, I use it to map those directories 1:1 with URLs/websites.) In GNU Emacs 30.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.18.2) of 2024-10-19 built on priss.frightenedpiglet.com Windowing system distributor 'The X.Org Foundation', version=20 11.0.12101014 System Description: Debian GNU/Linux trixie/sid --=20 Derek Upham derek_upham@mailfence.com From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 05:57:15 2025 Received: (at 75877) by debbugs.gnu.org; 1 Feb 2025 10:57:15 +0000 Received: from localhost ([127.0.0.1]:56547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teBBb-00085Q-5h for submit@debbugs.gnu.org; Sat, 01 Feb 2025 05:57:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52996) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teBBY-000855-J1 for 75877@debbugs.gnu.org; Sat, 01 Feb 2025 05:57:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1teBBT-0007BR-67; Sat, 01 Feb 2025 05:57:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=B8x36h07IwItsLzbqZQQX0XlacqzesyJhnpWZGL4XEA=; b=Xo6MmVD9aiiKmRoAizLJ +nYwjEgCZj8g209CCmHREUyQVMwZ8kCsDLpmkiWBw4XkwH7wvJqBPFgFQQixS7d2s34Fut58t6YpJ 2o1ZA10OPqrvbtCNuPFj4mxzTe6jTxomlMXd3pkVXtJomiqcfn+yW7EpagcpVASNfJWVOMJdi5U6u 5Nb3ZrZ/80uGBNJuvHg1EuPAOAxt1SHJLMgSGgRTC3kozgTLG44TTv3j1bpUC7hDPTWVa/UggHYpW 9YJIYNTwB5AfgGBViqoOjVTwMSuhmR163+VjMLbL5uGd3HWFN+SwDINJPcxZLFOKyyBOJZAdDN/Kv EFiqZzaQZdQsbw==; Date: Sat, 01 Feb 2025 12:57:03 +0200 Message-Id: <86bjvmgcg0.fsf@gnu.org> From: Eli Zaretskii To: Derek Upham In-Reply-To: <87bjvtxwh8.fsf@priss.frightenedpiglet.com> (bug-gnu-emacs@gnu.org) Subject: Re: bug#75877: 30.0.91; dired-omit-expunge embeds unquoted filename in format string References: <87bjvtxwh8.fsf@priss.frightenedpiglet.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75877 Cc: 75877@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: -3.3 (---) > Date: Sun, 26 Jan 2025 10:26:27 -0800 > From: Derek Upham via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Looking at “dired-omit-expunge” in dired-x.el, in this block: > > (setq count (+ count > (dired-do-kill-lines > nil > (if dired-omit-verbose > (format "Omitted %%d line%%s in %s" > (abbreviate-file-name > dired-directory)) > "") > init-count))) > > Here that “format” call generates a format template, such that > “dired-do-kill-lines” can invoke “message” with that text plus > count > information. > > If the directory name contains embedded percentage characters, > then the > template ends up with extra parameter slots. The call to > “message” > fails with an error and Dired does not present the directory. > > (error "Not enough arguments for format string") > > (In case someone is curious “Why put percentages in the names at > all?”, > I use it to map those directories 1:1 with URLs/websites.) Thanks. Is the below the right fix? diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 4a05f60..89390a4 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -498,8 +498,10 @@ dired-omit-expunge nil (if dired-omit-verbose (format "Omitted %%d line%%s in %s" - (abbreviate-file-name - dired-directory)) + (replace-regexp-in-string + "%" "%%" + (abbreviate-file-name + dired-directory))) "") init-count))) (force-mode-line-update)))) From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 08:49:58 2025 Received: (at 75877-done) by debbugs.gnu.org; 5 Feb 2025 13:49:58 +0000 Received: from localhost ([127.0.0.1]:49122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tffmv-0003Gb-ME for submit@debbugs.gnu.org; Wed, 05 Feb 2025 08:49:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49822) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tffms-0003GM-Rr for 75877-done@debbugs.gnu.org; Wed, 05 Feb 2025 08:49:55 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tffmn-0005OR-Ej; Wed, 05 Feb 2025 08:49:49 -0500 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=STilznnL+oujnak77KisEmrdzbU69n8S4KJyA9l/JJk=; b=U6yPCgRf81Jb z1PbyJTwPgvEFm0ZaQ+ZWwUrb4ipS4PzBIm6FWWuruTeaLq/wHP/NTfDAr2jTtLkvgUkV+oGpkd69 xEpdfsVGmTVy8SycTchx3SyGhXV/dNKYDA/Sxe+vGjW7pHEPXpOohtHDb+vsMz0D5fYt6M/NsXPPy 6kj8doFg/4DEVXorxtRH8H0r3Uk+KBu0fMXj3YaH4sKaOpVWmSbp8GOvr7bWo662rSXcadFxUoUQq nC0zoKbUTzi+ZaJ4+b0jICdznffxyFA8RfGL4HaSNZyj7NTmcRM0WOQxGGNkAXJgpthcq8+0GIHyX fDSpoKaunw1+NvrvPw2DuQ==; Date: Wed, 05 Feb 2025 15:49:46 +0200 Message-Id: <86msf08ps5.fsf@gnu.org> From: Eli Zaretskii To: Derek Upham In-Reply-To: <87cyfxi8ir.fsf@priss.frightenedpiglet.com> (message from Derek Upham on Tue, 04 Feb 2025 15:40:12 -0800) Subject: Re: bug#75877: 30.0.91; dired-omit-expunge embeds unquoted filename in format string References: <87bjvtxwh8.fsf@priss.frightenedpiglet.com> <86bjvmgcg0.fsf@gnu.org> <87cyfxi8ir.fsf@priss.frightenedpiglet.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75877-done Cc: 75877-done@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: -3.3 (---) > From: Derek Upham > Date: Tue, 04 Feb 2025 15:40:12 -0800 > > Eli Zaretskii writes: > > > Thanks. Is the below the right fix? > > > > diff --git a/lisp/dired-x.el b/lisp/dired-x.el > > index 4a05f60..89390a4 100644 > > --- a/lisp/dired-x.el > > +++ b/lisp/dired-x.el > > @@ -498,8 +498,10 @@ dired-omit-expunge > > nil > > (if dired-omit-verbose > > (format "Omitted %%d line%%s > > in %s" > > - > > (abbreviate-file-name > > - dired-directory)) > > + > > (replace-regexp-in-string > > + "%" "%%" > > + > > (abbreviate-file-name > > + dired-directory))) > > "") > > init-count))) > > (force-mode-line-update)))) > > Yeah, that patch will handle that use case. Thanks. Thanks, installed on the master branch, and closing the bug. From unknown Wed Jun 25 00:23:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Mar 2025 12:24:19 +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