From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov 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: Sun, 19 Dec 2021 19:16:42 +0200 Organization: LINKOV.NET Message-ID: <861r28io75.fsf@mail.linkov.net> References: <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="29536"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52569@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 19 18:21:23 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 1myzsA-0007Rs-OH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Dec 2021 18:21:22 +0100 Original-Received: from localhost ([::1]:37908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myzs9-0001zk-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Dec 2021 12:21:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myzrt-0001yC-FR for bug-gnu-emacs@gnu.org; Sun, 19 Dec 2021 12:21:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myzrs-0007Mj-3x for bug-gnu-emacs@gnu.org; Sun, 19 Dec 2021 12:21:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1myzrs-0007CP-0f for bug-gnu-emacs@gnu.org; Sun, 19 Dec 2021 12:21:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Dec 2021 17:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52569 X-GNU-PR-Package: emacs Original-Received: via spool by 52569-submit@debbugs.gnu.org id=B52569.163993442527550 (code B ref 52569); Sun, 19 Dec 2021 17:21:03 +0000 Original-Received: (at 52569) by debbugs.gnu.org; 19 Dec 2021 17:20:25 +0000 Original-Received: from localhost ([127.0.0.1]:47952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myzrE-0007AF-LS for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:20:24 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:53657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myzrB-00079h-CN for 52569@debbugs.gnu.org; Sun, 19 Dec 2021 12:20:21 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 3416A1BF205; Sun, 19 Dec 2021 17:20:13 +0000 (UTC) In-Reply-To: <87tuf7zksh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 17 Dec 2021 09:40:30 +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" Xref: news.gmane.io gmane.emacs.bugs:222719 Archived-At: > This would be useful for large files like .sqlite and images. I'm not sure about images since some image formats are editable, like .svg, .xpm, .ps... Only .pdf with in doc-view-mode could have this optimization of not loading the whole file. Also archive files could benefit from this optimization. > This function would be called with the file name and would be > responsible for returning a buffer that "displays" the file in some > sense. Or when it returns t, this could mean that the function displayed the buffer in some other way, for example, by calling an external command. Then find-file-alist could be used to implement a smarter dired-guess-shell-alist like for https://debbugs.gnu.org/18132#92 So not only files visited by dired will be redirected to an external command, but also files visited by C-x C-f. > 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? Also functions that ask about saving a modified file buffer should probably skip such buffers. > 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? non-persistent-file-mode, or transient-file-mode, or ephemeral-mode...