From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier 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 09:03:18 -0500 Message-ID: References: <87ed29ixu8.fsf@daniel-mendler.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35108"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74879@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 15:04:12 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 1tMpEC-0008zu-Al for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 15:04:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMpE5-0005WO-W2; Sun, 15 Dec 2024 09:04:06 -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 1tMpE4-0005UE-Bm for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 09:04:04 -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 1tMpE3-00031j-Pv for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 09:04: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=4BrD62avKEuSS++VQHdQJ7+OqxRAM/IziLZpsuNE9sE=; b=tCbfi2ztaVZX1DiPWc6YMb0Wlx2v5r+yvGkZaiD5MM1xodhZ0OkR4I4wk+tHEpNEDuQfOCgzOujDyiKKVvvSAn1Q7domS4g8tZzA2njuAk9MuOp4qKjMWWbkn1D3dNKLCLF91ZkfePJVE2aGmsKaOacbq7xvHzMHziJ1cWY5/yLBxhbbDm07MeoCstGlgO23DDqujHUjX6qZqlPfP0PzqJcmrWM5WYMSMFFOZtnbfSpNk9P7WDVE/evYpLc4yzS1T9COX2+1hMfQ2w2saGDrZY0fI0TYfOdqsTQVYmITzc3NpvI3XgEsjTisPVN8Dh1XytFwyzgqfdjKlGqG0xvSJQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMpE2-0007Kr-K5 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 09:04:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 14:04: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.173427141028146 (code B ref 74879); Sun, 15 Dec 2024 14:04:02 +0000 Original-Received: (at 74879) by debbugs.gnu.org; 15 Dec 2024 14:03:30 +0000 Original-Received: from localhost ([127.0.0.1]:49986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMpDV-0007Jt-MW for submit@debbugs.gnu.org; Sun, 15 Dec 2024 09:03:30 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMpDS-0007Jg-PS for 74879@debbugs.gnu.org; Sun, 15 Dec 2024 09:03:27 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AC4AE808F9; Sun, 15 Dec 2024 09:03:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734271399; bh=ruNGKyR8aDUVC/CDM1EKM60YaloBcJx9SMXf1NmLCUc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=NMEzHVNcqBykTjsvVNuHXnOMvAFy+H5gMxnzjEkfTKw8Hi0fms7dRPfcR+3CR1n/K S4AUY2OpND4lHU8r6/Y+wR67QGT1VVazS/mm0HicpaEkNrEl0Nmr0xGdhjSm9lKR6W erhZ2z5/uJ8884+K0lEl4qxYpcPNWir4f2Eo+/9Q0zDUA+gWyCE3KFsL0TfitUf1L6 yp6FMY0h/f8HI8zpm+pC+Vi6HimSjGBNrRRBuT9eOsrAylQ0cVdBRGw++Ot/lJJolg 7WBkv5zPxgir/4ktiwOWVR/2VFsXkSz/GRkRIkM3XHtScMT11BFcI8MxdlLNckApts zylZwbhR8ZxRw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D75E28079A; Sun, 15 Dec 2024 09:03:19 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B25D91204C4; Sun, 15 Dec 2024 09:03:19 -0500 (EST) In-Reply-To: <87ed29ixu8.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 15 Dec 2024 01:39:11 +0100") 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:297105 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'. Good question. We don't really have a good answer yet, AFAIK, in large part because we don't have enough experience with it. Off the top of my head, here are some elements relevant to this discussion, in random order: - The current setup is a kind of "minimal" change for Emacs-30 because it's late in the pretest, so as much as possible we should separate the discussion into what's a simple enough solution for Emacs-30 and what we should use in the longer term. - You should be able to get fully-featured Flymake in *scratch* with (setq-local trusted-files :all). Maybe we should do that when we setup *scratch*? Which other non-file buffers would need that? The minibuffer? - Trust sucks, so we really should work on better solutions where we don't need to rely on trust, such as running code in `bwrap` or other kinds of sandboxes. - I think we do want some kind of hook, with which we can have (for instance) `emacs-lisp-mode` tell Emacs to trust the user init file, the early-init file, the custom-file, and all the files in `load-path`. - There is overlap with `safe-local-variable-directories`, `enable-local-variables` and it would be nice to consolidate (which can require delicate timing if we want the major mode to inform which content to trust). - Stefan