From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#52569: 29.0.50; Wishlist: There should be a way for packages to handle files without reading them in first Date: Fri, 17 Dec 2021 09:40:30 +0100 Message-ID: <87tuf7zksh.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31222"; mail-complaints-to="usenet@ciao.gmane.io" To: 52569@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 17 09:41:29 2021 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 1my8nx-0007xF-4s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Dec 2021 09:41:29 +0100 Original-Received: from localhost ([::1]:52428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1my8nv-0005us-Vp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Dec 2021 03:41:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my8nW-0005uO-BF for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 03:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1my8nW-0005mm-3e for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 03:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1my8nV-0001pF-Tl for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 03:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Dec 2021 08:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52569 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16397304436978 (code B ref -1); Fri, 17 Dec 2021 08:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Dec 2021 08:40:43 +0000 Original-Received: from localhost ([127.0.0.1]:37911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my8nD-0001oT-06 for submit@debbugs.gnu.org; Fri, 17 Dec 2021 03:40:43 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my8nA-0001oL-OZ for submit@debbugs.gnu.org; Fri, 17 Dec 2021 03:40:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my8nA-0005dm-Dt for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 03:40:40 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=32946 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my8n6-0005gD-Ec for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 03:40:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; 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=HtrXZIxsJTYtxtNVzP5L/XX+1ALYRfRnIVyxIrsrW4Q=; b=nG+rIndYayCqSlP5oRRVPKh8HS j81ZQvDVYhYQy7alGs+HXf+15w6gfwlWcVBNG2OMeyzpudv92masNEvaQnLt2t06bTcI466cw9jzb 1A4zUqJxAaoOA4005xQ1FwtLa6ofUXO7F0EsPP4VwXwy4V/9SVs1Xo7XptvNvjy7bdj4=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1my8n1-00064m-KS for bug-gnu-emacs@gnu.org; Fri, 17 Dec 2021 09:40:34 +0100 X-Now-Playing: King Crimson's _The Complete 1969 Recordings (8): In the Court Of The Crimson King_: "The Court Of The Crimson King" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=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" Xref: news.gmane.io gmane.emacs.bugs:222555 Archived-At: This would be useful for large files like .sqlite and images. The mechanism proposed on emacs-devel is to do something similar to find-directory-functions in find-file-noselect: (defun find-file-noselect (filename &optional nowarn rawfile wildcards) [...] (if (file-directory-p filename) (or (and find-file-run-dired (run-hook-with-args-until-success 'find-directory-functions (if find-file-visit-truename (abbreviate-file-name (file-truename filename)) filename))) But for files. So we could have a find-file-function-alist that maps from file names (using the same syntax as auto-mode-alist) to functions that handle the files. This function would be called with the file name and would be responsible for returning a buffer that "displays" the file in some sense. For .sqlite, it would basically call `sqlite-mode-open-file', and image-mode should have a similar function. There's some details that aren't clear. Should this new buffer be visiting the file? That sounds dangerous, because saving the buffer contents to the file would destroy the file. But that could be handled by... write-file-functions? Should there be another general mode these things should inherit from, like special-mode, but taking care of things like write-file-functions (i.e., disallow saving if the mode hasn't implemented a function for that)? If so, what should it be called? `really-special-mode' is probably too special. Uhm... Something that expresses "the displayed contents of this mode doesn't match up the saved contents much"... `unloaded-file-mode'? Hm... any ideas? In GNU Emacs 29.0.50 (build 69, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2021-12-16 built on xo Repository revision: e7a6d6a546e7e56e5a721aac86a19473e4303111 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Debian GNU/Linux bookworm/sid -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no