Received: (at 80347) by debbugs.gnu.org; 3 Mar 2026 07:52:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 03 02:52:22 2026 Received: from localhost ([127.0.0.1]:42345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vxKYH-0002P0-JF for submit <at> debbugs.gnu.org; Tue, 03 Mar 2026 02:52:22 -0500 Received: from mout02.posteo.de ([185.67.36.66]:50615) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1vxKYF-0002OJ-5B for 80347 <at> debbugs.gnu.org; Tue, 03 Mar 2026 02:52:20 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 04235240103 for <80347 <at> debbugs.gnu.org>; Tue, 3 Mar 2026 08:52:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1772524332; bh=OynmQArFv0d0xpgGKhtY0/dPh5nPCaEV6b4Rnpo/c4o=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=l3p0MFTP4TBe0hVDzbXyQANxL3KmaXXKLnfpJu32MG3N6bJG5TImDaWUmMfVtvwQf vRToZonly4jwKns44ABxSKmo6Yr3/if4q+3kgUHQC16CDBPQfs6yKhjdt7RKLxypvm G8eSZblDlkt3Q70GF+Df1TWW6AX/jXd6skpNPwpDUmWyBkbJf/Sj5ll7B3DA14xJW/ 8FHm+MTky7A8p4ZSUnUttIj8WFhDChCi/4Xpyeltnzufc6zP9rlMpkazd1JUCZCaYz fIF7+PCd+pKfgAnwq1vLo9h6dAtvgMCBo8WcFOunxN0ymLQ39lqumkd8B3MjeKsr39 2vgkBnCR4L8lg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fQ7LJ59P0z6v04; Tue, 3 Mar 2026 08:52:08 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <CAN+1HbpD=NdwQf25_eJFSu0gpsA1LRrF_57d2=H7JyOWwrMatw@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> <87ikbdg9pp.fsf@HIDDEN> <CAN+1HbrH1o_W-iiootsLxBVayARS08FHaZ8rkRcu7RZuhaVOPg@HIDDEN> <87ecm1g7de.fsf@HIDDEN> <CAN+1HbpD=NdwQf25_eJFSu0gpsA1LRrF_57d2=H7JyOWwrMatw@HIDDEN> OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Tue, 03 Mar 2026 07:52:09 +0000 Message-ID: <87y0k9e4ex.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.8 (-) St=C3=A9phane Marks <shipmints@HIDDEN> writes: [...] > From fe2b216a7a6a0f6e0e697165a1ddb5b1ddd07627 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> > Date: Mon, 2 Mar 2026 14:24:53 -0500 > Subject: [PATCH] New user option and function > 'recentf-exclude-ignored-extensions' (bug#80347) > > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > defcustom. > (recentf-exclude-ignored-extensions): New defun. > * etc/NEWS: Announce the new option and function. > --- > etc/NEWS | 7 +++++++ > lisp/recentf.el | 21 +++++++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/etc/NEWS b/etc/NEWS > index ef36df52ec1..bdab97b70a2 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize t= he user option > 'recentf-suppress-open-file-help' to non-nil. The default value of this > option is nil. >=20=20 > +--- > +*** New user option and function 'recentf-exclude-ignored-extensions'. > +Add the new function 'recentf-exclude-ignored-extensions' to the list > +'recentf-exclude' to ignore files whose extensions are listed in the > +user option of the same name 'recentf-exclude-ignored-extensions'. If > +that option is nil, 'completion-ignored-extensions' is used. > + > ** Saveplace >=20=20 > --- > diff --git a/lisp/recentf.el b/lisp/recentf.el > index 1ae2dd662b9..1a580a459d0 100644 > --- a/lisp/recentf.el > +++ b/lisp/recentf.el > @@ -115,6 +115,27 @@ recentf-exclude > :group 'recentf > :type '(repeat (choice regexp function))) >=20=20 > +(defcustom recentf-exclude-ignored-extensions nil > + "Optionally ignore file names ending in any string in this list. > +To use this, add the function `recentf-exclude-ignored-extensions' to > +the list `recentf-exclude'. > +If this option is nil, use the values from the variable > +`completion-ignored-extensions', which see." > + :group 'recentf > + :version "31.1" > + :type '(repeat string)) > + > +(defun recentf-exclude-ignored-extensions (file-name) > + "Return non-nil if FILE-NAME has an ignored extension. > +The user option `completion-ignored-extensions' determines whether or > +not a file extension counts as ignored. You can add this function to > +`recentf-exclude'." > + (and-let* ((extension (file-name-extension file-name))) > + (string-match-p > + (regexp-opt (or recentf-exclude-ignored-extensions > + completion-ignored-extensions)) > + (concat "\\." (regexp-quote extension) "\\'")))) > + > (defun recentf-access-file (filename) > "Check whether FILENAME is accessible." > (ignore-errors (not (access-file filename "Checking recentf file")))) I guess this looks good. I'd wait for Sean or someone else to comment on this before we proceed to merge the patch, OK?
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 2 Mar 2026 23:33:06 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 18:33:05 2026 Received: from localhost ([127.0.0.1]:39473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vxCl6-0006gp-P2 for submit <at> debbugs.gnu.org; Mon, 02 Mar 2026 18:33:05 -0500 Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]:52441) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>) id 1vxCl3-0006gN-MN for 80347 <at> debbugs.gnu.org; Mon, 02 Mar 2026 18:33:03 -0500 Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-5637886c92aso2738957e0c.0 for <80347 <at> debbugs.gnu.org>; Mon, 02 Mar 2026 15:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772494381; cv=none; d=google.com; s=arc-20240605; b=TvlbJBNzigXwchFAWnQE3cWBBkYkwW2Sv4tiqvy44e7Z1YIWWXtRcFwwFH921ahwWt QRy44LZn/F9+5IRDfBwQqIRWuTWmJXVXrDnQHxna3g008zo90ujks+QfDxcE3sjZj7DY tlVA47lLz9VoJCT2JHulujG9E4dP9XZgI01iCeUj6bU/CTf8er/8nmYGpOvQV5gBuM8F Wqg8yCKUQTaYHLVR2GFWsHDtsQnTcwXarC7YwZRi5Ee6CoyiIjAQT96CpVv/wSaxg3o7 Oggj6XDryFkXxaGj5hjsJDps6IPTQwHjCXkusqZv25z+0lMFYR4JvHzyGe621hHMW3x9 sDEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=TMnReY+AHs7AnxUnBfxl1z5FW9SyrCW8lPXBm0Rh+Lo=; fh=gTZC462fHJNdKoKse+qhbfZCfnQaM44DR8IxGpYJX1o=; b=AVIC4hcp+ivf2RdvBPivaoBMWwG7t4juNvSc/dejhUIRnNNMSSYLwAfGB6dKS+tQDE MJbBzsZ/Jw1hjatdT6ZCBBWcpQpxwObAS0RhQY1sOfS0dlrXc9a02CJZDw+xF0Gox5L3 aaq/PFXR6G/P/t51Efsq5vrv9WyatFuKc6/p3rsW3s+D1z/2LvJjzZaYl054a10Btghq dg3zSy+JDV7AGyoqFMiH3SCtteNdKK3s2Qy6UgPYc/9jFT3V2t75G6A+rxGKIDu7Rfge 12KMJT2Z/WQRMsaMqaFPPAe8Z9V4jnGoELzBE4UnVq1TYQZuF66d0ojU4efCvCWHqbfN nElg==; darn=debbugs.gnu.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772494381; x=1773099181; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TMnReY+AHs7AnxUnBfxl1z5FW9SyrCW8lPXBm0Rh+Lo=; b=UxTdOhgy2cxJMvcqgXf+C0nfvMDzOYsXiQRg8x9F78S0lwOnFMIQnbwdwJ+hmdazho ZTGbJpamnwo8y5GueJzkdR98At4ZaKu26LW8UGZdKlLEFSUV2xiY0CG73JJmAIWTBrm1 gXCL48yf85SBaV2J2Iczv2AIontTK0MhI9trFzdBIzM9ek5FQteNeqgfeWF0GDa5TE7k ts9BAE4TgooOPRPr/MPNgo0MSb4gB21gbcqUeNUEIULekGD/jtpP1/5+ChmrKCVKknmG xX0bpKfFdLgFnYAPcaeUGtBqGBCKZU6xG+aHYUVCcuSQG0TSz7kzWB4yedLVgY91I8ka 66hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772494381; x=1773099181; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TMnReY+AHs7AnxUnBfxl1z5FW9SyrCW8lPXBm0Rh+Lo=; b=NG8SsRBkykUTy9eWws8zGP3nce3mkFpJ5Amu40kYbq10JCdk3N8Mg45DFL09FoA+2U Rr2U2chFpiMyXwmg+Jrt2BhhpZefxZXh497IRQ+vci+2zeWivt7cCBD4L5mbqbnrydj0 PFKXZIt6EDYG0w99k6jOE9O8qRMSZE3ZmmmhlnEERDqlxTPih0WGJ+p993RFTztKPE2F iGsovee5KzZ1F8H4HiuHPcidji9wcmk5Nwylz5d19/obVeZCG2+L5tKTPrENtBEkhrv1 a72sdoWs2c3g6SmoGl5rG5ZDXVvrns1hqnYUgR2ELd7ZzSK/j/4ZlNWT3UXp7xhdFmBo DVwA== X-Forwarded-Encrypted: i=1; AJvYcCXXWeM8hESYftxy1NaJ1Gg2+qLt0koO6oPw6Wh3CjWQ6yKaW/j766B4/XQY12mVarLXeYS+dg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzB3C63DkhDVrgOl8UTq5YwDqPRgB+f2/wT+TTlfCU4JJKp9pPT EWpLvgGO/4vX0kj76jf2eH829xev2jDneLK/CDJo2aoEmvfsH61ao864OYO5mWWycmVzBqAnusF 8G+5bmrRj4eiBjcBCRhhviXtdoQWqwKQ= X-Gm-Gg: ATEYQzw8IR/yhqt2X+FyJY1n2DT/WtFfsBsD5oSzgXXUnXCsPTGGU6MFrQ0lddtbIDJ Wvm+/kk0UEm0Yv1ksfwJEn1XdOPTu+T8vQ3BUs3MwuGkcood+UldfqU+zjfHwEer2bHg73BU+WY +s73WwLp7rxnvaQww2qBBzzdIdtRqT4Cu9qm5+VpgkeOEp3EiiacTksEFgXl2VEVa4LPWKoKZa8 IJuki8cPWyJoyLGKn9zfnPItNm3fBkkZblW6kGH7TEUK1iY9BeF8VfEWt5uRpyQsrH4IPazNrqr kxLRSRxN8WhhfbJembRtyp7OxzTF7OweaNxXDKB0wkcjhdN3dPPf4McM1w4W23E= X-Received: by 2002:a05:6102:50ac:b0:5db:f031:84c7 with SMTP id ada2fe7eead31-5ff325541damr5741996137.30.1772494380719; Mon, 02 Mar 2026 15:33:00 -0800 (PST) MIME-Version: 1.0 References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> <87ikbdg9pp.fsf@HIDDEN> <CAN+1HbrH1o_W-iiootsLxBVayARS08FHaZ8rkRcu7RZuhaVOPg@HIDDEN> <87ecm1g7de.fsf@HIDDEN> In-Reply-To: <87ecm1g7de.fsf@HIDDEN> From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN> Date: Mon, 2 Mar 2026 18:32:48 -0500 X-Gm-Features: AaiRm52tyrkuGhMVt2TynIuOCk4owenbg39P9O0QUWWnaReavCQb-1XP0baSu-o Message-ID: <CAN+1HbpD=NdwQf25_eJFSu0gpsA1LRrF_57d2=H7JyOWwrMatw@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions To: Philip Kaludercic <philipk@HIDDEN> Content-Type: multipart/mixed; boundary="000000000000edfbdb064c1301fe" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --000000000000edfbdb064c1301fe Content-Type: multipart/alternative; boundary="000000000000edfbda064c1301fc" --000000000000edfbda064c1301fc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 2, 2026 at 6:05=E2=80=AFPM Philip Kaludercic <philipk@HIDDEN= t> wrote: > St=C3=A9phane Marks <shipmints@HIDDEN> writes: > > > On Mon, Mar 2, 2026 at 5:14=E2=80=AFPM Philip Kaludercic <philipk@poste= o.net> > wrote: > > > >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: > >> > > >> > Patch attached. I also added a user option of the same name should > people > >> > not want to default to the values on 'completion-ignored-extensions'= . > >> > >> I am not sure that we really need that... If users need some special > >> behavior they can just implement their own function, right? At least = it > >> defaults to `completion-ignored-extensions', so I guess it is fine. > >> > > > > The domain of completions is separate from the domain of files one want= s > to > > recall. > > I get what you are trying to say, but effectively > `completion-ignored-extensions' serves as the database for generated > files that you don't want Emacs to be distracted by, be it when > completing file names, when presenting directories and as I argue when > selecting (recent) files. These two "domains" are all the more similar > if you use `recentf-open'. > > > It's a convenience that the completion list is there to > leverage. > > Many people use Emacs to analyze binary files like ".bin" and ".hex" > files > > for security analysis among other things. There's also no point in > > providing a convenience utility function that we encourage people to > > replace because it hard codes policy. > > The point would be simplicity of implementation and documentation. > > >> -St=C3=A9phane > >> > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:00:00 20= 01 > >> > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN= om> > >> > Date: Mon, 2 Mar 2026 14:24:53 -0500 > >> > Subject: [PATCH] New user option and function > >> > 'recentf-exclude-ignored-extensions' (bug#80347) > >> > > >> > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > >> > defcustom. > >> > (recentf-exclude-ignored-extensions): New defun. > >> > * etc/NEWS: Announce the new option and function. > >> > --- > >> > etc/NEWS | 7 +++++++ > >> > lisp/recentf.el | 21 +++++++++++++++++++++ > >> > 2 files changed, 28 insertions(+) > >> > > >> > diff --git a/etc/NEWS b/etc/NEWS > >> > index ef36df52ec1..bdab97b70a2 100644 > >> > --- a/etc/NEWS > >> > +++ b/etc/NEWS > >> > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, > customize > >> the user option > >> > 'recentf-suppress-open-file-help' to non-nil. The default value of > this > >> > option is nil. > >> > > >> > +--- > >> > +*** New user option and function > 'recentf-exclude-ignored-extensions'. > >> > +Add the new function 'recentf-exclude-ignored-extensions' to the li= st > >> > +'recentf-exclude' to ignore files whose extensions are listed in th= e > >> > +user option of the same name 'recentf-exclude-ignored-extensions'. > If > >> > +that option is nil, 'completion-ignored-extensions' is used. > >> > + > >> > ** Saveplace > >> > > >> > --- > >> > diff --git a/lisp/recentf.el b/lisp/recentf.el > >> > index 1ae2dd662b9..ae519e40de1 100644 > >> > --- a/lisp/recentf.el > >> > +++ b/lisp/recentf.el > >> > @@ -115,6 +115,27 @@ recentf-exclude > >> > :group 'recentf > >> > :type '(repeat (choice regexp function))) > >> > > >> > +(defcustom recentf-exclude-ignored-extensions nil > >> > + "Optionally ignore file names ending in any string in this list. > >> > +To use this, add the function `recentf-exclude-ignored-extensions' = to > >> > +the list `recentf-exclude'. > >> > +If this option is nil, use the values from the variable > >> > +`completion-ignored-extensions', which see." > >> > + :group 'recentf > >> > + :version "31.1" > >> > + :type '(repeat string)) > >> > + > >> > +(defun recentf-exclude-ignored-extensions (file-name) > >> > + "Return non-nil if FILE-NAME has an ignored extension. > >> > +The user option `completion-ignored-extensions' determines whether = or > >> > +not a file extension counts as ignored. You can add this function = to > >> > +`recentf-exclude'." > >> > + (string-match-p > >> > + (regexp-opt (or recentf-exclude-ignored-extensions > >> > >> Would `append' make sense? I guess the point is that you want to > >> eliminate false positives of some kind? > >> > > > > Same reasoning as above. Separate domains. Appending by default > wouldn't > > be nice as a hard-coded policy. People can > > set recentf-exclude-ignored-extensions to (append '() > > completion-ignored-extensions) if they want that. > > OK. > > >> + completion-ignored-extensions)) > >> > + (concat "\\." (regexp-quote (or (file-name-extension file-name) > "")) > >> > >> Why not catch this before constructing the regular expression? > >> > > > > Sure. For such a short function 6 of 1. > > > >> > >> > + "\\'"))) > >> > + > >> > (defun recentf-access-file (filename) > >> > "Check whether FILENAME is accessible." > >> > (ignore-errors (not (access-file filename "Checking recentf > file")))) > >> > > > > Revised patch attached. > > > > -St=C3=A9phane > > From d7ea8e98f640e9e452cf6484d64874b5db4925af Mon Sep 17 00:00:00 2001 > > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> > > Date: Mon, 2 Mar 2026 14:24:53 -0500 > > Subject: [PATCH] New user option and function > > 'recentf-exclude-ignored-extensions' (bug#80347) > > > > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > > defcustom. > > (recentf-exclude-ignored-extensions): New defun. > > * etc/NEWS: Announce the new option and function. > > --- > > etc/NEWS | 7 +++++++ > > lisp/recentf.el | 21 +++++++++++++++++++++ > > 2 files changed, 28 insertions(+) > > > > diff --git a/etc/NEWS b/etc/NEWS > > index ef36df52ec1..bdab97b70a2 100644 > > --- a/etc/NEWS > > +++ b/etc/NEWS > > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize > the user option > > 'recentf-suppress-open-file-help' to non-nil. The default value of th= is > > option is nil. > > > > +--- > > +*** New user option and function 'recentf-exclude-ignored-extensions'. > > +Add the new function 'recentf-exclude-ignored-extensions' to the list > > +'recentf-exclude' to ignore files whose extensions are listed in the > > +user option of the same name 'recentf-exclude-ignored-extensions'. If > > +that option is nil, 'completion-ignored-extensions' is used. > > + > > ** Saveplace > > > > --- > > diff --git a/lisp/recentf.el b/lisp/recentf.el > > index 1ae2dd662b9..4c82caef55c 100644 > > --- a/lisp/recentf.el > > +++ b/lisp/recentf.el > > @@ -115,6 +115,27 @@ recentf-exclude > > :group 'recentf > > :type '(repeat (choice regexp function))) > > > > +(defcustom recentf-exclude-ignored-extensions nil > > + "Optionally ignore file names ending in any string in this list. > > +To use this, add the function `recentf-exclude-ignored-extensions' to > > +the list `recentf-exclude'. > > +If this option is nil, use the values from the variable > > +`completion-ignored-extensions', which see." > > + :group 'recentf > > + :version "31.1" > > + :type '(repeat string)) > > + > > +(defun recentf-exclude-ignored-extensions (file-name) > > + "Return non-nil if FILE-NAME has an ignored extension. > > +The user option `completion-ignored-extensions' determines whether or > > +not a file extension counts as ignored. You can add this function to > > +`recentf-exclude'." > > + (when-let* ((extension (file-name-extension file-name))) > > I'd use `and-let*', because we are not executing this for side effects. > > > + (string-match-p > > + (regexp-opt (or recentf-exclude-ignored-extensions > > + completion-ignored-extensions)) > > The indentation is off here. But both of these things before pushing to > master can be fixed if we agree on the patch otherwise. > > > + (concat "\\." (regexp-quote extension) "\\'")))) > > + > > (defun recentf-access-file (filename) > > "Check whether FILENAME is accessible." > > (ignore-errors (not (access-file filename "Checking recentf file")))= ) > Sure. Attached. --000000000000edfbda064c1301fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">= On Mon, Mar 2, 2026 at 6:05=E2=80=AFPM Philip Kaludercic <<a href=3D"mai= lto:philipk@HIDDEN">philipk@HIDDEN</a>> wrote:</span></div></div= ><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmai= l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20= 4,204);padding-left:1ex">St=C3=A9phane Marks <<a href=3D"mailto:shipmint= s@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>> writes:<br> <br> > On Mon, Mar 2, 2026 at 5:14=E2=80=AFPM Philip Kaludercic <<a href= =3D"mailto:philipk@HIDDEN" target=3D"_blank">philipk@HIDDEN</a>>= wrote:<br> ><br> >> St=C3=A9phane Marks <<a href=3D"mailto:shipmints@HIDDEN" tar= get=3D"_blank">shipmints@HIDDEN</a>> writes:<br> >> ><br> >> > Patch attached. I also added a user option of the same name s= hould people<br> >> > not want to default to the values on 'completion-ignored-= extensions'.<br> >><br> >> I am not sure that we really need that...=C2=A0 If users need some= special<br> >> behavior they can just implement their own function, right?=C2=A0 = At least it<br> >> defaults to `completion-ignored-extensions', so I guess it is = fine.<br> >><br> ><br> > The domain of completions is separate from the domain of files one wan= ts to<br> > recall.=C2=A0 <br> <br> I get what you are trying to say, but effectively<br> `completion-ignored-extensions' serves as the database for generated<br= > files that you don't want Emacs to be distracted by, be it when<br> completing file names, when presenting directories and as I argue when<br> selecting (recent) files.=C2=A0 These two "domains" are all the m= ore similar<br> if you use `recentf-open'.<br> <br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 It's a convenience that the comp= letion list is there to leverage.<br> > Many people use Emacs to analyze binary files like ".bin" an= d ".hex" files<br> > for security analysis among other things.=C2=A0 There's also no po= int in<br> > providing a convenience utility function that we encourage people to<b= r> > replace because it hard codes policy.<br> <br> The point would be simplicity of implementation and documentation.<br> <br> >> -St=C3=A9phane<br> >> > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:0= 0:00 2001<br> >> > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <<a href= =3D"mailto:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>&g= t;<br> >> > Date: Mon, 2 Mar 2026 14:24:53 -0500<br> >> > Subject: [PATCH] New user option and function<br> >> >=C2=A0 'recentf-exclude-ignored-extensions' (bug#80347= )<br> >> ><br> >> > * lisp/recentf.el (recentf-exclude-ignored-extensions): New<b= r> >> > defcustom.<br> >> > (recentf-exclude-ignored-extensions): New defun.<br> >> > * etc/NEWS: Announce the new option and function.<br> >> > ---<br> >> >=C2=A0 etc/NEWS=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7 +++++++<b= r> >> >=C2=A0 lisp/recentf.el | 21 +++++++++++++++++++++<br> >> >=C2=A0 2 files changed, 28 insertions(+)<br> >> ><br> >> > diff --git a/etc/NEWS b/etc/NEWS<br> >> > index ef36df52ec1..bdab97b70a2 100644<br> >> > --- a/etc/NEWS<br> >> > +++ b/etc/NEWS<br> >> > @@ -1773,6 +1773,13 @@ messages.=C2=A0 To suppress these mess= ages, customize<br> >> the user option<br> >> >=C2=A0 'recentf-suppress-open-file-help' to non-nil.= =C2=A0 The default value of this<br> >> >=C2=A0 option is nil.<br> >> ><br> >> > +---<br> >> > +*** New user option and function 'recentf-exclude-ignore= d-extensions'.<br> >> > +Add the new function 'recentf-exclude-ignored-extensions= ' to the list<br> >> > +'recentf-exclude' to ignore files whose extensions a= re listed in the<br> >> > +user option of the same name 'recentf-exclude-ignored-ex= tensions'.=C2=A0 If<br> >> > +that option is nil, 'completion-ignored-extensions' = is used.<br> >> > +<br> >> >=C2=A0 ** Saveplace<br> >> ><br> >> >=C2=A0 ---<br> >> > diff --git a/lisp/recentf.el b/lisp/recentf.el<br> >> > index 1ae2dd662b9..ae519e40de1 100644<br> >> > --- a/lisp/recentf.el<br> >> > +++ b/lisp/recentf.el<br> >> > @@ -115,6 +115,27 @@ recentf-exclude<br> >> >=C2=A0 =C2=A0 :group 'recentf<br> >> >=C2=A0 =C2=A0 :type '(repeat (choice regexp function)))<br= > >> ><br> >> > +(defcustom recentf-exclude-ignored-extensions nil<br> >> > +=C2=A0 "Optionally ignore file names ending in any stri= ng in this list.<br> >> > +To use this, add the function `recentf-exclude-ignored-exten= sions' to<br> >> > +the list `recentf-exclude'.<br> >> > +If this option is nil, use the values from the variable<br> >> > +`completion-ignored-extensions', which see."<br> >> > +=C2=A0 :group 'recentf<br> >> > +=C2=A0 :version "31.1"<br> >> > +=C2=A0 :type '(repeat string))<br> >> > +<br> >> > +(defun recentf-exclude-ignored-extensions (file-name)<br> >> > +=C2=A0 "Return non-nil if FILE-NAME has an ignored exte= nsion.<br> >> > +The user option `completion-ignored-extensions' determin= es whether or<br> >> > +not a file extension counts as ignored.=C2=A0 You can add th= is function to<br> >> > +`recentf-exclude'."<br> >> > +=C2=A0 (string-match-p<br> >> > +=C2=A0 =C2=A0(regexp-opt (or recentf-exclude-ignored-extensi= ons<br> >><br> >> Would `append' make sense?=C2=A0 I guess the point is that you= want to<br> >> eliminate false positives of some kind?<br> >><br> ><br> > Same reasoning as above.=C2=A0 Separate domains.=C2=A0 Appending by de= fault wouldn't<br> > be nice as a hard-coded policy.=C2=A0 People can<br> > set recentf-exclude-ignored-extensions to (append '()<br> > completion-ignored-extensions) if they want that.<br> <br> OK.<br> <br> >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0completion-ignored-extensions))<br> >> > +=C2=A0 =C2=A0(concat "\\." (regexp-quote (or (file= -name-extension file-name) ""))<br> >><br> >> Why not catch this before constructing the regular expression?<br> >><br> ><br> > Sure. For such a short function 6 of 1.<br> ><br> >><br> >> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"\\'"= )))<br> >> > +<br> >> >=C2=A0 (defun recentf-access-file (filename)<br> >> >=C2=A0 =C2=A0 "Check whether FILENAME is accessible."= ;<br> >> >=C2=A0 =C2=A0 (ignore-errors (not (access-file filename "= Checking recentf file"))))<br> >><br> ><br> > Revised patch attached.<br> ><br> > -St=C3=A9phane<br> > From d7ea8e98f640e9e452cf6484d64874b5db4925af Mon Sep 17 00:00:00 2001= <br> > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <<a href=3D"mailt= o:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>><br> > Date: Mon, 2 Mar 2026 14:24:53 -0500<br> > Subject: [PATCH] New user option and function<br> >=C2=A0 'recentf-exclude-ignored-extensions' (bug#80347)<br> ><br> > * lisp/recentf.el (recentf-exclude-ignored-extensions): New<br> > defcustom.<br> > (recentf-exclude-ignored-extensions): New defun.<br> > * etc/NEWS: Announce the new option and function.<br> > ---<br> >=C2=A0 etc/NEWS=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7 +++++++<br> >=C2=A0 lisp/recentf.el | 21 +++++++++++++++++++++<br> >=C2=A0 2 files changed, 28 insertions(+)<br> ><br> > diff --git a/etc/NEWS b/etc/NEWS<br> > index ef36df52ec1..bdab97b70a2 100644<br> > --- a/etc/NEWS<br> > +++ b/etc/NEWS<br> > @@ -1773,6 +1773,13 @@ messages.=C2=A0 To suppress these messages, cus= tomize the user option<br> >=C2=A0 'recentf-suppress-open-file-help' to non-nil.=C2=A0 The = default value of this<br> >=C2=A0 option is nil.<br> >=C2=A0 <br> > +---<br> > +*** New user option and function 'recentf-exclude-ignored-extensi= ons'.<br> > +Add the new function 'recentf-exclude-ignored-extensions' to = the list<br> > +'recentf-exclude' to ignore files whose extensions are listed= in the<br> > +user option of the same name 'recentf-exclude-ignored-extensions&= #39;.=C2=A0 If<br> > +that option is nil, 'completion-ignored-extensions' is used.<= br> > +<br> >=C2=A0 ** Saveplace<br> >=C2=A0 <br> >=C2=A0 ---<br> > diff --git a/lisp/recentf.el b/lisp/recentf.el<br> > index 1ae2dd662b9..4c82caef55c 100644<br> > --- a/lisp/recentf.el<br> > +++ b/lisp/recentf.el<br> > @@ -115,6 +115,27 @@ recentf-exclude<br> >=C2=A0 =C2=A0 :group 'recentf<br> >=C2=A0 =C2=A0 :type '(repeat (choice regexp function)))<br> >=C2=A0 <br> > +(defcustom recentf-exclude-ignored-extensions nil<br> > +=C2=A0 "Optionally ignore file names ending in any string in thi= s list.<br> > +To use this, add the function `recentf-exclude-ignored-extensions'= ; to<br> > +the list `recentf-exclude'.<br> > +If this option is nil, use the values from the variable<br> > +`completion-ignored-extensions', which see."<br> > +=C2=A0 :group 'recentf<br> > +=C2=A0 :version "31.1"<br> > +=C2=A0 :type '(repeat string))<br> > +<br> > +(defun recentf-exclude-ignored-extensions (file-name)<br> > +=C2=A0 "Return non-nil if FILE-NAME has an ignored extension.<br= > > +The user option `completion-ignored-extensions' determines whethe= r or<br> > +not a file extension counts as ignored.=C2=A0 You can add this functi= on to<br> > +`recentf-exclude'."<br> > +=C2=A0 (when-let* ((extension (file-name-extension file-name)))<br> <br> I'd use `and-let*', because we are not executing this for side effe= cts.<br> <br> > +=C2=A0 =C2=A0 (string-match-p<br> > +=C2=A0 =C2=A0 =C2=A0(regexp-opt (or recentf-exclude-ignored-extension= s<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= completion-ignored-extensions))<br> <br> The indentation is off here.=C2=A0 But both of these things before pushing = to<br> master can be fixed if we agree on the patch otherwise.<br> <br> > +=C2=A0 =C2=A0 =C2=A0(concat "\\." (regexp-quote extension) = "\\'"))))<br> > +<br> >=C2=A0 (defun recentf-access-file (filename)<br> >=C2=A0 =C2=A0 "Check whether FILENAME is accessible."<br> >=C2=A0 =C2=A0 (ignore-errors (not (access-file filename "Checking = recentf file"))))<br></blockquote><div><br></div><div class=3D"gmail_d= efault" style=3D"font-family:monospace">Sure.=C2=A0 Attached.</div></div></= div> --000000000000edfbda064c1301fc-- --000000000000edfbdb064c1301fe Content-Type: application/octet-stream; name="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Disposition: attachment; filename="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Transfer-Encoding: base64 Content-ID: <f_mm9tdlmr0> X-Attachment-Id: f_mm9tdlmr0 RnJvbSBmZTJiMjE2YTdhNmEwZjZlMGU2OTcxNjVhMWRkYjViMWRkZDA3NjI3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/U3Q9QzM9QTlwaGFuZT0yME1hcmtzPz0gPHNo aXBtaW50c0BnbWFpbC5jb20+CkRhdGU6IE1vbiwgMiBNYXIgMjAyNiAxNDoyNDo1MyAtMDUwMApT dWJqZWN0OiBbUEFUQ0hdIE5ldyB1c2VyIG9wdGlvbiBhbmQgZnVuY3Rpb24KICdyZWNlbnRmLWV4 Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyAoYnVnIzgwMzQ3KQoKKiBsaXNwL3JlY2VudGYuZWwg KHJlY2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMpOiBOZXcKZGVmY3VzdG9tLgoocmVj ZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyk6IE5ldyBkZWZ1bi4KKiBldGMvTkVXUzog QW5ub3VuY2UgdGhlIG5ldyBvcHRpb24gYW5kIGZ1bmN0aW9uLgotLS0KIGV0Yy9ORVdTICAgICAg ICB8ICA3ICsrKysrKysKIGxpc3AvcmVjZW50Zi5lbCB8IDIxICsrKysrKysrKysrKysrKysrKysr KwogMiBmaWxlcyBjaGFuZ2VkLCAyOCBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvZXRjL05F V1MgYi9ldGMvTkVXUwppbmRleCBlZjM2ZGY1MmVjMS4uYmRhYjk3YjcwYTIgMTAwNjQ0Ci0tLSBh L2V0Yy9ORVdTCisrKyBiL2V0Yy9ORVdTCkBAIC0xNzczLDYgKzE3NzMsMTMgQEAgbWVzc2FnZXMu ICBUbyBzdXBwcmVzcyB0aGVzZSBtZXNzYWdlcywgY3VzdG9taXplIHRoZSB1c2VyIG9wdGlvbgog J3JlY2VudGYtc3VwcHJlc3Mtb3Blbi1maWxlLWhlbHAnIHRvIG5vbi1uaWwuICBUaGUgZGVmYXVs dCB2YWx1ZSBvZiB0aGlzCiBvcHRpb24gaXMgbmlsLgogCistLS0KKyoqKiBOZXcgdXNlciBvcHRp b24gYW5kIGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJy4KK0Fk ZCB0aGUgbmV3IGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyB0 byB0aGUgbGlzdAorJ3JlY2VudGYtZXhjbHVkZScgdG8gaWdub3JlIGZpbGVzIHdob3NlIGV4dGVu c2lvbnMgYXJlIGxpc3RlZCBpbiB0aGUKK3VzZXIgb3B0aW9uIG9mIHRoZSBzYW1lIG5hbWUgJ3Jl Y2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMnLiAgSWYKK3RoYXQgb3B0aW9uIGlzIG5p bCwgJ2NvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJyBpcyB1c2VkLgorCiAqKiBTYXZlcGxh Y2UKIAogLS0tCmRpZmYgLS1naXQgYS9saXNwL3JlY2VudGYuZWwgYi9saXNwL3JlY2VudGYuZWwK aW5kZXggMWFlMmRkNjYyYjkuLjFhNTgwYTQ1OWQwIDEwMDY0NAotLS0gYS9saXNwL3JlY2VudGYu ZWwKKysrIGIvbGlzcC9yZWNlbnRmLmVsCkBAIC0xMTUsNiArMTE1LDI3IEBAIHJlY2VudGYtZXhj bHVkZQogICA6Z3JvdXAgJ3JlY2VudGYKICAgOnR5cGUgJyhyZXBlYXQgKGNob2ljZSByZWdleHAg ZnVuY3Rpb24pKSkKIAorKGRlZmN1c3RvbSByZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNp b25zIG5pbAorICAiT3B0aW9uYWxseSBpZ25vcmUgZmlsZSBuYW1lcyBlbmRpbmcgaW4gYW55IHN0 cmluZyBpbiB0aGlzIGxpc3QuCitUbyB1c2UgdGhpcywgYWRkIHRoZSBmdW5jdGlvbiBgcmVjZW50 Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucycgdG8KK3RoZSBsaXN0IGByZWNlbnRmLWV4Y2x1 ZGUnLgorSWYgdGhpcyBvcHRpb24gaXMgbmlsLCB1c2UgdGhlIHZhbHVlcyBmcm9tIHRoZSB2YXJp YWJsZQorYGNvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJywgd2hpY2ggc2VlLiIKKyAgOmdy b3VwICdyZWNlbnRmCisgIDp2ZXJzaW9uICIzMS4xIgorICA6dHlwZSAnKHJlcGVhdCBzdHJpbmcp KQorCisoZGVmdW4gcmVjZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyAoZmlsZS1uYW1l KQorICAiUmV0dXJuIG5vbi1uaWwgaWYgRklMRS1OQU1FIGhhcyBhbiBpZ25vcmVkIGV4dGVuc2lv bi4KK1RoZSB1c2VyIG9wdGlvbiBgY29tcGxldGlvbi1pZ25vcmVkLWV4dGVuc2lvbnMnIGRldGVy bWluZXMgd2hldGhlciBvcgorbm90IGEgZmlsZSBleHRlbnNpb24gY291bnRzIGFzIGlnbm9yZWQu ICBZb3UgY2FuIGFkZCB0aGlzIGZ1bmN0aW9uIHRvCitgcmVjZW50Zi1leGNsdWRlJy4iCisgIChh bmQtbGV0KiAoKGV4dGVuc2lvbiAoZmlsZS1uYW1lLWV4dGVuc2lvbiBmaWxlLW5hbWUpKSkKKyAg ICAoc3RyaW5nLW1hdGNoLXAKKyAgICAgKHJlZ2V4cC1vcHQgKG9yIHJlY2VudGYtZXhjbHVkZS1p Z25vcmVkLWV4dGVuc2lvbnMKKyAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRpb24taWdub3Jl ZC1leHRlbnNpb25zKSkKKyAgICAgKGNvbmNhdCAiXFwuIiAocmVnZXhwLXF1b3RlIGV4dGVuc2lv bikgIlxcJyIpKSkpCisKIChkZWZ1biByZWNlbnRmLWFjY2Vzcy1maWxlIChmaWxlbmFtZSkKICAg IkNoZWNrIHdoZXRoZXIgRklMRU5BTUUgaXMgYWNjZXNzaWJsZS4iCiAgIChpZ25vcmUtZXJyb3Jz IChub3QgKGFjY2Vzcy1maWxlIGZpbGVuYW1lICJDaGVja2luZyByZWNlbnRmIGZpbGUiKSkpKQot LSAKMi41Mi4wCgo= --000000000000edfbdb064c1301fe--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 2 Mar 2026 23:05:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 18:05:29 2026 Received: from localhost ([127.0.0.1]:39320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vxCKO-0004Zj-Nu for submit <at> debbugs.gnu.org; Mon, 02 Mar 2026 18:05:29 -0500 Received: from mout01.posteo.de ([185.67.36.65]:35639) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1vxCKL-0004VC-Nz for 80347 <at> debbugs.gnu.org; Mon, 02 Mar 2026 18:05:27 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 12B31240027 for <80347 <at> debbugs.gnu.org>; Tue, 3 Mar 2026 00:05:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1772492719; bh=d5DgeEPbRHJqp/dyb98qR4Y7a9zHR03jDf5orxqCziw=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=fvAWINpqH4pyhyPAH35SMsmPEoUvRYJ4cGscDdU18qLM7pgMkLsOysBUO9B7F0STx a1k6UOtWuxDtorEuSvq6DhEi/3EXRtGwSJhModaS4scOUvd26Zfv2Hnpn6fK40Vaya lrWvC1e9rRKNXyMy9NnXWIJX5A370hvUTpLLShcC0AIykxGlNAKqMAFDk02vVFZsVh /WpwLalUZOeCoCu7sBdNMVbRdRcKyCvqX12EnKZyYZNswUzgqDFCBlTlaEQ21mrEKT kDhqcsL+PD6FfRREgtPNqxbWm9N70tk3T/jDBcbr/wE38Ey29gIcZfNwzdR9SvbtKI tdjRG88cyP0lg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fPvfQ2xXwz9rxF; Tue, 3 Mar 2026 00:05:17 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <CAN+1HbrH1o_W-iiootsLxBVayARS08FHaZ8rkRcu7RZuhaVOPg@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> <87ikbdg9pp.fsf@HIDDEN> <CAN+1HbrH1o_W-iiootsLxBVayARS08FHaZ8rkRcu7RZuhaVOPg@HIDDEN> OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Mon, 02 Mar 2026 23:05:18 +0000 Message-ID: <87ecm1g7de.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.8 (-) St=C3=A9phane Marks <shipmints@HIDDEN> writes: > On Mon, Mar 2, 2026 at 5:14=E2=80=AFPM Philip Kaludercic <philipk@posteo.= net> wrote: > >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >> > >> > Patch attached. I also added a user option of the same name should peo= ple >> > not want to default to the values on 'completion-ignored-extensions'. >> >> I am not sure that we really need that... If users need some special >> behavior they can just implement their own function, right? At least it >> defaults to `completion-ignored-extensions', so I guess it is fine. >> > > The domain of completions is separate from the domain of files one wants = to > recall.=20=20 I get what you are trying to say, but effectively `completion-ignored-extensions' serves as the database for generated files that you don't want Emacs to be distracted by, be it when completing file names, when presenting directories and as I argue when selecting (recent) files. These two "domains" are all the more similar if you use `recentf-open'. > It's a convenience that the completion list is there to leverage. > Many people use Emacs to analyze binary files like ".bin" and ".hex" files > for security analysis among other things. There's also no point in > providing a convenience utility function that we encourage people to > replace because it hard codes policy. The point would be simplicity of implementation and documentation. >> -St=C3=A9phane >> > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:00:00 2001 >> > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> >> > Date: Mon, 2 Mar 2026 14:24:53 -0500 >> > Subject: [PATCH] New user option and function >> > 'recentf-exclude-ignored-extensions' (bug#80347) >> > >> > * lisp/recentf.el (recentf-exclude-ignored-extensions): New >> > defcustom. >> > (recentf-exclude-ignored-extensions): New defun. >> > * etc/NEWS: Announce the new option and function. >> > --- >> > etc/NEWS | 7 +++++++ >> > lisp/recentf.el | 21 +++++++++++++++++++++ >> > 2 files changed, 28 insertions(+) >> > >> > diff --git a/etc/NEWS b/etc/NEWS >> > index ef36df52ec1..bdab97b70a2 100644 >> > --- a/etc/NEWS >> > +++ b/etc/NEWS >> > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize >> the user option >> > 'recentf-suppress-open-file-help' to non-nil. The default value of t= his >> > option is nil. >> > >> > +--- >> > +*** New user option and function 'recentf-exclude-ignored-extensions'. >> > +Add the new function 'recentf-exclude-ignored-extensions' to the list >> > +'recentf-exclude' to ignore files whose extensions are listed in the >> > +user option of the same name 'recentf-exclude-ignored-extensions'. If >> > +that option is nil, 'completion-ignored-extensions' is used. >> > + >> > ** Saveplace >> > >> > --- >> > diff --git a/lisp/recentf.el b/lisp/recentf.el >> > index 1ae2dd662b9..ae519e40de1 100644 >> > --- a/lisp/recentf.el >> > +++ b/lisp/recentf.el >> > @@ -115,6 +115,27 @@ recentf-exclude >> > :group 'recentf >> > :type '(repeat (choice regexp function))) >> > >> > +(defcustom recentf-exclude-ignored-extensions nil >> > + "Optionally ignore file names ending in any string in this list. >> > +To use this, add the function `recentf-exclude-ignored-extensions' to >> > +the list `recentf-exclude'. >> > +If this option is nil, use the values from the variable >> > +`completion-ignored-extensions', which see." >> > + :group 'recentf >> > + :version "31.1" >> > + :type '(repeat string)) >> > + >> > +(defun recentf-exclude-ignored-extensions (file-name) >> > + "Return non-nil if FILE-NAME has an ignored extension. >> > +The user option `completion-ignored-extensions' determines whether or >> > +not a file extension counts as ignored. You can add this function to >> > +`recentf-exclude'." >> > + (string-match-p >> > + (regexp-opt (or recentf-exclude-ignored-extensions >> >> Would `append' make sense? I guess the point is that you want to >> eliminate false positives of some kind? >> > > Same reasoning as above. Separate domains. Appending by default wouldn't > be nice as a hard-coded policy. People can > set recentf-exclude-ignored-extensions to (append '() > completion-ignored-extensions) if they want that. OK. >> + completion-ignored-extensions)) >> > + (concat "\\." (regexp-quote (or (file-name-extension file-name) ""= )) >> >> Why not catch this before constructing the regular expression? >> > > Sure. For such a short function 6 of 1. > >> >> > + "\\'"))) >> > + >> > (defun recentf-access-file (filename) >> > "Check whether FILENAME is accessible." >> > (ignore-errors (not (access-file filename "Checking recentf file"))= )) >> > > Revised patch attached. > > -St=C3=A9phane > From d7ea8e98f640e9e452cf6484d64874b5db4925af Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> > Date: Mon, 2 Mar 2026 14:24:53 -0500 > Subject: [PATCH] New user option and function > 'recentf-exclude-ignored-extensions' (bug#80347) > > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > defcustom. > (recentf-exclude-ignored-extensions): New defun. > * etc/NEWS: Announce the new option and function. > --- > etc/NEWS | 7 +++++++ > lisp/recentf.el | 21 +++++++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/etc/NEWS b/etc/NEWS > index ef36df52ec1..bdab97b70a2 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize t= he user option > 'recentf-suppress-open-file-help' to non-nil. The default value of this > option is nil. >=20=20 > +--- > +*** New user option and function 'recentf-exclude-ignored-extensions'. > +Add the new function 'recentf-exclude-ignored-extensions' to the list > +'recentf-exclude' to ignore files whose extensions are listed in the > +user option of the same name 'recentf-exclude-ignored-extensions'. If > +that option is nil, 'completion-ignored-extensions' is used. > + > ** Saveplace >=20=20 > --- > diff --git a/lisp/recentf.el b/lisp/recentf.el > index 1ae2dd662b9..4c82caef55c 100644 > --- a/lisp/recentf.el > +++ b/lisp/recentf.el > @@ -115,6 +115,27 @@ recentf-exclude > :group 'recentf > :type '(repeat (choice regexp function))) >=20=20 > +(defcustom recentf-exclude-ignored-extensions nil > + "Optionally ignore file names ending in any string in this list. > +To use this, add the function `recentf-exclude-ignored-extensions' to > +the list `recentf-exclude'. > +If this option is nil, use the values from the variable > +`completion-ignored-extensions', which see." > + :group 'recentf > + :version "31.1" > + :type '(repeat string)) > + > +(defun recentf-exclude-ignored-extensions (file-name) > + "Return non-nil if FILE-NAME has an ignored extension. > +The user option `completion-ignored-extensions' determines whether or > +not a file extension counts as ignored. You can add this function to > +`recentf-exclude'." > + (when-let* ((extension (file-name-extension file-name))) I'd use `and-let*', because we are not executing this for side effects. > + (string-match-p > + (regexp-opt (or recentf-exclude-ignored-extensions > + completion-ignored-extensions)) The indentation is off here. But both of these things before pushing to master can be fixed if we agree on the patch otherwise. > + (concat "\\." (regexp-quote extension) "\\'")))) > + > (defun recentf-access-file (filename) > "Check whether FILENAME is accessible." > (ignore-errors (not (access-file filename "Checking recentf file"))))
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 2 Mar 2026 22:29:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 17:29:07 2026 Received: from localhost ([127.0.0.1]:39162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vxBlC-0001l7-S0 for submit <at> debbugs.gnu.org; Mon, 02 Mar 2026 17:29:07 -0500 Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]:51708) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>) id 1vxBl9-0001kX-6f for 80347 <at> debbugs.gnu.org; Mon, 02 Mar 2026 17:29:04 -0500 Received: by mail-ua1-x92f.google.com with SMTP id a1e0cc1a2514c-94aaa5d3bfcso3066096241.3 for <80347 <at> debbugs.gnu.org>; Mon, 02 Mar 2026 14:29:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772490542; cv=none; d=google.com; s=arc-20240605; b=ixviS7bbJRXHOH3QQpUZCFxx4qyexWaVu/XJsupb32q8GnuE1U/Rt1SmFJD81tQ8EI vdzYYmYa/GiDV+lMwfNhZGcHdQ20kSYwKfoCRDo+s5AGCErDa4YqNA1uuWiI2IrfXEt6 dKl/vXqEKhqAh15CuRvbTsI9I1aWDWGi4v0YJlzpARzPIlz8JgGX9IdAVAUiHY9yQfzD EaQldG9v+qfLpHrQRISy8ISAkd4p+6DS1ra6PQOWBccnwFg4c+HYjXdWZb8euHIb0IsP Q2vFvACCxfwPo8kdFGDMB3x19G/eRC3XQSaxyaugcGgPzA3hmzPSZJLK+IC3fuH3CFJs 52QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Q1x+zhj/rT6LMT/j3WUwdoZz+CB5UmXlutUHCtepwrk=; fh=kerjZOXX0IZaLCHl5CvYp0D0HUUwK1pZAOQF2jtV5ZE=; b=cAS74r0PlbwvcsGyJxH+d1kX/aCLmet/wnzCABiLG/ACcbe8oIbHZIGcek4MWCkXp3 0FYJR/Iuxs/dnyTEWQ93sk+10/HpFNKEkZFSaT7TLx02IgzH7vLdIiMQZhGJNZCh8pn8 /kme8XDJX4igP21xiJitMMtzzRNb+mSq3KQ2guAr0C7lmRGmbtvRwq7E/e3uBPoPGeFX dHmAyhgq8+m+TQD7CJvyl2MuFPnr5v7t+5LgF8kWSfZCNoGF5TfQnHotPvA8AiAGZyPS 3hVYqNcVX9Yq+yoBNwDd7NYWc7iit0V1TPExY5hD5rrwyJ+Vt+i1VwwN1Z0F0/svQmyE YsHA==; darn=debbugs.gnu.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772490542; x=1773095342; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Q1x+zhj/rT6LMT/j3WUwdoZz+CB5UmXlutUHCtepwrk=; b=AqrVdINJeLdDhP5R8bLl+FsMdD149aOQsWosUbABIwYHS5VB9vCBc1vBYCvPI8most MssYyhL/bPNeeT3ukN3yBEsiXnldjGSMHmc3Sxy+DC9xS1kqXQ8RkAb1m6fLtMRkH3vU lbBhPUa8/TexgkWRgf7F9Zi21qFJQA9vD2OBE2W62MY4kWXk1CgqWoLEj7PcuPA6h3VA CsECr0mC14Fgw5J2YI86uihvelezW17bbREtOwQX4Wem22QkDuL5BYZtTsirM1i9xhcF jvjdO0Uecg6GCGoWkyjysB/EJSKH5nf94XRtLH9BQywVMUqr/3LPfK2RHZp2at6s3pEY DWtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772490542; x=1773095342; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Q1x+zhj/rT6LMT/j3WUwdoZz+CB5UmXlutUHCtepwrk=; b=t15cGulVXD6pJZu+lEMPuyXzQupn6zg2lZ+Kh6Q61HfQ4xoq9x5c8xovmn+FRfxfDz y7aRC4I9ydU2btPjX9x0R0WdJ/7P5Vbx7mRUalx91uz8rK7jlN4o7XjB2HjSkLqIn5KY 4KyUdA/m/oTY+hzq7npE+h3WafH8ud2EbZ7urGR+7W/LmIcmuzP1NXcSoBDnxqqdgmu0 NqtuHkG+NRP6DZxnxElDqCDruoZX2XpVDeZ9EU6Dpt90e7tqGfnTG70akPGW0LMxkBic QsfZC/LLZeqQTkq4X/lmJ+bO9xooYzSGOK9a6oMJEOHctIqFMEaadnfjGPNl0+VfyHD2 QYIA== X-Forwarded-Encrypted: i=1; AJvYcCW5HuRpLs5hlVdpgfy8YEkc1yGMmPrGlOviCsTEjvc+/ir82+m0liMfLeFC/h2ID2NP4uD74g==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw5vOw8Y0yc4Z6dehCnSVD6EHHmwMgU0v5lTenXCWBuARU6qUhQ xUyZQIFr184tFC4WgfIDKPZrXKD2032RNJUs9bJ4LTEW1oHmyW7MCgv03UQj/P3aHkO74dRCRoG vR9Sn2F/CqjXB84o6qcg9n8d2e3czUD4= X-Gm-Gg: ATEYQzxFYlhqr0qkHtjgsFjgFs4OAjCzX8CsA0pXbb68ewkuTVM7iIm+JyNnstVzU08 w9F9q2vC91QFqloTP3fMKBnOCGXA7UgIalG0abYgiVwxTmVqXLleFZo3nh58rj5Sf1z1te8KJO0 15AxHpHVqlZ0YYOP3MD3f1h0W61qFClUHsgDGorSDHfP8nZlCTqFcXsW/v93+4BcqXoXYAdmz30 ayM8uv4rREdTUYC833+OJwlGGNtC+d9bXW1+ymAxXpSLEAI+9vH+//5JFRtqyCmHI+Gi0BfEPBu Ehq9kUJNC/LRg1ZLtM/6BPNejf4Nur9y2l3v7Ul834hQKLCh7KCvC3WIs+XZSds= X-Received: by 2002:a05:6102:b0a:b0:5f7:24e9:6e91 with SMTP id ada2fe7eead31-5ff325677f4mr8076663137.36.1772490542332; Mon, 02 Mar 2026 14:29:02 -0800 (PST) MIME-Version: 1.0 References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> <87ikbdg9pp.fsf@HIDDEN> In-Reply-To: <87ikbdg9pp.fsf@HIDDEN> From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN> Date: Mon, 2 Mar 2026 17:28:50 -0500 X-Gm-Features: AaiRm50-xmOXGJylw5HSwkYTVScAH4ji7vbzKqrZLiXaS2suDVjrjwv5Isp2qKI Message-ID: <CAN+1HbrH1o_W-iiootsLxBVayARS08FHaZ8rkRcu7RZuhaVOPg@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions To: Philip Kaludercic <philipk@HIDDEN> Content-Type: multipart/mixed; boundary="00000000000024d8e0064c121d63" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --00000000000024d8e0064c121d63 Content-Type: multipart/alternative; boundary="00000000000024d8df064c121d61" --00000000000024d8df064c121d61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 2, 2026 at 5:14=E2=80=AFPM Philip Kaludercic <philipk@HIDDEN= t> wrote: > St=C3=A9phane Marks <shipmints@HIDDEN> writes: > > > > Patch attached. I also added a user option of the same name should peop= le > > not want to default to the values on 'completion-ignored-extensions'. > > I am not sure that we really need that... If users need some special > behavior they can just implement their own function, right? At least it > defaults to `completion-ignored-extensions', so I guess it is fine. > The domain of completions is separate from the domain of files one wants to recall. It's a convenience that the completion list is there to leverage. Many people use Emacs to analyze binary files like ".bin" and ".hex" files for security analysis among other things. There's also no point in providing a convenience utility function that we encourage people to replace because it hard codes policy. > -St=C3=A9phane > > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:00:00 2001 > > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> > > Date: Mon, 2 Mar 2026 14:24:53 -0500 > > Subject: [PATCH] New user option and function > > 'recentf-exclude-ignored-extensions' (bug#80347) > > > > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > > defcustom. > > (recentf-exclude-ignored-extensions): New defun. > > * etc/NEWS: Announce the new option and function. > > --- > > etc/NEWS | 7 +++++++ > > lisp/recentf.el | 21 +++++++++++++++++++++ > > 2 files changed, 28 insertions(+) > > > > diff --git a/etc/NEWS b/etc/NEWS > > index ef36df52ec1..bdab97b70a2 100644 > > --- a/etc/NEWS > > +++ b/etc/NEWS > > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize > the user option > > 'recentf-suppress-open-file-help' to non-nil. The default value of th= is > > option is nil. > > > > +--- > > +*** New user option and function 'recentf-exclude-ignored-extensions'. > > +Add the new function 'recentf-exclude-ignored-extensions' to the list > > +'recentf-exclude' to ignore files whose extensions are listed in the > > +user option of the same name 'recentf-exclude-ignored-extensions'. If > > +that option is nil, 'completion-ignored-extensions' is used. > > + > > ** Saveplace > > > > --- > > diff --git a/lisp/recentf.el b/lisp/recentf.el > > index 1ae2dd662b9..ae519e40de1 100644 > > --- a/lisp/recentf.el > > +++ b/lisp/recentf.el > > @@ -115,6 +115,27 @@ recentf-exclude > > :group 'recentf > > :type '(repeat (choice regexp function))) > > > > +(defcustom recentf-exclude-ignored-extensions nil > > + "Optionally ignore file names ending in any string in this list. > > +To use this, add the function `recentf-exclude-ignored-extensions' to > > +the list `recentf-exclude'. > > +If this option is nil, use the values from the variable > > +`completion-ignored-extensions', which see." > > + :group 'recentf > > + :version "31.1" > > + :type '(repeat string)) > > + > > +(defun recentf-exclude-ignored-extensions (file-name) > > + "Return non-nil if FILE-NAME has an ignored extension. > > +The user option `completion-ignored-extensions' determines whether or > > +not a file extension counts as ignored. You can add this function to > > +`recentf-exclude'." > > + (string-match-p > > + (regexp-opt (or recentf-exclude-ignored-extensions > > Would `append' make sense? I guess the point is that you want to > eliminate false positives of some kind? > Same reasoning as above. Separate domains. Appending by default wouldn't be nice as a hard-coded policy. People can set recentf-exclude-ignored-extensions to (append '() completion-ignored-extensions) if they want that. > + completion-ignored-extensions)) > > + (concat "\\." (regexp-quote (or (file-name-extension file-name) "")= ) > > Why not catch this before constructing the regular expression? > Sure. For such a short function 6 of 1. > > > + "\\'"))) > > + > > (defun recentf-access-file (filename) > > "Check whether FILENAME is accessible." > > (ignore-errors (not (access-file filename "Checking recentf file")))= ) > Revised patch attached. -St=C3=A9phane --00000000000024d8df064c121d61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">= On Mon, Mar 2, 2026 at 5:14=E2=80=AFPM Philip Kaludercic <<a href=3D"mai= lto:philipk@HIDDEN">philipk@HIDDEN</a>> wrote:</span></div></div= ><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmai= l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20= 4,204);padding-left:1ex">St=C3=A9phane Marks <<a href=3D"mailto:shipmint= s@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>> writes:<br>><= br> > Patch attached. I also added a user option of the same name should peo= ple<br> > not want to default to the values on 'completion-ignored-extension= s'.<br> <br> I am not sure that we really need that...=C2=A0 If users need some special<= br> behavior they can just implement their own function, right?=C2=A0 At least = it<br> defaults to `completion-ignored-extensions', so I guess it is fine.<br>= </blockquote><div><br></div><div><div class=3D"gmail_default" style=3D"font= -family:monospace">The domain of completions is separate from the domain of= files one wants to recall.=C2=A0 It's a convenience that the completio= n list is there to leverage.=C2=A0 Many people use Emacs to analyze binary = files like ".bin" and ".hex" files for security analysi= s among other things.=C2=A0 There's also no point in providing a conven= ience utility function that we encourage people to replace because it hard = codes policy.</div></div><div><br></div><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad= ding-left:1ex"> > -St=C3=A9phane<br> > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:00:00 2001= <br> > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <<a href=3D"mailt= o:shipmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>><br> > Date: Mon, 2 Mar 2026 14:24:53 -0500<br> > Subject: [PATCH] New user option and function<br> >=C2=A0 'recentf-exclude-ignored-extensions' (bug#80347)<br> ><br> > * lisp/recentf.el (recentf-exclude-ignored-extensions): New<br> > defcustom.<br> > (recentf-exclude-ignored-extensions): New defun.<br> > * etc/NEWS: Announce the new option and function.<br> > ---<br> >=C2=A0 etc/NEWS=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 7 +++++++<br> >=C2=A0 lisp/recentf.el | 21 +++++++++++++++++++++<br> >=C2=A0 2 files changed, 28 insertions(+)<br> ><br> > diff --git a/etc/NEWS b/etc/NEWS<br> > index ef36df52ec1..bdab97b70a2 100644<br> > --- a/etc/NEWS<br> > +++ b/etc/NEWS<br> > @@ -1773,6 +1773,13 @@ messages.=C2=A0 To suppress these messages, cus= tomize the user option<br> >=C2=A0 'recentf-suppress-open-file-help' to non-nil.=C2=A0 The = default value of this<br> >=C2=A0 option is nil.<br> >=C2=A0 <br> > +---<br> > +*** New user option and function 'recentf-exclude-ignored-extensi= ons'.<br> > +Add the new function 'recentf-exclude-ignored-extensions' to = the list<br> > +'recentf-exclude' to ignore files whose extensions are listed= in the<br> > +user option of the same name 'recentf-exclude-ignored-extensions&= #39;.=C2=A0 If<br> > +that option is nil, 'completion-ignored-extensions' is used.<= br> > +<br> >=C2=A0 ** Saveplace<br> >=C2=A0 <br> >=C2=A0 ---<br> > diff --git a/lisp/recentf.el b/lisp/recentf.el<br> > index 1ae2dd662b9..ae519e40de1 100644<br> > --- a/lisp/recentf.el<br> > +++ b/lisp/recentf.el<br> > @@ -115,6 +115,27 @@ recentf-exclude<br> >=C2=A0 =C2=A0 :group 'recentf<br> >=C2=A0 =C2=A0 :type '(repeat (choice regexp function)))<br> >=C2=A0 <br> > +(defcustom recentf-exclude-ignored-extensions nil<br> > +=C2=A0 "Optionally ignore file names ending in any string in thi= s list.<br> > +To use this, add the function `recentf-exclude-ignored-extensions'= ; to<br> > +the list `recentf-exclude'.<br> > +If this option is nil, use the values from the variable<br> > +`completion-ignored-extensions', which see."<br> > +=C2=A0 :group 'recentf<br> > +=C2=A0 :version "31.1"<br> > +=C2=A0 :type '(repeat string))<br> > +<br> > +(defun recentf-exclude-ignored-extensions (file-name)<br> > +=C2=A0 "Return non-nil if FILE-NAME has an ignored extension.<br= > > +The user option `completion-ignored-extensions' determines whethe= r or<br> > +not a file extension counts as ignored.=C2=A0 You can add this functi= on to<br> > +`recentf-exclude'."<br> > +=C2=A0 (string-match-p<br> > +=C2=A0 =C2=A0(regexp-opt (or recentf-exclude-ignored-extensions<br> <br> Would `append' make sense?=C2=A0 I guess the point is that you want to<= br> eliminate false positives of some kind?<br></blockquote><div><br></div><div= ><div class=3D"gmail_default" style=3D"font-family:monospace">Same reasonin= g as above.=C2=A0 Separate domains.=C2=A0 Appending by default wouldn't= be nice as a hard-coded policy.=C2=A0 People can set=C2=A0recentf-exclude-= ignored-extensions to (append '() completion-ignored-extensions) if the= y want that.</div></div><div><br></div><blockquote class=3D"gmail_quote" st= yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd= ing-left:1ex"> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= completion-ignored-extensions))<br> > +=C2=A0 =C2=A0(concat "\\." (regexp-quote (or (file-name-ext= ension file-name) ""))<br> <br> Why not catch this before constructing the regular expression?<br></blockqu= ote><div><br></div><div class=3D"gmail_default" style=3D"font-family:monosp= ace">Sure. For such a short function 6 of 1.</div><blockquote class=3D"gmai= l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20= 4,204);padding-left:1ex"> <br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"\\'")))<br> > +<br> >=C2=A0 (defun recentf-access-file (filename)<br> >=C2=A0 =C2=A0 "Check whether FILENAME is accessible."<br> >=C2=A0 =C2=A0 (ignore-errors (not (access-file filename "Checking = recentf file"))))<br></blockquote><div><br></div><div class=3D"gmail_d= efault" style=3D"font-family:monospace">Revised patch attached.</div><div c= lass=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class= =3D"gmail_default" style=3D"font-family:monospace">-St=C3=A9phane=C2=A0</di= v></div></div> --00000000000024d8df064c121d61-- --00000000000024d8e0064c121d63 Content-Type: application/octet-stream; name="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Disposition: attachment; filename="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Transfer-Encoding: base64 Content-ID: <f_mm9r3gh20> X-Attachment-Id: f_mm9r3gh20 RnJvbSBkN2VhOGU5OGY2NDBlOWU0NTJjZjY0ODRkNjQ4NzRiNWRiNDkyNWFmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/U3Q9QzM9QTlwaGFuZT0yME1hcmtzPz0gPHNo aXBtaW50c0BnbWFpbC5jb20+CkRhdGU6IE1vbiwgMiBNYXIgMjAyNiAxNDoyNDo1MyAtMDUwMApT dWJqZWN0OiBbUEFUQ0hdIE5ldyB1c2VyIG9wdGlvbiBhbmQgZnVuY3Rpb24KICdyZWNlbnRmLWV4 Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyAoYnVnIzgwMzQ3KQoKKiBsaXNwL3JlY2VudGYuZWwg KHJlY2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMpOiBOZXcKZGVmY3VzdG9tLgoocmVj ZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyk6IE5ldyBkZWZ1bi4KKiBldGMvTkVXUzog QW5ub3VuY2UgdGhlIG5ldyBvcHRpb24gYW5kIGZ1bmN0aW9uLgotLS0KIGV0Yy9ORVdTICAgICAg ICB8ICA3ICsrKysrKysKIGxpc3AvcmVjZW50Zi5lbCB8IDIxICsrKysrKysrKysrKysrKysrKysr KwogMiBmaWxlcyBjaGFuZ2VkLCAyOCBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvZXRjL05F V1MgYi9ldGMvTkVXUwppbmRleCBlZjM2ZGY1MmVjMS4uYmRhYjk3YjcwYTIgMTAwNjQ0Ci0tLSBh L2V0Yy9ORVdTCisrKyBiL2V0Yy9ORVdTCkBAIC0xNzczLDYgKzE3NzMsMTMgQEAgbWVzc2FnZXMu ICBUbyBzdXBwcmVzcyB0aGVzZSBtZXNzYWdlcywgY3VzdG9taXplIHRoZSB1c2VyIG9wdGlvbgog J3JlY2VudGYtc3VwcHJlc3Mtb3Blbi1maWxlLWhlbHAnIHRvIG5vbi1uaWwuICBUaGUgZGVmYXVs dCB2YWx1ZSBvZiB0aGlzCiBvcHRpb24gaXMgbmlsLgogCistLS0KKyoqKiBOZXcgdXNlciBvcHRp b24gYW5kIGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJy4KK0Fk ZCB0aGUgbmV3IGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyB0 byB0aGUgbGlzdAorJ3JlY2VudGYtZXhjbHVkZScgdG8gaWdub3JlIGZpbGVzIHdob3NlIGV4dGVu c2lvbnMgYXJlIGxpc3RlZCBpbiB0aGUKK3VzZXIgb3B0aW9uIG9mIHRoZSBzYW1lIG5hbWUgJ3Jl Y2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMnLiAgSWYKK3RoYXQgb3B0aW9uIGlzIG5p bCwgJ2NvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJyBpcyB1c2VkLgorCiAqKiBTYXZlcGxh Y2UKIAogLS0tCmRpZmYgLS1naXQgYS9saXNwL3JlY2VudGYuZWwgYi9saXNwL3JlY2VudGYuZWwK aW5kZXggMWFlMmRkNjYyYjkuLjRjODJjYWVmNTVjIDEwMDY0NAotLS0gYS9saXNwL3JlY2VudGYu ZWwKKysrIGIvbGlzcC9yZWNlbnRmLmVsCkBAIC0xMTUsNiArMTE1LDI3IEBAIHJlY2VudGYtZXhj bHVkZQogICA6Z3JvdXAgJ3JlY2VudGYKICAgOnR5cGUgJyhyZXBlYXQgKGNob2ljZSByZWdleHAg ZnVuY3Rpb24pKSkKIAorKGRlZmN1c3RvbSByZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNp b25zIG5pbAorICAiT3B0aW9uYWxseSBpZ25vcmUgZmlsZSBuYW1lcyBlbmRpbmcgaW4gYW55IHN0 cmluZyBpbiB0aGlzIGxpc3QuCitUbyB1c2UgdGhpcywgYWRkIHRoZSBmdW5jdGlvbiBgcmVjZW50 Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucycgdG8KK3RoZSBsaXN0IGByZWNlbnRmLWV4Y2x1 ZGUnLgorSWYgdGhpcyBvcHRpb24gaXMgbmlsLCB1c2UgdGhlIHZhbHVlcyBmcm9tIHRoZSB2YXJp YWJsZQorYGNvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJywgd2hpY2ggc2VlLiIKKyAgOmdy b3VwICdyZWNlbnRmCisgIDp2ZXJzaW9uICIzMS4xIgorICA6dHlwZSAnKHJlcGVhdCBzdHJpbmcp KQorCisoZGVmdW4gcmVjZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyAoZmlsZS1uYW1l KQorICAiUmV0dXJuIG5vbi1uaWwgaWYgRklMRS1OQU1FIGhhcyBhbiBpZ25vcmVkIGV4dGVuc2lv bi4KK1RoZSB1c2VyIG9wdGlvbiBgY29tcGxldGlvbi1pZ25vcmVkLWV4dGVuc2lvbnMnIGRldGVy bWluZXMgd2hldGhlciBvcgorbm90IGEgZmlsZSBleHRlbnNpb24gY291bnRzIGFzIGlnbm9yZWQu ICBZb3UgY2FuIGFkZCB0aGlzIGZ1bmN0aW9uIHRvCitgcmVjZW50Zi1leGNsdWRlJy4iCisgICh3 aGVuLWxldCogKChleHRlbnNpb24gKGZpbGUtbmFtZS1leHRlbnNpb24gZmlsZS1uYW1lKSkpCisg ICAgKHN0cmluZy1tYXRjaC1wCisgICAgIChyZWdleHAtb3B0IChvciByZWNlbnRmLWV4Y2x1ZGUt aWdub3JlZC1leHRlbnNpb25zCisgICAgICAgICAgICAgICAgICAgY29tcGxldGlvbi1pZ25vcmVk LWV4dGVuc2lvbnMpKQorICAgICAoY29uY2F0ICJcXC4iIChyZWdleHAtcXVvdGUgZXh0ZW5zaW9u KSAiXFwnIikpKSkKKwogKGRlZnVuIHJlY2VudGYtYWNjZXNzLWZpbGUgKGZpbGVuYW1lKQogICAi Q2hlY2sgd2hldGhlciBGSUxFTkFNRSBpcyBhY2Nlc3NpYmxlLiIKICAgKGlnbm9yZS1lcnJvcnMg KG5vdCAoYWNjZXNzLWZpbGUgZmlsZW5hbWUgIkNoZWNraW5nIHJlY2VudGYgZmlsZSIpKSkpCi0t IAoyLjUyLjAKCg== --00000000000024d8e0064c121d63--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 2 Mar 2026 22:14:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 17:14:53 2026 Received: from localhost ([127.0.0.1]:39120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vxBXQ-0000ie-Fc for submit <at> debbugs.gnu.org; Mon, 02 Mar 2026 17:14:53 -0500 Received: from mout01.posteo.de ([185.67.36.65]:35969) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1vxBXN-0000i4-Pc for 80347 <at> debbugs.gnu.org; Mon, 02 Mar 2026 17:14:50 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CFE9D240027 for <80347 <at> debbugs.gnu.org>; Mon, 2 Mar 2026 23:14:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1772489683; bh=gRxVCavjjVMkzuttf8fGHi7+sgs8n5nEb3jQqCMTdO4=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=QKIpWKgpecDeaR0g4iik8ZSRIr1taQHqWiKuLgFtZDIrEXMngecxjbqgPPv8T8jhl 5pbReX3IaFRTNBFHLpMhb25mdDL34HmbpwTRRhAqxIwscCS7lntyAIM0Rf3az3BKXz I/AQFjIHXd/zEDwL2gFQBDnpZZW4++ylHgoFIVhLdZ8M2WUruy0L3mYX035In8RznV BxQsOLvJZ3Xd28BJVmiuJhAzi6o69kULRSBls3CDXjyxN2XVmNjml3i5367CGoCiyH H3OcptKn15XU3rqC+U896DPE0ftHBxoF9IHXrrzJkVW8JKwNHZ1DcdWeAfynWQtkKL 8Q7zfC1tXe8kA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fPtX31qTJz9rxG; Mon, 2 Mar 2026 23:14:43 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Mon, 02 Mar 2026 22:14:43 +0000 Message-ID: <87ikbdg9pp.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.8 (-) St=C3=A9phane Marks <shipmints@HIDDEN> writes: > On Fri, Feb 27, 2026 at 1:27=E2=80=AFPM St=C3=A9phane Marks <shipmints@gm= ail.com> wrote: > >> On Fri, Feb 27, 2026 at 12:02=E2=80=AFPM Philip Kaludercic <philipk@post= eo.net> >> wrote: >> >>> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >>> >>> > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <philipk@po= steo.net> >>> > wrote: >>> > >>> >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >>> >> >>> >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton < >>> spwhitton@HIDDEN> >>> >> > wrote: >>> >> > >>> >> >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote: >>> >> >> > I have something like this as a lambda expression in my >>> configuration >>> >> >> > and I think it is useful to provide the utility OOTB. >>> >> >> >>> >> >> Sounds reasonable, though ideally it would be an option that shows >>> up >>> >> >> with a checkbox when you customise recentf-exclude. >>> >> >> >>> >> >> > We could also go further and just ignore ignored extesions by >>> default, >>> >> >> > to not litter the recentf list. >>> >> >> >>> >> >> I'm not a recentf user so I'm not sure about this. >>> >> > >>> >> > >>> >> > `recentf-exclude` seems sufficient and what I use. Isn't it kind = of >>> >> > trivial to add regexps (or a predicate function) to that list that >>> >> excludes >>> >> > extensions? >>> >> > >>> >> > (defcustom recentf-exclude nil >>> >> > "List of regexps and predicates for filenames excluded from the >>> recent >>> >> > list. >>> >> > When a filename matches any of the regexps or satisfies any of the >>> >> > predicates it is excluded from the recent list. >>> >> > A predicate is a function that is passed a filename to check and t= hat >>> >> > must return non-nil to exclude it." >>> >> >>> >> The function I propose is exactly for `recentf-exclude'. My take is >>> >> that this is a common enough use-case that not everyone has to >>> implement >>> >> the function on their own. >>> >> >>> > >>> > I got that. My point, made imprecisely, was I think it could be a >>> > documentation issue and we can recommend adding a lambda predicate of >>> the >>> > same code but I won't argue vehemently. >>> > >>> > (add-to-list 'recentf-exclude >>> > (lambda (file-name) >>> > (string-match-p >>> > (regexp-opt completion-ignored-extensions) >>> > (concat "\\." (regexp-quote (or (file-name-extension >>> > file-name) "")) "\\'")))) >>> >>> The advantage of having a function for me is that you can easily >>> recommend them in the user option type, instead of having to write code >>> inside of docstrings. >>> >>> > Your function has a couple of bugs. One is the order of arguments to >>> > `string-match-p` is reversed. The other is that file names that do n= ot >>> > have an extension return nil which `regexp-quote` doesn't like. >>> > >>> > This is better: >>> > >>> > (defun recentf-exclude-ignored-extensions (file-name) >>> > "Return non-nil if FILE-NAME has an ignored extension. >>> > The user option `completion-ignored-extensions' determines whether or >>> > not a file extension counts as ignored. You can add this function to >>> > `recentf-exclude'." >>> > (string-match-p >>> > (regexp-opt completion-ignored-extensions) >>> > (concat "\\." (regexp-quote (or (file-name-extension file-name) ""= )) >>> > "\\'"))) >>> >>> Thank you for double checking, do you want to prepare a patch with this >>> function? >>> >> >> Sure. Likely over the weekend. >> > > Patch attached. I also added a user option of the same name should people > not want to default to the values on 'completion-ignored-extensions'. I am not sure that we really need that... If users need some special behavior they can just implement their own function, right? At least it defaults to `completion-ignored-extensions', so I guess it is fine. > -St=C3=A9phane > From dbc8ecb930a62254c5f5800bfb0ef68ec40de3ad Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?St=3DC3=3DA9phane=3D20Marks?=3D <shipmints@HIDDEN> > Date: Mon, 2 Mar 2026 14:24:53 -0500 > Subject: [PATCH] New user option and function > 'recentf-exclude-ignored-extensions' (bug#80347) > > * lisp/recentf.el (recentf-exclude-ignored-extensions): New > defcustom. > (recentf-exclude-ignored-extensions): New defun. > * etc/NEWS: Announce the new option and function. > --- > etc/NEWS | 7 +++++++ > lisp/recentf.el | 21 +++++++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/etc/NEWS b/etc/NEWS > index ef36df52ec1..bdab97b70a2 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1773,6 +1773,13 @@ messages. To suppress these messages, customize t= he user option > 'recentf-suppress-open-file-help' to non-nil. The default value of this > option is nil. >=20=20 > +--- > +*** New user option and function 'recentf-exclude-ignored-extensions'. > +Add the new function 'recentf-exclude-ignored-extensions' to the list > +'recentf-exclude' to ignore files whose extensions are listed in the > +user option of the same name 'recentf-exclude-ignored-extensions'. If > +that option is nil, 'completion-ignored-extensions' is used. > + > ** Saveplace >=20=20 > --- > diff --git a/lisp/recentf.el b/lisp/recentf.el > index 1ae2dd662b9..ae519e40de1 100644 > --- a/lisp/recentf.el > +++ b/lisp/recentf.el > @@ -115,6 +115,27 @@ recentf-exclude > :group 'recentf > :type '(repeat (choice regexp function))) >=20=20 > +(defcustom recentf-exclude-ignored-extensions nil > + "Optionally ignore file names ending in any string in this list. > +To use this, add the function `recentf-exclude-ignored-extensions' to > +the list `recentf-exclude'. > +If this option is nil, use the values from the variable > +`completion-ignored-extensions', which see." > + :group 'recentf > + :version "31.1" > + :type '(repeat string)) > + > +(defun recentf-exclude-ignored-extensions (file-name) > + "Return non-nil if FILE-NAME has an ignored extension. > +The user option `completion-ignored-extensions' determines whether or > +not a file extension counts as ignored. You can add this function to > +`recentf-exclude'." > + (string-match-p > + (regexp-opt (or recentf-exclude-ignored-extensions Would `append' make sense? I guess the point is that you want to eliminate false positives of some kind? > + completion-ignored-extensions)) > + (concat "\\." (regexp-quote (or (file-name-extension file-name) "")) Why not catch this before constructing the regular expression? > + "\\'"))) > + > (defun recentf-access-file (filename) > "Check whether FILENAME is accessible." > (ignore-errors (not (access-file filename "Checking recentf file"))))
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 2 Mar 2026 19:28:01 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 14:28:01 2026 Received: from localhost ([127.0.0.1]:38131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vx8vw-0002MQ-Nd for submit <at> debbugs.gnu.org; Mon, 02 Mar 2026 14:28:01 -0500 Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]:50664) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>) id 1vx8vu-0002M7-GI for 80347 <at> debbugs.gnu.org; Mon, 02 Mar 2026 14:27:59 -0500 Received: by mail-ua1-x92e.google.com with SMTP id a1e0cc1a2514c-94b07fddecbso3206150241.1 for <80347 <at> debbugs.gnu.org>; Mon, 02 Mar 2026 11:27:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772479678; cv=none; d=google.com; s=arc-20240605; b=BsKVzdOKXwH2G9HiRKBBFrQZ5NKs0MNZYiKjK+h61mP+mFuQWDFL0QF/SDajgNNdTw lfOWn0nz3jH0OiusSMZ45rvAB38JmTRoNYPZJN0XO0G383stnW3h1DKfl5hN1WbAfh22 ybM3NwN5C9l/txJaC1K+6o0wpMYZGZ5Oy2++G9GHbvKAulAOu+11N9kRU6ExBEaRoN8j yXiW+ogBV1Ae7Ge1hfrMB0FyK95g2AzqJ9lve+p2SRbeBdWqPnKpxpuEsHsGlulqPV4V n5UviQlOcLwbkBeMI01oykjKP9EoCkdSWhTIt7DgxTeeyXNfsQfBXPXPXhJdBzUuvJnB pr7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GCl4XDnXel3HWZqmPxzxnipIP2RfBs41rNlbWMPNmVg=; fh=RsMemawpwP3Xa36+w8C432kp7DmVhe9QofKxV7Qpp1M=; b=LXSjcLG/h0+Zn5iwlmpTNmMcB25FRLe4YnIDXPnDkEL5Qv11zrXemA6cM0LX5zcoaQ i8Qtgj0HAtGXMf4AJhj4eRpbR/sIz3lU9V2+oexpNFb/XtklQ8LBLn3uF53LUzrFE8zW PA1WOOuZDaSfTdat9rWAJ1P0fhVkQRW7tJlnQi3hfB3MukkBb0F3iALbQCRL3Yd3Odt6 RfGVQ0RHm0Xg/UfQyZQTsWeBBUMytIGu41134xRJClEGyQh/evORVcxkztQzlSsDOQ86 7u9ZgfaNntzFP+1/Ie+qrEvZDg+tgbmg3A7k8c0uTIWlkVTYfWhu8lLLx1p5vEqXeGrG R1KQ==; darn=debbugs.gnu.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772479678; x=1773084478; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GCl4XDnXel3HWZqmPxzxnipIP2RfBs41rNlbWMPNmVg=; b=W7igrosBumbO+rtBPZFlh9k2mkhcctLJ8BlOc8evn0rQKyi4EMg6l/9kfnvEifdryY mwsdbBd8Lfi++CD/DG5IongTA65vsNWRE+/422hYBWIgcLiCH0ycdA+ipJS1F4wNZcRF Ob3uw3Ge8zmDwJAvn++qr+aeNl/Wyg2wt9ZNyJEbC8CPNrDK2HemrpCS0HPi8XL8x5Eo eS7QinqS3JREJAGGQo31PaFN1EWz5QLCCpwh4OatLYcAZkk/2DxHNmXhSbIVUbZ+dHD1 1N7nb2YZ7cTdbnW6nE9h5MNdTaUCPBAGN/FTu/S991whNXdTE0r+CJFqofwpkzq5EI1o 2kvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772479678; x=1773084478; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GCl4XDnXel3HWZqmPxzxnipIP2RfBs41rNlbWMPNmVg=; b=SIIRXAjdEHBNirB1AfltozmZPUuP9o/hoGc0aowREhEekCMgpVJY7PFCyWfmv74gdK z2lJQtKQIlLz9Z2JkRzCKTyUyJsPeqVZyozwS+6h7sXE2dxxNpW7BP4Kh0jAqtYuwXpM 0hTOyxIJENayVDcXxZ8FZCgpRAG40Mvy8IeUVg/3fp8ej8LjrFkORxyXJJR2yzo68wZx qg0kTRcgY29Z18qZrpB06ZN180w82PRmSu9XIcdc4FsoTjzWxh/5eMkOE/4rv5qLMWll pEIsRYz/q32JmK0dMWSKTMTLbfVJDbFvgpuCbEG/LkqZh0u6ARzco/BndCyifhGSYlwU xTFg== X-Forwarded-Encrypted: i=1; AJvYcCUFEbE/HTHe9P62amdTdJcdm1rwRp0nXLA0Qek+HNBj+3wV0pEJqnGNSF+laXmvxlLrteJC6Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy6jLknQZykr27IAeC0nV5pdtoWlhrBgR+oIAI9jJRNp0vvlFgZ WliXxSSQoot5I/RlTyprXyMEG4IVlI0xKWh4rBBBBID5GwP50Gk0HE9qtD7TnZq6p9+Fq/MgCcJ gJHjII28Ba9K3QfrSBto917+N9jBF0hM= X-Gm-Gg: ATEYQzyJReLLk242NQFHpPkkmoLQGdzf7XR0z/QC2Lk2DsURh1t/6grE47kuI/ymlYb 2sGdU+yC694V/jb3d+FODaXL9u50aD09blOcHxABW3r73mOKU1kCtK3K2O/mznT1Q+5ZNjdLDnC 28yOLrxOA8D3Za4RyNPROcUzffpEQnQEeRL4TeKmRhBgoyNL7cmQfwRt/ztYPOZ2DsLS/C/3Nqx BGKUUrhxm8aoPrGSutYnJw63prZLoO70cDfh45Wcd/6ScS+MtVYFWKAkXjsZ+y0lLmHK6JZvmKZ UPD+Rt7flZvRvfnwE5qvYE+LlVK8BgB6ghGFYE2xFxrmg2URF15qfg3X1b4Vfig= X-Received: by 2002:a05:6102:3ec9:b0:5e5:6360:1f60 with SMTP id ada2fe7eead31-5ff3258b948mr6477277137.41.1772479677661; Mon, 02 Mar 2026 11:27:57 -0800 (PST) MIME-Version: 1.0 References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> In-Reply-To: <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN> Date: Mon, 2 Mar 2026 14:27:44 -0500 X-Gm-Features: AaiRm53PyJgCiM3yt4OxxuLQZbR7LM4VnYpBPa0RkRDXn625E1n6g9QIoaIoEas Message-ID: <CAN+1HboNAQvScXcf8v_8BWBE1EkCLNJU5Gm07ADa1mDnq700Hw@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions To: Philip Kaludercic <philipk@HIDDEN> Content-Type: multipart/mixed; boundary="0000000000008f21db064c0f95f2" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --0000000000008f21db064c0f95f2 Content-Type: multipart/alternative; boundary="0000000000008f21db064c0f95f0" --0000000000008f21db064c0f95f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2026 at 1:27=E2=80=AFPM St=C3=A9phane Marks <shipmints@gmai= l.com> wrote: > On Fri, Feb 27, 2026 at 12:02=E2=80=AFPM Philip Kaludercic <philipk@poste= o.net> > wrote: > >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >> >> > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <philipk@pos= teo.net> >> > wrote: >> > >> >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >> >> >> >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton < >> spwhitton@HIDDEN> >> >> > wrote: >> >> > >> >> >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote: >> >> >> > I have something like this as a lambda expression in my >> configuration >> >> >> > and I think it is useful to provide the utility OOTB. >> >> >> >> >> >> Sounds reasonable, though ideally it would be an option that shows >> up >> >> >> with a checkbox when you customise recentf-exclude. >> >> >> >> >> >> > We could also go further and just ignore ignored extesions by >> default, >> >> >> > to not litter the recentf list. >> >> >> >> >> >> I'm not a recentf user so I'm not sure about this. >> >> > >> >> > >> >> > `recentf-exclude` seems sufficient and what I use. Isn't it kind o= f >> >> > trivial to add regexps (or a predicate function) to that list that >> >> excludes >> >> > extensions? >> >> > >> >> > (defcustom recentf-exclude nil >> >> > "List of regexps and predicates for filenames excluded from the >> recent >> >> > list. >> >> > When a filename matches any of the regexps or satisfies any of the >> >> > predicates it is excluded from the recent list. >> >> > A predicate is a function that is passed a filename to check and th= at >> >> > must return non-nil to exclude it." >> >> >> >> The function I propose is exactly for `recentf-exclude'. My take is >> >> that this is a common enough use-case that not everyone has to >> implement >> >> the function on their own. >> >> >> > >> > I got that. My point, made imprecisely, was I think it could be a >> > documentation issue and we can recommend adding a lambda predicate of >> the >> > same code but I won't argue vehemently. >> > >> > (add-to-list 'recentf-exclude >> > (lambda (file-name) >> > (string-match-p >> > (regexp-opt completion-ignored-extensions) >> > (concat "\\." (regexp-quote (or (file-name-extension >> > file-name) "")) "\\'")))) >> >> The advantage of having a function for me is that you can easily >> recommend them in the user option type, instead of having to write code >> inside of docstrings. >> >> > Your function has a couple of bugs. One is the order of arguments to >> > `string-match-p` is reversed. The other is that file names that do no= t >> > have an extension return nil which `regexp-quote` doesn't like. >> > >> > This is better: >> > >> > (defun recentf-exclude-ignored-extensions (file-name) >> > "Return non-nil if FILE-NAME has an ignored extension. >> > The user option `completion-ignored-extensions' determines whether or >> > not a file extension counts as ignored. You can add this function to >> > `recentf-exclude'." >> > (string-match-p >> > (regexp-opt completion-ignored-extensions) >> > (concat "\\." (regexp-quote (or (file-name-extension file-name) "")= ) >> > "\\'"))) >> >> Thank you for double checking, do you want to prepare a patch with this >> function? >> > > Sure. Likely over the weekend. > Patch attached. I also added a user option of the same name should people not want to default to the values on 'completion-ignored-extensions'. -St=C3=A9phane --0000000000008f21db064c0f95f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">= On Fri, Feb 27, 2026 at 1:27=E2=80=AFPM St=C3=A9phane Marks <<a href=3D"= mailto:shipmints@HIDDEN">shipmints@HIDDEN</a>> wrote:</span></div>= </div><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div style= =3D"font-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-= serif">On Fri, Feb 27, 2026 at 12:02=E2=80=AFPM Philip Kaludercic <<a hr= ef=3D"mailto:philipk@HIDDEN" target=3D"_blank">philipk@HIDDEN</a>&g= t; wrote:</span></div></div><div class=3D"gmail_quote"><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex">St=C3=A9phane Marks <<a href=3D"mailto:shi= pmints@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>> writes:<br> <br> > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <<a href= =3D"mailto:philipk@HIDDEN" target=3D"_blank">philipk@HIDDEN</a>>= <br> > wrote:<br> ><br> >> St=C3=A9phane Marks <<a href=3D"mailto:shipmints@HIDDEN" tar= get=3D"_blank">shipmints@HIDDEN</a>> writes:<br> >><br> >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <<a h= ref=3D"mailto:spwhitton@HIDDEN" target=3D"_blank">spwhitton@spwhitt= on.name</a>><br> >> > wrote:<br> >> ><br> >> >> Philip Kaludercic [07/Feb=C2=A0 2:15pm GMT] wrote:<br> >> >> > I have something like this as a lambda expression in= my configuration<br> >> >> > and I think it is useful to provide the utility OOTB= .<br> >> >><br> >> >> Sounds reasonable, though ideally it would be an option t= hat shows up<br> >> >> with a checkbox when you customise recentf-exclude.<br> >> >><br> >> >> > We could also go further and just ignore ignored ext= esions by default,<br> >> >> > to not litter the recentf list.<br> >> >><br> >> >> I'm not a recentf user so I'm not sure about this= .<br> >> ><br> >> ><br> >> > `recentf-exclude` seems sufficient and what I use.=C2=A0 Isn&= #39;t it kind of<br> >> > trivial to add regexps (or a predicate function) to that list= that<br> >> excludes<br> >> > extensions?<br> >> ><br> >> > (defcustom recentf-exclude nil<br> >> >=C2=A0 =C2=A0"List of regexps and predicates for filename= s excluded from the recent<br> >> > list.<br> >> > When a filename matches any of the regexps or satisfies any o= f the<br> >> > predicates it is excluded from the recent list.<br> >> > A predicate is a function that is passed a filename to check = and that<br> >> > must return non-nil to exclude it."<br> >><br> >> The function I propose is exactly for `recentf-exclude'.=C2=A0= My take is<br> >> that this is a common enough use-case that not everyone has to imp= lement<br> >> the function on their own.<br> >><br> ><br> > I got that.=C2=A0 My point, made imprecisely, was I think it could be = a<br> > documentation issue and we can recommend adding a lambda predicate of = the<br> > same code but I won't argue vehemently.<br> ><br> >=C2=A0 =C2=A0(add-to-list 'recentf-exclude<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (file-n= ame)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-= match-p<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r= egexp-opt completion-ignored-extensions)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(c= oncat "\\." (regexp-quote (or (file-name-extension<br> > file-name) "")) "\\'"))))<br> <br> The advantage of having a function for me is that you can easily<br> recommend them in the user option type, instead of having to write code<br> inside of docstrings.<br> <br> > Your function has a couple of bugs.=C2=A0 One is the order of argument= s to<br> > `string-match-p` is reversed.=C2=A0 The other is that file names that = do not<br> > have an extension return nil which `regexp-quote` doesn't like.<br= > ><br> > This is better:<br> ><br> > (defun recentf-exclude-ignored-extensions (file-name)<br> >=C2=A0 =C2=A0"Return non-nil if FILE-NAME has an ignored extension= .<br> > The user option `completion-ignored-extensions' determines whether= or<br> > not a file extension counts as ignored.=C2=A0 You can add this functio= n to<br> > `recentf-exclude'."<br> >=C2=A0 =C2=A0(string-match-p<br> >=C2=A0 =C2=A0 (regexp-opt completion-ignored-extensions)<br> >=C2=A0 =C2=A0 (concat "\\." (regexp-quote (or (file-name-exte= nsion file-name) ""))<br> > "\\'")))<br> <br> Thank you for double checking, do you want to prepare a patch with this<br> function?<br></blockquote><div><br></div><div style=3D"font-family:monospac= e">Sure. Likely over the weekend.</div></div></div></blockquote><div><br></= div><div class=3D"gmail_default" style=3D""><font face=3D"monospace">Patch = attached. I also added a user option of the same name should people not wan= t to default to the values on 'completion-ignored-extensions'.</fon= t></div><div class=3D"gmail_default" style=3D"font-family:monospace"><br></= div><div class=3D"gmail_default" style=3D"font-family:monospace">-St=C3=A9p= hane</div></div></div> --0000000000008f21db064c0f95f0-- --0000000000008f21db064c0f95f2 Content-Type: application/octet-stream; name="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Disposition: attachment; filename="0001-New-user-option-and-function-recentf-exclude-ignored.patch" Content-Transfer-Encoding: base64 Content-ID: <f_mm9kmjwu0> X-Attachment-Id: f_mm9kmjwu0 RnJvbSBkYmM4ZWNiOTMwYTYyMjU0YzVmNTgwMGJmYjBlZjY4ZWM0MGRlM2FkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/U3Q9QzM9QTlwaGFuZT0yME1hcmtzPz0gPHNo aXBtaW50c0BnbWFpbC5jb20+CkRhdGU6IE1vbiwgMiBNYXIgMjAyNiAxNDoyNDo1MyAtMDUwMApT dWJqZWN0OiBbUEFUQ0hdIE5ldyB1c2VyIG9wdGlvbiBhbmQgZnVuY3Rpb24KICdyZWNlbnRmLWV4 Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyAoYnVnIzgwMzQ3KQoKKiBsaXNwL3JlY2VudGYuZWwg KHJlY2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMpOiBOZXcKZGVmY3VzdG9tLgoocmVj ZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyk6IE5ldyBkZWZ1bi4KKiBldGMvTkVXUzog QW5ub3VuY2UgdGhlIG5ldyBvcHRpb24gYW5kIGZ1bmN0aW9uLgotLS0KIGV0Yy9ORVdTICAgICAg ICB8ICA3ICsrKysrKysKIGxpc3AvcmVjZW50Zi5lbCB8IDIxICsrKysrKysrKysrKysrKysrKysr KwogMiBmaWxlcyBjaGFuZ2VkLCAyOCBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvZXRjL05F V1MgYi9ldGMvTkVXUwppbmRleCBlZjM2ZGY1MmVjMS4uYmRhYjk3YjcwYTIgMTAwNjQ0Ci0tLSBh L2V0Yy9ORVdTCisrKyBiL2V0Yy9ORVdTCkBAIC0xNzczLDYgKzE3NzMsMTMgQEAgbWVzc2FnZXMu ICBUbyBzdXBwcmVzcyB0aGVzZSBtZXNzYWdlcywgY3VzdG9taXplIHRoZSB1c2VyIG9wdGlvbgog J3JlY2VudGYtc3VwcHJlc3Mtb3Blbi1maWxlLWhlbHAnIHRvIG5vbi1uaWwuICBUaGUgZGVmYXVs dCB2YWx1ZSBvZiB0aGlzCiBvcHRpb24gaXMgbmlsLgogCistLS0KKyoqKiBOZXcgdXNlciBvcHRp b24gYW5kIGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJy4KK0Fk ZCB0aGUgbmV3IGZ1bmN0aW9uICdyZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNpb25zJyB0 byB0aGUgbGlzdAorJ3JlY2VudGYtZXhjbHVkZScgdG8gaWdub3JlIGZpbGVzIHdob3NlIGV4dGVu c2lvbnMgYXJlIGxpc3RlZCBpbiB0aGUKK3VzZXIgb3B0aW9uIG9mIHRoZSBzYW1lIG5hbWUgJ3Jl Y2VudGYtZXhjbHVkZS1pZ25vcmVkLWV4dGVuc2lvbnMnLiAgSWYKK3RoYXQgb3B0aW9uIGlzIG5p bCwgJ2NvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJyBpcyB1c2VkLgorCiAqKiBTYXZlcGxh Y2UKIAogLS0tCmRpZmYgLS1naXQgYS9saXNwL3JlY2VudGYuZWwgYi9saXNwL3JlY2VudGYuZWwK aW5kZXggMWFlMmRkNjYyYjkuLmFlNTE5ZTQwZGUxIDEwMDY0NAotLS0gYS9saXNwL3JlY2VudGYu ZWwKKysrIGIvbGlzcC9yZWNlbnRmLmVsCkBAIC0xMTUsNiArMTE1LDI3IEBAIHJlY2VudGYtZXhj bHVkZQogICA6Z3JvdXAgJ3JlY2VudGYKICAgOnR5cGUgJyhyZXBlYXQgKGNob2ljZSByZWdleHAg ZnVuY3Rpb24pKSkKIAorKGRlZmN1c3RvbSByZWNlbnRmLWV4Y2x1ZGUtaWdub3JlZC1leHRlbnNp b25zIG5pbAorICAiT3B0aW9uYWxseSBpZ25vcmUgZmlsZSBuYW1lcyBlbmRpbmcgaW4gYW55IHN0 cmluZyBpbiB0aGlzIGxpc3QuCitUbyB1c2UgdGhpcywgYWRkIHRoZSBmdW5jdGlvbiBgcmVjZW50 Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucycgdG8KK3RoZSBsaXN0IGByZWNlbnRmLWV4Y2x1 ZGUnLgorSWYgdGhpcyBvcHRpb24gaXMgbmlsLCB1c2UgdGhlIHZhbHVlcyBmcm9tIHRoZSB2YXJp YWJsZQorYGNvbXBsZXRpb24taWdub3JlZC1leHRlbnNpb25zJywgd2hpY2ggc2VlLiIKKyAgOmdy b3VwICdyZWNlbnRmCisgIDp2ZXJzaW9uICIzMS4xIgorICA6dHlwZSAnKHJlcGVhdCBzdHJpbmcp KQorCisoZGVmdW4gcmVjZW50Zi1leGNsdWRlLWlnbm9yZWQtZXh0ZW5zaW9ucyAoZmlsZS1uYW1l KQorICAiUmV0dXJuIG5vbi1uaWwgaWYgRklMRS1OQU1FIGhhcyBhbiBpZ25vcmVkIGV4dGVuc2lv bi4KK1RoZSB1c2VyIG9wdGlvbiBgY29tcGxldGlvbi1pZ25vcmVkLWV4dGVuc2lvbnMnIGRldGVy bWluZXMgd2hldGhlciBvcgorbm90IGEgZmlsZSBleHRlbnNpb24gY291bnRzIGFzIGlnbm9yZWQu ICBZb3UgY2FuIGFkZCB0aGlzIGZ1bmN0aW9uIHRvCitgcmVjZW50Zi1leGNsdWRlJy4iCisgIChz dHJpbmctbWF0Y2gtcAorICAgKHJlZ2V4cC1vcHQgKG9yIHJlY2VudGYtZXhjbHVkZS1pZ25vcmVk LWV4dGVuc2lvbnMKKyAgICAgICAgICAgICAgICAgICBjb21wbGV0aW9uLWlnbm9yZWQtZXh0ZW5z aW9ucykpCisgICAoY29uY2F0ICJcXC4iIChyZWdleHAtcXVvdGUgKG9yIChmaWxlLW5hbWUtZXh0 ZW5zaW9uIGZpbGUtbmFtZSkgIiIpKQorICAgICAgICAgICAiXFwnIikpKQorCiAoZGVmdW4gcmVj ZW50Zi1hY2Nlc3MtZmlsZSAoZmlsZW5hbWUpCiAgICJDaGVjayB3aGV0aGVyIEZJTEVOQU1FIGlz IGFjY2Vzc2libGUuIgogICAoaWdub3JlLWVycm9ycyAobm90IChhY2Nlc3MtZmlsZSBmaWxlbmFt ZSAiQ2hlY2tpbmcgcmVjZW50ZiBmaWxlIikpKSkKLS0gCjIuNTIuMAoK --0000000000008f21db064c0f95f2--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 27 Feb 2026 18:27:56 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 27 13:27:56 2026 Received: from localhost ([127.0.0.1]:50533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vw2Z9-000395-F1 for submit <at> debbugs.gnu.org; Fri, 27 Feb 2026 13:27:56 -0500 Received: from mail-ua1-x92a.google.com ([2607:f8b0:4864:20::92a]:48474) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>) id 1vw2Z6-00038n-1I for 80347 <at> debbugs.gnu.org; Fri, 27 Feb 2026 13:27:54 -0500 Received: by mail-ua1-x92a.google.com with SMTP id a1e0cc1a2514c-94ddba39060so720052241.1 for <80347 <at> debbugs.gnu.org>; Fri, 27 Feb 2026 10:27:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772216871; cv=none; d=google.com; s=arc-20240605; b=kOmjBnP9zj15ymZxDqpOVwhhYjHX/4J16iEnJ53aDA1g+gOAKBO5uGENhnl9tgpsih ajzXrHP/A0Rf+Qt48LovaqzdYLfx5xcf3iPniGI9mpjUrX3JoFnUdlDeJAxoSNmbItZC /7Yc/C4h6OE5ypPei+VYHwVmCFakzu9xWeV4ZBug9GtF5Mnlh9PHxltt9uGf35QYx5mh D8/I3jMkcoSYwz9nAnAXzN6A6ifVNZ6C8l9+K6cnFTxusXSiUIiPp+gWD3beh/QWTDyQ E7/toScps/1azN7otJpLkufyE78o4cc6HtTKTgqrUsV+iNlOn4IEbHQCAeyX62FpILj2 stzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Sby8p6X7x5GLkLiQDMN81p0LdG7v5gkm1nuFhdWk2xc=; fh=eb55aqvk7XPx9v2Y60XcBDAAUJkHWxSU3iMuhQyoS7Q=; b=Y97a3UA7yEZKlEoBbsQ0LYMcseOsOWteEnlo3HmaSvZmMTNjmnNaohHu30tavcXvh4 T4nWnKmIh2XxnA0m2VBQi+IwH+gY4zYL17pghjNVSGASLSL5MgbWV/EOPQosGii/fB/t NJZ/SL3qZI8jskyD0r2r++9nhZPSNyD3POePbzGvaDxT1A9QcW5K9qYtdIK39GhZ5ZFy EG/jX9UJxjxjNGJE/6Xn2+xkPIhe2TdktF0vfYNW7yDW4n6OG4xxeajApXt/u58WRLT1 oR2EJ1nojMPBlJGeL+mEVzmRMEtpBVjevHjrcHXvoa7opGZRDrSMTYU5itLHNix0WZ+X BCUA==; darn=debbugs.gnu.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772216871; x=1772821671; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Sby8p6X7x5GLkLiQDMN81p0LdG7v5gkm1nuFhdWk2xc=; b=QnJfqDhO1RedexssGz++Bm9NHM/ZWf0wh0j4KGS3MJ1wl4m7UZqhPF8uB+YWc62qJW liM2ppRM8HzVJqozBF+y0Wj7grqJ0BNdnR6TVtUtWUh+0GWv+IoBkniHODWS1Fp2fFKS teQCa6mmKylFqp+rZof9zxlbhjCDIDGHl+2y4zugScsTrCOfdg6sxWwVqqhUQgbWbw+Q 3aQhOWI4z+LlyRH7sut+6z0bRUVMbtd28TKz9WHarSSoIADF5Ao5UilMWNLmkNC0H10o 0mb5+d2jZPSdCwrrXgser5G0Pm/gHxmMgSXVoplZn1l0meFqzctf/032d8NBOKsyup9i 3VNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772216871; x=1772821671; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Sby8p6X7x5GLkLiQDMN81p0LdG7v5gkm1nuFhdWk2xc=; b=VgG3k3GtMZZ2pOJaAVR5uuUXNL9BIdZpGWmnrMRlA/WH7t5e5yVPOs5C09L7prkg6O 9anThH8P/JbnfjBAwwiVJX1icPVx/v+Q9ylB5hLEXWZACN/FALm4M8rFYevHWYDu0RIG OvBxh+zuMLHuQTDxfcUd194LTqGpPWXrFUFu7iOe7IlsemXJVKtuRNmqMdF7XpMxlmc8 H0otrcQqKJF3GwmQeXz0sY7RClPymg8JYEMX+EMSjdYmTbm+hJ3ABlKse8/z7SrTsawf opS6XhM/lDlV7/9JGlYOIW4sydJBlLhzwiI/GBeUATqyg6YAPeduK+NCpBcuh7ojX4zH bZnA== X-Forwarded-Encrypted: i=1; AJvYcCU+9dzNyV3Rl2LsxnUhMEaOBKSEkQO7aQ1HSp5OrIVlttmoWoc1aUZSSFDfYCRHliNAnpnULQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzubBU25e8e2/th3oEuI1vCAQABYGLA1iIONL/ruBtrF9wPEoev sIg/FvQK3WNymZIMrgEr7GF6KC/Bw1PTWp3GcLGJJJwi4cSJlNyo5QGZHZVL21Afz+Lg3SkT9+w wcrOe1j8I8a0bpUSZvjPQcOjW+E9H4Dc= X-Gm-Gg: ATEYQzx1bEck21ROxU4NUPfiisLnE+5v+bBaEmrWek0M/U8vs8/IRuGrbV47eworB4J pPRSMWSkAWIMLVtwo98TpfLVcZinGQrv1CYEvbZJszxoIPkN8MuKLrjMjqROiHdl9V7PKIthq+N Qu/C6iNOCsIv8JwAtci29HRiy3Fw7sAf5WUb+0X+XRw5Et7W9Ov01UveiWnJbTau6geAtlqQ70K STcxeNQT6ic5dkuRkEazhMo3TPBJCLoABbNFnUwoT/jhEqGosj1SMm7zdre0NOnCaIF8lqWv5sX gwbhWnsKSaXzVBrbhLpKj9PguFKHsg5fFZ7xF9LxgvFmY05hxnIlonFLuIXuDZs= X-Received: by 2002:a05:6102:3ecf:b0:5ff:1cc2:aa94 with SMTP id ada2fe7eead31-5ff324bd3b2mr1924373137.26.1772216871148; Fri, 27 Feb 2026 10:27:51 -0800 (PST) MIME-Version: 1.0 References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> <87tsv215nu.fsf@HIDDEN> In-Reply-To: <87tsv215nu.fsf@HIDDEN> From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN> Date: Fri, 27 Feb 2026 13:27:40 -0500 X-Gm-Features: AaiRm51QRJWgBa0A6XJrL3cB0qkAmzLVxF7R4Bu6TZChbDXi4DOy6ff3mq_q4Go Message-ID: <CAN+1HbroRBm=rH8PE20d8P=djqvxtqy7rz-UuH3tKe9WEQ+PRg@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions To: Philip Kaludercic <philipk@HIDDEN> Content-Type: multipart/alternative; boundary="00000000000011e252064bd2651b" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --00000000000011e252064bd2651b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2026 at 12:02=E2=80=AFPM Philip Kaludercic <philipk@posteo.= net> wrote: > St=C3=A9phane Marks <shipmints@HIDDEN> writes: > > > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <philipk@post= eo.net> > > wrote: > > > >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: > >> > >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton < > spwhitton@HIDDEN> > >> > wrote: > >> > > >> >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote: > >> >> > I have something like this as a lambda expression in my > configuration > >> >> > and I think it is useful to provide the utility OOTB. > >> >> > >> >> Sounds reasonable, though ideally it would be an option that shows = up > >> >> with a checkbox when you customise recentf-exclude. > >> >> > >> >> > We could also go further and just ignore ignored extesions by > default, > >> >> > to not litter the recentf list. > >> >> > >> >> I'm not a recentf user so I'm not sure about this. > >> > > >> > > >> > `recentf-exclude` seems sufficient and what I use. Isn't it kind of > >> > trivial to add regexps (or a predicate function) to that list that > >> excludes > >> > extensions? > >> > > >> > (defcustom recentf-exclude nil > >> > "List of regexps and predicates for filenames excluded from the > recent > >> > list. > >> > When a filename matches any of the regexps or satisfies any of the > >> > predicates it is excluded from the recent list. > >> > A predicate is a function that is passed a filename to check and tha= t > >> > must return non-nil to exclude it." > >> > >> The function I propose is exactly for `recentf-exclude'. My take is > >> that this is a common enough use-case that not everyone has to impleme= nt > >> the function on their own. > >> > > > > I got that. My point, made imprecisely, was I think it could be a > > documentation issue and we can recommend adding a lambda predicate of t= he > > same code but I won't argue vehemently. > > > > (add-to-list 'recentf-exclude > > (lambda (file-name) > > (string-match-p > > (regexp-opt completion-ignored-extensions) > > (concat "\\." (regexp-quote (or (file-name-extension > > file-name) "")) "\\'")))) > > The advantage of having a function for me is that you can easily > recommend them in the user option type, instead of having to write code > inside of docstrings. > > > Your function has a couple of bugs. One is the order of arguments to > > `string-match-p` is reversed. The other is that file names that do not > > have an extension return nil which `regexp-quote` doesn't like. > > > > This is better: > > > > (defun recentf-exclude-ignored-extensions (file-name) > > "Return non-nil if FILE-NAME has an ignored extension. > > The user option `completion-ignored-extensions' determines whether or > > not a file extension counts as ignored. You can add this function to > > `recentf-exclude'." > > (string-match-p > > (regexp-opt completion-ignored-extensions) > > (concat "\\." (regexp-quote (or (file-name-extension file-name) "")) > > "\\'"))) > > Thank you for double checking, do you want to prepare a patch with this > function? > Sure. Likely over the weekend. --00000000000011e252064bd2651b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">= On Fri, Feb 27, 2026 at 12:02=E2=80=AFPM Philip Kaludercic <<a href=3D"m= ailto:philipk@HIDDEN">philipk@HIDDEN</a>> wrote:</span></div></d= iv><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex">St=C3=A9phane Marks <<a href=3D"mailto:shipmi= nts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>> writes:<br> <br> > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <<a href= =3D"mailto:philipk@HIDDEN" target=3D"_blank">philipk@HIDDEN</a>>= <br> > wrote:<br> ><br> >> St=C3=A9phane Marks <<a href=3D"mailto:shipmints@HIDDEN" tar= get=3D"_blank">shipmints@HIDDEN</a>> writes:<br> >><br> >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <<a h= ref=3D"mailto:spwhitton@HIDDEN" target=3D"_blank">spwhitton@spwhitt= on.name</a>><br> >> > wrote:<br> >> ><br> >> >> Philip Kaludercic [07/Feb=C2=A0 2:15pm GMT] wrote:<br> >> >> > I have something like this as a lambda expression in= my configuration<br> >> >> > and I think it is useful to provide the utility OOTB= .<br> >> >><br> >> >> Sounds reasonable, though ideally it would be an option t= hat shows up<br> >> >> with a checkbox when you customise recentf-exclude.<br> >> >><br> >> >> > We could also go further and just ignore ignored ext= esions by default,<br> >> >> > to not litter the recentf list.<br> >> >><br> >> >> I'm not a recentf user so I'm not sure about this= .<br> >> ><br> >> ><br> >> > `recentf-exclude` seems sufficient and what I use.=C2=A0 Isn&= #39;t it kind of<br> >> > trivial to add regexps (or a predicate function) to that list= that<br> >> excludes<br> >> > extensions?<br> >> ><br> >> > (defcustom recentf-exclude nil<br> >> >=C2=A0 =C2=A0"List of regexps and predicates for filename= s excluded from the recent<br> >> > list.<br> >> > When a filename matches any of the regexps or satisfies any o= f the<br> >> > predicates it is excluded from the recent list.<br> >> > A predicate is a function that is passed a filename to check = and that<br> >> > must return non-nil to exclude it."<br> >><br> >> The function I propose is exactly for `recentf-exclude'.=C2=A0= My take is<br> >> that this is a common enough use-case that not everyone has to imp= lement<br> >> the function on their own.<br> >><br> ><br> > I got that.=C2=A0 My point, made imprecisely, was I think it could be = a<br> > documentation issue and we can recommend adding a lambda predicate of = the<br> > same code but I won't argue vehemently.<br> ><br> >=C2=A0 =C2=A0(add-to-list 'recentf-exclude<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (file-n= ame)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-= match-p<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r= egexp-opt completion-ignored-extensions)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(c= oncat "\\." (regexp-quote (or (file-name-extension<br> > file-name) "")) "\\'"))))<br> <br> The advantage of having a function for me is that you can easily<br> recommend them in the user option type, instead of having to write code<br> inside of docstrings.<br> <br> > Your function has a couple of bugs.=C2=A0 One is the order of argument= s to<br> > `string-match-p` is reversed.=C2=A0 The other is that file names that = do not<br> > have an extension return nil which `regexp-quote` doesn't like.<br= > ><br> > This is better:<br> ><br> > (defun recentf-exclude-ignored-extensions (file-name)<br> >=C2=A0 =C2=A0"Return non-nil if FILE-NAME has an ignored extension= .<br> > The user option `completion-ignored-extensions' determines whether= or<br> > not a file extension counts as ignored.=C2=A0 You can add this functio= n to<br> > `recentf-exclude'."<br> >=C2=A0 =C2=A0(string-match-p<br> >=C2=A0 =C2=A0 (regexp-opt completion-ignored-extensions)<br> >=C2=A0 =C2=A0 (concat "\\." (regexp-quote (or (file-name-exte= nsion file-name) ""))<br> > "\\'")))<br> <br> Thank you for double checking, do you want to prepare a patch with this<br> function?<br></blockquote><div><br></div><div class=3D"gmail_default" style= =3D"font-family:monospace">Sure. Likely over the weekend.</div></div></div> --00000000000011e252064bd2651b--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 27 Feb 2026 17:02:24 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 27 12:02:24 2026 Received: from localhost ([127.0.0.1]:50210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vw1EO-0004Il-Bu for submit <at> debbugs.gnu.org; Fri, 27 Feb 2026 12:02:24 -0500 Received: from mout01.posteo.de ([185.67.36.65]:40555) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1vw1EL-0004IL-B0 for 80347 <at> debbugs.gnu.org; Fri, 27 Feb 2026 12:02:22 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3A632240028 for <80347 <at> debbugs.gnu.org>; Fri, 27 Feb 2026 18:02:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1772211735; bh=gdq+iJxab4vt3Q9jEc1Wz78bM1fhe//YR9S1uv0FOCw=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=Cm3V5zAIiwN/GK1OLVdhfqMkASaO7sdDSHf+xZOargeQT8yQw+nsiQxcSZp2SV2Ef dk4D3uSR5S++yspTDn+nq8x4Eeh5Sko8Ex3gpG7XxZ+6zVLWl2QfVyPDHAR2NIS3RO puvbixNctD5mpfMgai5phF2KbADL0tzPF8pK5+ttLRcSHQ33zVrwxnYJxX3APd/brc lME3Bs+lRbSP+pYXkDtgGJY0kXpc4SOu37ueWqgVjGqxCQCggJxSk0VwlRO9CQP1uv XJfd94z08OOZoDyKbvLsPSnQvOkI65DqlkeYXEgDB5qAAqnrWMaBvzcCd/J01lWnqM Q1akgHrenl3GA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fMvkt45Hsz9rxF; Fri, 27 Feb 2026 18:02:14 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> <871pibgwsh.fsf@HIDDEN> <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN> OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Fri, 27 Feb 2026 17:02:15 +0000 Message-ID: <87tsv215nu.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.9 (-) St=C3=A9phane Marks <shipmints@HIDDEN> writes: > On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <philipk@posteo= .net> > wrote: > >> St=C3=A9phane Marks <shipmints@HIDDEN> writes: >> >> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <spwhitton@spwhit= ton.name> >> > wrote: >> > >> >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote: >> >> > I have something like this as a lambda expression in my configurati= on >> >> > and I think it is useful to provide the utility OOTB. >> >> >> >> Sounds reasonable, though ideally it would be an option that shows up >> >> with a checkbox when you customise recentf-exclude. >> >> >> >> > We could also go further and just ignore ignored extesions by defau= lt, >> >> > to not litter the recentf list. >> >> >> >> I'm not a recentf user so I'm not sure about this. >> > >> > >> > `recentf-exclude` seems sufficient and what I use. Isn't it kind of >> > trivial to add regexps (or a predicate function) to that list that >> excludes >> > extensions? >> > >> > (defcustom recentf-exclude nil >> > "List of regexps and predicates for filenames excluded from the rece= nt >> > list. >> > When a filename matches any of the regexps or satisfies any of the >> > predicates it is excluded from the recent list. >> > A predicate is a function that is passed a filename to check and that >> > must return non-nil to exclude it." >> >> The function I propose is exactly for `recentf-exclude'. My take is >> that this is a common enough use-case that not everyone has to implement >> the function on their own. >> > > I got that. My point, made imprecisely, was I think it could be a > documentation issue and we can recommend adding a lambda predicate of the > same code but I won't argue vehemently. > > (add-to-list 'recentf-exclude > (lambda (file-name) > (string-match-p > (regexp-opt completion-ignored-extensions) > (concat "\\." (regexp-quote (or (file-name-extension > file-name) "")) "\\'")))) The advantage of having a function for me is that you can easily recommend them in the user option type, instead of having to write code inside of docstrings. > Your function has a couple of bugs. One is the order of arguments to > `string-match-p` is reversed. The other is that file names that do not > have an extension return nil which `regexp-quote` doesn't like. > > This is better: > > (defun recentf-exclude-ignored-extensions (file-name) > "Return non-nil if FILE-NAME has an ignored extension. > The user option `completion-ignored-extensions' determines whether or > not a file extension counts as ignored. You can add this function to > `recentf-exclude'." > (string-match-p > (regexp-opt completion-ignored-extensions) > (concat "\\." (regexp-quote (or (file-name-extension file-name) "")) > "\\'"))) Thank you for double checking, do you want to prepare a patch with this function? > -St=C3=A9phane
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.
Received: (at 80347) by debbugs.gnu.org; 23 Feb 2026 18:36:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 23 13:36:58 2026
Received: from localhost ([127.0.0.1]:57162 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1vuanf-0007Wd-8i
for submit <at> debbugs.gnu.org; Mon, 23 Feb 2026 13:36:58 -0500
Received: from mail-ua1-x930.google.com ([2607:f8b0:4864:20::930]:50191)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
id 1vuanb-0007Vt-Bu
for 80347 <at> debbugs.gnu.org; Mon, 23 Feb 2026 13:36:52 -0500
Received: by mail-ua1-x930.google.com with SMTP id
a1e0cc1a2514c-948a2d37896so2620998241.0
for <80347 <at> debbugs.gnu.org>; Mon, 23 Feb 2026 10:36:51 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1771871810; cv=none;
d=google.com; s=arc-20240605;
b=iYFz50nb7OALdxMEx3ajgUJlZQjUu5obHQye510X+RboCrA4m7MpE1RtkaU7YDekQJ
0q6dBPDAVtRNOI2ZRFJswTLiDUldoVhJ+iXgU/w9zJgF036AoiEEfMe2MDMYCCWLLoRa
j4wwC9d7bv6+sxMDfmNi+p2THgxhIotdUbEGC1y3GZ+CNMegq43DCX8IgsIbhvRfLorG
kNbIAF9SqapVva4oxHdZGtzZ20Xmq1OtVgNAKQegwfnua4GSi7uUYXtpmknJKB9FV4KR
lzii3PLePvGx/JkzN6RR+qQvKxrAvrjdtbjnkzKfzu+kbRE2c0tg/MN/7dcSTAZdTUBV
nqlw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:dkim-signature;
bh=/rlqvx+Wdhybhj5zlYQ9XK/syGIolByxrFWuDTB+jUM=;
fh=nWWBJ0Xjn54LlZpcf87zf64XoSO64KCznhT4ziBAzWQ=;
b=AosDi2qzUWgxDx4rMHGDu+Gi0IktdHpUD41Lsi1OxFfCu/5jPe7eg+S7cFdsntaror
2DhomtM6JdwIZUoatizQUqQI/4rCQHoeeVVGB2qW4vqzearwv69CcXPCuHDfgStiJCle
ipefmi0e+DPFA9fSU/vaG1/kzMJUyzLNXiePR7iW975q6XZigBTN7fPFTzvfREvRor3a
mXeqr1DQd7qWnHXyyPw165SR3KYQ+ewcL3juHBX3trBOAlIP3OFphG3E/zI4zoP+QGGO
vcqTRiwN3hqVs+VJH+9AgUB+4cjMbisKboW40A6+q/Evt+idaApkjgabq+zE11OGdU2Y
fhug==; darn=debbugs.gnu.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1771871810; x=1772476610; darn=debbugs.gnu.org;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=/rlqvx+Wdhybhj5zlYQ9XK/syGIolByxrFWuDTB+jUM=;
b=LvDHW4OEI1UZs4jS9Fe4jxiyzHv8b07PZyrtfvCD5PxYUBrsxVf0zBTQFoQ2foQDx0
ZQvHZKqD6KzRrOJJT4f2fYIgDDZWUwup4/QnyXz29VKBPTB+izu3huIWO81gwbgYZgc4
UwwdZFTY2zSv+NnIE3etTahJ4pbr4iIB9DV4Nh7Ced5C3ti/xNSy2FUMaczteF6gPR2W
ptd/K/lHohPmK5jo7OxJn0kE0ybM3TGMrb0Kg1qME/XKRdDfBbkNrzbHw55K2T9QIQJe
iA0zohlSlPFZHPyvbLeUnZgzYHhVSvnmYDlu1kYnLgd7hB6KdAmLXzSo6guq6y4UgbAP
YYFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1771871810; x=1772476610;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to;
bh=/rlqvx+Wdhybhj5zlYQ9XK/syGIolByxrFWuDTB+jUM=;
b=QxBpLwyOUzExnV+Z/dfHC3m3qalL/NJfpDqrVGSXRAAAT06zHWuAzTvZ/MoBgu/JqJ
J0ATH2CNsQPccLQs3Kc7ne2x4fiSDu5lQq8mGokeD10wEGUjpK32rmTGE/bMNGOgDDUi
GsrXQdgwwp6+Rs3fO8zsbU9MuVOM95ZeJjJcYXUQB4lYpM9zR6PWw+l5WiBicL2b2pmK
OjyJqD+j9f685BpHEhOwIWpjvfiwi/P7VmYAbVp06MDbrUJZs+zO2IZxdeDQGa4v3p7K
pXfrtNACz1tWt+0t1RPTaqj4anGz94jsUJgxo1HOq1x+EnmzOAm1WvoQ8bJJpM/rOIOD
Twyw==
X-Forwarded-Encrypted: i=1;
AJvYcCWOGiGlL6682PsJNJgQZEwVLSiORhfqCaQkMbbxIIR7iiX/Ts80NmRyM5CoDu4RdZvP+875XQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwCGUfJPCmEDCG70HN1yWq2dCyfWvcB8ma/cg0Ebry7Up5J1x7f
eltm3YJBXN5jaydDAaxSzLAAxR4usRIT92jzyyhFWDgv+/jjFJF1vo5AsVbA2HV9xHr5QMvFEoJ
qrhZ6Ir4IKcBfh9b/28GYoEjrME/Cnk8=
X-Gm-Gg: AZuq6aIhiCbbmniMIk6oXjze4c4fCwyvBgwFVEhlilLVtdhawvRhjOaHZYfRuOnb1tD
HndieZoRi9xhQrbYKVJCMHCefz9pN74mEC5cam+P0+i+vMW5zxVAE8kTt+8MIZRK4e86k1JH7l1
WmcvBNlLKuRwKQxGDizxP8ghxevHPlDD6WtuW0pUoFx6s2IBuZZwMi4AGHZFpFHFMpHJHgvCgGU
g5Y3rrpmB+vOdbzx2h7s+JWxnKFOdBEeVOIFMgLxXHwh3t/dBgVgYuI5HA7L13TzBh+pkoYpHO0
zE5kjdXO21SpGfYAqHqGAun2X/coK/KS3OfjqDzevC45NUIMISTz7G7Vrw+teaE=
X-Received: by 2002:a05:6102:304e:b0:5ee:a0e6:a9f4 with SMTP id
ada2fe7eead31-5feb2eeb115mr4959179137.12.1771871810411; Mon, 23 Feb 2026
10:36:50 -0800 (PST)
MIME-Version: 1.0
References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN>
<CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN>
<871pibgwsh.fsf@HIDDEN>
In-Reply-To: <871pibgwsh.fsf@HIDDEN>
From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN>
Date: Mon, 23 Feb 2026 13:36:39 -0500
X-Gm-Features: AaiRm52_FLGIe7gArRjcZZ1Pe36v5cjs_lsHyeDMlB4aa1lJCVgtZb-Fu7ap3SA
Message-ID: <CAN+1Hbo5n+Ang4xdVQ1CNEmLoVQrWn4ksnnP5zdkG7VOqQZp-g@HIDDEN>
Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored
extensions
To: Philip Kaludercic <philipk@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000d8e07b064b820d27"
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 80347
Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)
--000000000000d8e07b064b820d27
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <philipk@HIDDEN=
et>
wrote:
> St=C3=A9phane Marks <shipmints@HIDDEN> writes:
>
> > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <spwhitton@spwhitt=
on.name>
> > wrote:
> >
> >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote:
> >> > I have something like this as a lambda expression in my configuratio=
n
> >> > and I think it is useful to provide the utility OOTB.
> >>
> >> Sounds reasonable, though ideally it would be an option that shows up
> >> with a checkbox when you customise recentf-exclude.
> >>
> >> > We could also go further and just ignore ignored extesions by defaul=
t,
> >> > to not litter the recentf list.
> >>
> >> I'm not a recentf user so I'm not sure about this.
> >
> >
> > `recentf-exclude` seems sufficient and what I use. Isn't it kind of
> > trivial to add regexps (or a predicate function) to that list that
> excludes
> > extensions?
> >
> > (defcustom recentf-exclude nil
> > "List of regexps and predicates for filenames excluded from the recen=
t
> > list.
> > When a filename matches any of the regexps or satisfies any of the
> > predicates it is excluded from the recent list.
> > A predicate is a function that is passed a filename to check and that
> > must return non-nil to exclude it."
>
> The function I propose is exactly for `recentf-exclude'. My take is
> that this is a common enough use-case that not everyone has to implement
> the function on their own.
>
I got that. My point, made imprecisely, was I think it could be a
documentation issue and we can recommend adding a lambda predicate of the
same code but I won't argue vehemently.
(add-to-list 'recentf-exclude
(lambda (file-name)
(string-match-p
(regexp-opt completion-ignored-extensions)
(concat "\\." (regexp-quote (or (file-name-extension
file-name) "")) "\\'"))))
Your function has a couple of bugs. One is the order of arguments to
`string-match-p` is reversed. The other is that file names that do not
have an extension return nil which `regexp-quote` doesn't like.
This is better:
(defun recentf-exclude-ignored-extensions (file-name)
"Return non-nil if FILE-NAME has an ignored extension.
The user option `completion-ignored-extensions' determines whether or
not a file extension counts as ignored. You can add this function to
`recentf-exclude'."
(string-match-p
(regexp-opt completion-ignored-extensions)
(concat "\\." (regexp-quote (or (file-name-extension file-name) ""))
"\\'")))
-St=C3=A9phane
--000000000000d8e07b064b820d27
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Mon, Feb 23, 2026 at 1:05=E2=80=AFPM Philip Kaludercic <<a href=3D"ma=
ilto:philipk@HIDDEN">philipk@HIDDEN</a>> wrote:</span></div></di=
v><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex">St=C3=A9phane Marks <<a href=3D"mailto:shipmin=
ts@HIDDEN" target=3D"_blank">shipmints@HIDDEN</a>> writes:<br>
<br>
> On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <<a href=3D"ma=
ilto:spwhitton@HIDDEN" target=3D"_blank">spwhitton@HIDDEN</=
a>><br>
> wrote:<br>
><br>
>> Philip Kaludercic [07/Feb=C2=A0 2:15pm GMT] wrote:<br>
>> > I have something like this as a lambda expression in my confi=
guration<br>
>> > and I think it is useful to provide the utility OOTB.<br>
>><br>
>> Sounds reasonable, though ideally it would be an option that shows=
up<br>
>> with a checkbox when you customise recentf-exclude.<br>
>><br>
>> > We could also go further and just ignore ignored extesions by=
default,<br>
>> > to not litter the recentf list.<br>
>><br>
>> I'm not a recentf user so I'm not sure about this.<br>
><br>
><br>
> `recentf-exclude` seems sufficient and what I use.=C2=A0 Isn't it =
kind of<br>
> trivial to add regexps (or a predicate function) to that list that exc=
ludes<br>
> extensions?<br>
><br>
> (defcustom recentf-exclude nil<br>
>=C2=A0 =C2=A0"List of regexps and predicates for filenames exclude=
d from the recent<br>
> list.<br>
> When a filename matches any of the regexps or satisfies any of the<br>
> predicates it is excluded from the recent list.<br>
> A predicate is a function that is passed a filename to check and that<=
br>
> must return non-nil to exclude it."<br>
<br>
The function I propose is exactly for `recentf-exclude'.=C2=A0 My take =
is<br>
that this is a common enough use-case that not everyone has to implement<br=
>
the function on their own.<br></blockquote><div><br></div><div class=3D"gma=
il_default" style=3D"font-family:monospace">I got that.=C2=A0 My point, mad=
e imprecisely, was I think it could be=C2=A0a documentation issue and we ca=
n recommend adding a lambda predicate of the same code but I won't argu=
e vehemently.</div><div class=3D"gmail_default" style=3D"font-family:monosp=
ace"><br></div><div class=3D"gmail_default" style=3D"font-family:monospace"=
>=C2=A0 (add-to-list 'recentf-exclude<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (file-name)<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string-match-p<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (regexp-opt completion-ignore=
d-extensions)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 (concat "\\." (regexp-quote (or (file-name-extension file-=
name) "")) "\\'"))))<br><br></div><div class=3D"gma=
il_default" style=3D"font-family:monospace">Your function has a couple of b=
ugs.=C2=A0 One is the order of arguments to `string-match-p` is reversed.=
=C2=A0 The other is that file names that do not have an extension return ni=
l which `regexp-quote` doesn't like.</div><div class=3D"gmail_default" =
style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" styl=
e=3D"font-family:monospace">This is better:</div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" s=
tyle=3D"font-family:monospace">(defun recentf-exclude-ignored-extensions (f=
ile-name)<br>=C2=A0 "Return non-nil if FILE-NAME has an ignored extens=
ion.<br>The user option `completion-ignored-extensions' determines whet=
her or<br>not a file extension counts as ignored.=C2=A0 You can add this fu=
nction to<br>`recentf-exclude'."<br>=C2=A0 (string-match-p<br>=C2=
=A0 =C2=A0(regexp-opt completion-ignored-extensions)<br>=C2=A0 =C2=A0(conca=
t "\\." (regexp-quote (or (file-name-extension file-name) "&=
quot;)) "\\'")))</div><div class=3D"gmail_default" style=3D"f=
ont-family:monospace"><br></div><div class=3D"gmail_default" style=3D"font-=
family:monospace">-St=C3=A9phane=C2=A0</div></div></div>
--000000000000d8e07b064b820d27--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 23 Feb 2026 18:06:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 23 13:06:02 2026 Received: from localhost ([127.0.0.1]:56833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vuaJm-0002B0-88 for submit <at> debbugs.gnu.org; Mon, 23 Feb 2026 13:06:02 -0500 Received: from mout02.posteo.de ([185.67.36.66]:59957) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1vuaJi-00029g-Qf for 80347 <at> debbugs.gnu.org; Mon, 23 Feb 2026 13:06:00 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5A110240103 for <80347 <at> debbugs.gnu.org>; Mon, 23 Feb 2026 19:05:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1771869952; bh=6h307D0hUn6EfSIVxnmoykrI4olDC0KnSVCO5SpeSqA=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=KDynoj0hY+KFO06kSLf0aupk4ZNq9w1ozpfncal6xOWgTDfkrIJMCD72HZPoEoK+k cCczwmkAHhrmIryF/c3IPW2PiXifewAEC9aPxd69W9TxXe/6ekQvnN+sPxmePBztXw KSeu/VAsMrMF2Z1CmKbcUqVKnJR3j8FIRvO6vQ3dO1NxFoh1FR31RfnBRFatgVye1k kzR103xnk8Ki+tsCfYHKT2JUn3brKXtj3SSZQKMvP9ivg6bEWoTsMnCTP6U/JPReuk /AaOjjBoY068vTvNxhtXkQ8rIhMyMXeL1KwocbcDcFzdqoesF50fSM90sqF85a4B7h j35KrZkr9JkIw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fKTL74jptz9rxR; Mon, 23 Feb 2026 19:05:51 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: =?utf-8?Q?St=C3=A9phane?= Marks <shipmints@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Mon, 23 Feb 2026 18:05:52 +0000 Message-ID: <871pibgwsh.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) St=C3=A9phane Marks <shipmints@HIDDEN> writes: > On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <spwhitton@spwhitton= .name> > wrote: > >> Philip Kaludercic [07/Feb 2:15pm GMT] wrote: >> > I have something like this as a lambda expression in my configuration >> > and I think it is useful to provide the utility OOTB. >> >> Sounds reasonable, though ideally it would be an option that shows up >> with a checkbox when you customise recentf-exclude. >> >> > We could also go further and just ignore ignored extesions by default, >> > to not litter the recentf list. >> >> I'm not a recentf user so I'm not sure about this. > > > `recentf-exclude` seems sufficient and what I use. Isn't it kind of > trivial to add regexps (or a predicate function) to that list that exclud= es > extensions? > > (defcustom recentf-exclude nil > "List of regexps and predicates for filenames excluded from the recent > list. > When a filename matches any of the regexps or satisfies any of the > predicates it is excluded from the recent list. > A predicate is a function that is passed a filename to check and that > must return non-nil to exclude it." The function I propose is exactly for `recentf-exclude'. My take is that this is a common enough use-case that not everyone has to implement the function on their own.
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 23 Feb 2026 13:48:52 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 23 08:48:52 2026 Received: from localhost ([127.0.0.1]:52981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vuWIt-0001yX-HR for submit <at> debbugs.gnu.org; Mon, 23 Feb 2026 08:48:52 -0500 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]:61574) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>) id 1vuWIo-0001yK-Ne for 80347 <at> debbugs.gnu.org; Mon, 23 Feb 2026 08:48:49 -0500 Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-5fadbc3a453so2091801137.2 for <80347 <at> debbugs.gnu.org>; Mon, 23 Feb 2026 05:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771854526; cv=none; d=google.com; s=arc-20240605; b=UQxMy7E87mGDdvFeNZ7gcDD/HbYPRKNilpk2pGkvmsYEwCiP7/Bk0KIL4Ucgp2RUEf zEJDD4G/h/s4uknmYk5PmWl4VsQBsksDbhwHlSNkbigZNuwSJS1L9xpmuGq1Lxm2lfVa XI2PUv5/kseVeHvFqQ0NwAAC6+/4IItDpuAgfIQrnb1wz5swjziorLxTTIVGhA5MIPgQ yKyf21XcKzr3nTPF/CA5Yk7McbuNEz1hG6yZeNmyF5nwoSy73p4fZR0aUsw28mJYLrXN AVF/cQ22LkDArV+WOHrTAFv/9sbaDDmbrB1w5ySwddZPcDHw4UQmsC9JBaeI1L2WI9tb xWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GcvmZkBbKQR0R8vj6/FG6DZ7VTGzZuHGDmDkkARI2xw=; fh=+qtXFXEeydFDGuNjPfLC+qkjC5wwQ5huqWm6GVncsjs=; b=d9GoBNZwrvox8UI/eEJS0VI9zGj1kRw7vvxyVX681OYHsPf6qt9bsLjzutUHUMQzFm lCpkWgCsoGvLYUWAtPBEtHgymW4WOzE214f3krOumyNAv1ciFys0S8tj9tjdQwovnJ2a p9FqKjb1WGTrDpDsd7ZLSx+VSs0JkleyQlLQGTJkw+i+EHcrUW+YY9h6+2rx0Cy4AUwt 9W7Q8OOi/erG19UBFJHupQKteCFylXb9zTdKGDWywgHBsMJkl+zoGve8hWKVIbHYR7nr jQHAYGfTlaDh7FSA1thCbz92knchnmDoW7Z8xpGp2DlrhhCkD8I1oqkTJM8TZMjgq13l BQWw==; darn=debbugs.gnu.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771854526; x=1772459326; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GcvmZkBbKQR0R8vj6/FG6DZ7VTGzZuHGDmDkkARI2xw=; b=RS6x01MefGqM11R6xSKWJn7FstGtr5euksfX9qq2v3YKeP25aXqeFTV1UGa794hfmO VM8dDxBvAHbpFYcB6hPuM3yQPgyyea6bHAk/oTuqGm8FBJvSozT3xR2UQonYJvMl3reZ Fch+BsTqKCAlGmMPEaVNIjODcqJ04sOyzU2RCsGk/yms4rtQUUtO0S2vmHB+3P9kSmkE PO8vSCIONsv6dxpWZLKKKURZC3BDYkPn36RRhpSN322jp6f0F8i4OKCshPCdTq79tzE4 /uDPHnRPFyCDiKbeQ8eGpEEPVbClFhIIVMUN/HC9mybufOkL8GJ0larGoy0B+mPbBpvs i/rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771854526; x=1772459326; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GcvmZkBbKQR0R8vj6/FG6DZ7VTGzZuHGDmDkkARI2xw=; b=mDwvY3QqfxmSF2C6fNQg2Bt3d/MbvGCdO8q5hVqw72korazff10uCJ+0qqg1zS8EA3 OBcTHIQ7Aq1NqucrdcBGImkiDBEl/9RLf56zmioELdJTAHwQ3bOTOaFCT5htbdS16NII Ty+TAH2puvEHtfuNUjAwk8NHD0IVn0p9akF6rR+LcXuO77qvS5I2uIT/H3omyoUKF4aj h0B702EypAUUie+mNi54+8ZHXCakMtLAV3uV5KC9chIue02wHuszkk/0JAdmzFsIqrTV dNmWmPG0ItL2s0sDR8PDA4qrStjYomlZso2r607FcqlKIY8r2NCxpuiHq6GKhu9Nnpw3 wIlg== X-Forwarded-Encrypted: i=1; AJvYcCU3dHeNWGvLa4smUP9EyD2bIH86dn2ECTHajdQhgSIZHeMO8KtOGd81TN3yCcBQgIyAc8kYTQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxM3xu7qDoJVBhptg0UtO+xHp4Z1yA9mBOeDeZbntrKsIoGIS5G 3Kqdrc+lG7slSN11UtxxH/PRyml/hwXg5gfQZQexdLung9+26FDcusyIJkjkvo/WkBAz3vx7FSi Lq/TuylR74Y+Ppdhq3dDeajolXTFHmd4= X-Gm-Gg: AZuq6aJ/lwwZeIexB5z8tlJMjxIzTaBy+VGleaaut1w8ddaoWZaiW3xHdMVQvP/oVSu gQbuQFRt94ZnDIXaBVmADkU6Y4VjhDBpqDq7xHi8AMAmVyhgWajrkTWfhyEKS3SMr5BeD00yI0U N1p+Tt8dRR1a7HLJXD6OlW39wzRMZHUH/AO61Z5ETwfup8paFZBiRYqbnUlY4Enhg+1EivIVF+6 PkVeMW5xBXfxfplNgUSVb6piBKhl30sp6s/sC5epVEtIJvfJhOLn5b4SlWcXrkccXn//pOTOp2K Is5Rm9U7/bT3IFUwEPlHfxJRzFJJMoQxS3chFhLSaKxMMlZ1IolDR94vZnfp83I= X-Received: by 2002:a05:6102:3e91:b0:5ee:a03c:8782 with SMTP id ada2fe7eead31-5feb3071bb5mr4328224137.21.1771854525848; Mon, 23 Feb 2026 05:48:45 -0800 (PST) MIME-Version: 1.0 References: <878qd4bpwn.fsf@HIDDEN> <87ecmboa77.fsf@HIDDEN> In-Reply-To: <87ecmboa77.fsf@HIDDEN> From: =?UTF-8?Q?St=C3=A9phane_Marks?= <shipmints@HIDDEN> Date: Mon, 23 Feb 2026 08:48:34 -0500 X-Gm-Features: AaiRm50QFXQp9SgAiYtZqj5tcapJEpfnrkrhVXa_4N1kVuGuko3FeeZ_HcenH7c Message-ID: <CAN+1HbqnhDVQGAaWHDfYNjQ6n=Xy=UJhEzJiEdS90SCRuSc1Tw@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions To: Sean Whitton <spwhitton@HIDDEN> Content-Type: multipart/alternative; boundary="0000000000009b5ed0064b7e07e3" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 80347 Cc: Philip Kaludercic <philipk@HIDDEN>, 80347 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --0000000000009b5ed0064b7e07e3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <spwhitton@HIDDEN= ame> wrote: > Philip Kaludercic [07/Feb 2:15pm GMT] wrote: > > I have something like this as a lambda expression in my configuration > > and I think it is useful to provide the utility OOTB. > > Sounds reasonable, though ideally it would be an option that shows up > with a checkbox when you customise recentf-exclude. > > > We could also go further and just ignore ignored extesions by default, > > to not litter the recentf list. > > I'm not a recentf user so I'm not sure about this. `recentf-exclude` seems sufficient and what I use. Isn't it kind of trivial to add regexps (or a predicate function) to that list that excludes extensions? (defcustom recentf-exclude nil "List of regexps and predicates for filenames excluded from the recent list. When a filename matches any of the regexps or satisfies any of the predicates it is excluded from the recent list. A predicate is a function that is passed a filename to check and that must return non-nil to exclude it." --0000000000009b5ed0064b7e07e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">= On Mon, Feb 23, 2026 at 8:35=E2=80=AFAM Sean Whitton <<a href=3D"mailto:= spwhitton@HIDDEN">spwhitton@HIDDEN</a>> wrote:</span></d= iv></div><div class=3D"gmail_quote gmail_quote_container"><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex">Philip Kaludercic [07/Feb=C2=A0 2:15pm GMT= ] wrote:<br> > I have something like this as a lambda expression in my configuration<= br> > and I think it is useful to provide the utility OOTB.=C2=A0 <br> <br> Sounds reasonable, though ideally it would be an option that shows up<br> with a checkbox when you customise recentf-exclude.<br> <br> > We could also go further and just ignore ignored extesions by default,= <br> > to not litter the recentf list.<br> <br> I'm not a recentf user so I'm not sure about this.</blockquote><div= ><br></div><div><div class=3D"gmail_default" style=3D"font-family:monospace= ">`recentf-exclude` seems sufficient and what I use.=C2=A0 Isn't it kin= d of trivial to add regexps=C2=A0(or a predicate function) to that list tha= t excludes extensions?</div></div><div class=3D"gmail_default" style=3D"fon= t-family:monospace"><br></div><div><font face=3D"monospace">(defcustom rece= ntf-exclude nil=C2=A0</font></div><font face=3D"monospace">=C2=A0 "Lis= t of regexps and predicates for filenames excluded from the recent list.<br= >When a filename matches any of the regexps or satisfies any of the<br>pred= icates it is excluded from the recent list.<br>A predicate is a function th= at is passed a filename to check and that<br>must return non-nil to exclude= it."<br></font><div>=C2=A0</div></div></div> --0000000000009b5ed0064b7e07e3--
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at 80347) by debbugs.gnu.org; 23 Feb 2026 13:34:35 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 23 08:34:35 2026 Received: from localhost ([127.0.0.1]:52864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vuW54-0001Df-On for submit <at> debbugs.gnu.org; Mon, 23 Feb 2026 08:34:35 -0500 Received: from sendmail.purelymail.com ([34.202.193.197]:33272) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>) id 1vuW51-0001DC-Ci for 80347 <at> debbugs.gnu.org; Mon, 23 Feb 2026 08:34:32 -0500 DKIM-Signature: a=rsa-sha256; b=F5ZwBH0lcSbRaoEURn1SpA0f3Vhs9q8GJWMG/oJjHKk73tzDDj2aoBzrvfa7ZlmvgcS5UpTV6HwDU4qzLiF30rKBrq38BBg7u4/34xbe/6AdAzI+2I/6IVAPXsUA4gJQuRQJYBjH5qopJXHHaebagvZR1L+Ln44mqbHNzumfs5CVerNQH29rIOnBngX5+bILb8sf3CAjAeE7aQPCuyIhgh2MSM9ZwqtRS0GpvwVt8VJ0aKCtI21FJKS+v/+rl/nTjXU4hm1VyZZpxDgNXUvItJdsCbxf5/CKMpF+lPUypiE/mWO2jghMd8WheG6SiM1s3s0KMCa492jX6GdgIoY2cg==; s=purelymail2; d=spwhitton.name; v=1; bh=J3VSsNiBINt+7zFqWwXpovCGGiRnsgq06XCk9z9ENNk=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=a5BhoExLBrpNFL1Y4B774fbndezlzlR0Ryq83JHKe1pmiPo4ke9BMJj2n68mWEF9gFnV63fyEo2RWKLwMAVTi4jK1au0wf/OVAAXR3OYhFEpxokvxBwdSEsObDUPMCwWFjdYE281/WBnXSaPbN/DQQgbc47Q1I5/CuSK6aPpjsKpApZS8Cj1T1tg0/+Tp9Qndt7EUYUxG8pYB14t+8ngvsLRrn+kwFZWzfHoP8gYJfDKHVdpJxuODqyQu9J8cZ3LXIMc24kVCrVesnyv/2h1+EpYPYyoRQ0F5lWC4HNsgUhGH/g6dBrgQI8WJTE6kvdLaxZNtsSJ25wprBgrZF0d6Q==; s=purelymail2; d=purelymail.com; v=1; bh=J3VSsNiBINt+7zFqWwXpovCGGiRnsgq06XCk9z9ENNk=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 80347 <at> debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 101489070; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 23 Feb 2026 13:34:22 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id B61BC7E6CE4; Mon, 23 Feb 2026 13:34:20 +0000 (GMT) From: Sean Whitton <spwhitton@HIDDEN> To: Philip Kaludercic <philipk@HIDDEN> Subject: Re: bug#80347: [PATCH 1/1] Add function for recentf to ignore ignored extensions In-Reply-To: <878qd4bpwn.fsf@HIDDEN> References: <878qd4bpwn.fsf@HIDDEN> Date: Mon, 23 Feb 2026 13:34:20 +0000 Message-ID: <87ecmboa77.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 80347 Cc: 80347 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.4 (/) Philip Kaludercic [07/Feb 2:15pm GMT] wrote: > I have something like this as a lambda expression in my configuration > and I think it is useful to provide the utility OOTB. Sounds reasonable, though ideally it would be an option that shows up with a checkbox when you customise recentf-exclude. > We could also go further and just ignore ignored extesions by default, > to not litter the recentf list. I'm not a recentf user so I'm not sure about this. -- Sean Whitton
bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.Received: (at submit) by debbugs.gnu.org; 7 Feb 2026 14:16:09 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 07 09:16:09 2026 Received: from localhost ([127.0.0.1]:34944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1voj6X-0000R0-AA for submit <at> debbugs.gnu.org; Sat, 07 Feb 2026 09:16:09 -0500 Received: from lists.gnu.org ([2001:470:142::17]:53048) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <philipk@HIDDEN>) id 1voj6U-0000Q8-Rg for submit <at> debbugs.gnu.org; Sat, 07 Feb 2026 09:16:08 -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 <philipk@HIDDEN>) id 1voj6M-0006Cq-KB for bug-gnu-emacs@HIDDEN; Sat, 07 Feb 2026 09:15:58 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <philipk@HIDDEN>) id 1voj6K-0007j8-Gc for bug-gnu-emacs@HIDDEN; Sat, 07 Feb 2026 09:15:58 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0B808240101 for <bug-gnu-emacs@HIDDEN>; Sat, 7 Feb 2026 15:15:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017; t=1770473753; bh=SKluVBgC0pnBd93jOq6nyoWlTl5k/RYa6iYl7Itltog=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=PFsAIE7YyMoYRzdNKMU5LcBxKSFl9+w8GNU1HJkuOKp1NN+ChRF9hVl77fTnmtoDd W64wBy7TbrQM2uZM8c1A4EpmsHZKYBqNiywQ/KijqUqg+LHHhe3J6nRxHqs6eu0n4/ Bk6AuQW/NTQPH/YnlLRBfjW/PNZPC9z6mxiYhmfiv09yqBai0dV2rBhAOunim3DucF pHTwBkqP2TL54a8/hqKq+ieBjLg+GTmrs/4klmrzcvwMD5WwTEo1f7gunQd3fwI3A0 mhb8JcHT6lw+eQSH/g1/c6ckY54l8J53U5TaeBNTl8prWk/Z7NcQU+PfYHF45sqtqx D0JUdBdjSzomg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4f7Y0848w2z9rxM for <bug-gnu-emacs@HIDDEN>; Sat, 7 Feb 2026 15:15:52 +0100 (CET) From: Philip Kaludercic <philipk@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH 1/1] Add function for recentf to ignore ignored extensions OpenPGP: id=philipk@HIDDEN; url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN"; preference=signencrypt Date: Sat, 07 Feb 2026 14:15:52 +0000 Message-ID: <878qd4bpwn.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@HIDDEN; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain I have something like this as a lambda expression in my configuration and I think it is useful to provide the utility OOTB. We could also go further and just ignore ignored extesions by default, to not litter the recentf list. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-function-for-recentf-to-ignore-ignored-extensi.patch Content-Description: [PATCH 1/1] Add function for recentf to ignore ignored extensions From 9b21d4df9315d1b0c7c0dd2e278101dfda383608 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic <philipk@HIDDEN> Date: Sat, 7 Feb 2026 15:14:49 +0100 Subject: [PATCH 1/1] Add function for recentf to ignore ignored extensions * lisp/recentf.el (recentf-exclude-ignored-extensions): New function. --- lisp/recentf.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/recentf.el b/lisp/recentf.el index 1ae2dd662b9..177e7510f20 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -115,6 +115,15 @@ recentf-exclude :group 'recentf :type '(repeat (choice regexp function))) +(defun recentf-exclude-ignored-extensions (file-name) + "Return non-nil if FILE-NAME has an ignored extension. +The user option `completion-ignored-extensions' determines whether or +not a file extension counts as ignored. You can add this function to +`recentf-exclude'." + (string-match-p + (concat "\\." (regexp-quote (file-name-extension file-name)) "\\'") + (regexp-opt completion-ignored-extensions))) + (defun recentf-access-file (filename) "Check whether FILENAME is accessible." (ignore-errors (not (access-file filename "Checking recentf file")))) -- 2.47.3 --=-=-=--
Philip Kaludercic <philipk@HIDDEN>:bug-gnu-emacs@HIDDEN.
Full text available.bug-gnu-emacs@HIDDEN:bug#80347; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.