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: Mon, 16 Dec 2024 10:43:16 +0100 Message-ID: <87wmg03qvf.fsf@daniel-mendler.de> References: <87ed29ixu8.fsf@daniel-mendler.de> <87msgw94fz.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="27908"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74879@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 10:44:31 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 1tN7eQ-00077q-LW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 10:44:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7e6-0008MP-Tm; Mon, 16 Dec 2024 04:44:10 -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 1tN7dz-0008Lf-UO for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 04:44:07 -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 1tN7dy-0003zD-KY for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 04:44:03 -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:References:In-Reply-To:From:To:Subject; bh=azuWFF+WnRH/D6sU3VZoP87PUfaz0rSB6Gl0NLdf7Ac=; b=c8e6JISHL/2PNqWISvPntA0f7ysigmdn2aEqWbDrQZPbXszDCdVonuEU/IKHFWJpoQjYQgfcplc0fJRzw6GdxXjMjiVPm4JkYZc8pEdZ8HVhAs+p49uN98i85edayXQMQpVu3NsYYfVU41PQO6vc6pyeRO/traf3uLCLeeSiphlLGxO3smIjK+3F5lt7BVay2Jh0unFZwrlCEgh5NIdVLaVogDkS8a4A0mKvdeBc4AXQxjqF8vLsEdBcCdBK3lLC54j9cgXDdWUKjDkSlrSaeW0DOiT6pCutZ09LGLhRwB1twdgC2maL8yDZSXH9LhTwWis5x+JXIE/1lP/+od81tQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tN7dy-0006Rd-5f for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 04:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 09:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74879 X-GNU-PR-Package: emacs Original-Received: via spool by 74879-submit@debbugs.gnu.org id=B74879.173434220624702 (code B ref 74879); Mon, 16 Dec 2024 09:44:02 +0000 Original-Received: (at 74879) by debbugs.gnu.org; 16 Dec 2024 09:43:26 +0000 Original-Received: from localhost ([127.0.0.1]:53536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tN7dN-0006QL-Vw for submit@debbugs.gnu.org; Mon, 16 Dec 2024 04:43:26 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:38311 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tN7dM-0006Q1-6a for 74879@debbugs.gnu.org; Mon, 16 Dec 2024 04:43:25 -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: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=azuWFF+WnRH/D6sU3VZoP87PUfaz0rSB6Gl0NLdf7Ac=; b=LfAeoFKOj1Wpc+GypeVstqLARg Cz/AdEBblhSPZxIOXw9LJ12S3on0U/dXZQbOk94QHkJQQ5RaQY3vJLKuR48nP7XSVAIWtEy0DvIhL yRYVrNg6lka1x0ARHzwshpGSM7C5nSG3IIS9hB14zzgSFfkxwpL8S4aGqNS6qgk1pkYE=; In-Reply-To: (Stefan Monnier's message of "Sun, 15 Dec 2024 17:41:59 -0500") 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:297161 Archived-At: Hello Stefan, I just took another look at the `trusted-content-p' function on the emacs-30 branch: (defun trusted-content-p () (and (not untrusted-content) buffer-file-truename ...)) There is a check for `buffer-file-truename' which means that the issue with non-file-backed buffers remains (Ielm or scratch). Probably (eq trusted-content :all) should be checked first? (defun trusted-content-p () (and (not untrusted-content) (or (eq trusted-content :all) (and buffer-file-name ...)))) At the same time one could consolidate the untrusted-content and trusted-content variables as Eshel suggested? (defun trusted-content-p () (and (not untrusted-content) ;; only for backward compat (deprecated) (not (eq trusted-content :untrusted)) ;; replaces untrusted-content (or (eq trusted-content :all) (and buffer-file-name ...)))) Daniel