From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74879: 30.0.92; trusted-content-p and trusted-files cannot be used for non-file buffers Date: Sun, 15 Dec 2024 01:39:11 +0100 Message-ID: <87ed29ixu8.fsf@daniel-mendler.de> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2147"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier To: 74879@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 01:40:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMcgP-0000O2-3c for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 01:40:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMcg7-0004Py-2b; Sat, 14 Dec 2024 19:40:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMcg0-0004IO-Tl for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 19:40:08 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMcfz-0007Dc-KA for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 19:40:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=TbhnHbeko1VglSUhATbNuy3IFt4VmiTqssWERN/Qheo=; b=BtOJomo9kkfj45KG+Yapvo3X2CE4tulYsSQCiVHp2FmiaE/V5qtRhwtf9R4fyByQ7BoEbeeOmXBhD0Z8Sps2+Ia7xQUbFtZWY8DSxc1s7XEDgSC17CSANn1J0l3TRmxOGRAmppWFPIuL+nfj2fxCHcFadIE2YFeAJfIWm90FKgyRddqIzTSJU3GxHPgI6v22ekWQJnbXjkW1exJS+SxSaXULAuzylWDkof6P8uV653gpJwGKF8RSZt3VDfjPHVgSwQbnvgM0o1D/HXd2EaLm81ZbLnMVJOnL2gEvtnPWcwus4aNahTYBNJK5QcbwjkX9acbLVwy6Np7TNH9wFptJyw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMcfy-0001nR-51; Sat, 14 Dec 2024 19:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 00:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74879 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.17342231626829 (code B ref -1); Sun, 15 Dec 2024 00:40:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Dec 2024 00:39:22 +0000 Original-Received: from localhost ([127.0.0.1]:48882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMcfJ-0001m5-QT for submit@debbugs.gnu.org; Sat, 14 Dec 2024 19:39:22 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMcfI-0001lv-80 for submit@debbugs.gnu.org; Sat, 14 Dec 2024 19:39:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMcfH-00049z-OW for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 19:39:20 -0500 Original-Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMcfD-0006ew-NS for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 19:39:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TbhnHbeko1VglSUhATbNuy3IFt4VmiTqssWERN/Qheo=; b=QFAALO/5I6z6ucL6gSjtlSnI/4 BcfBzym21RBKWPW7ORW30llnpGr0VKgHGo7XXnXC7Y9HIF1GRyMnK/G4knafYK9pYelXetqYxMWiF n3nH67xNaB1DoTFOLfZhA9+vtcaZYFFYb+s0h5iMaKD2NA1AZOdFk9jpMyR5xyUDMdV8=; Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297079 Archived-At: Thank you for the recent addition of `trusted-content-p'. Is there a possibility to use `trusted-content-p' in buffers which are not backed by a file? I use Flymake in *scratch* or similar buffers and it seems that this won't continue to work given that `trusted-content-p' needs a `buffer-file-truename'. My suggestion would be to replace `trusted-files' by a `trusted-buffer-function' which is a predicate function or a list of functions. The functions could then check a custom list of trusted files or a custom list of trusted buffers. Alternatively offer `trusted-files', `trusted-buffers' and `trusted-buffer-function`? `trusted-buffers' could for example rely on `buffer-match-p`. Daniel