From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mikhail Pomaznoy Newsgroups: gmane.emacs.help Subject: Memory-efficient way of opening large files in Emacs read-only Date: Thu, 8 Dec 2022 09:49:26 +0700 Message-ID: <8e91d0e8-2474-dd98-9bca-4606becd974d@mikpom.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 14:33:32 2022 Return-path: Envelope-to: geh-help-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 1p3H1o-0001VW-Em for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 14:33:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3H1K-0002z9-4L; Thu, 08 Dec 2022 08:33:02 -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 1p36yh-00021U-8B for help-gnu-emacs@gnu.org; Wed, 07 Dec 2022 21:49:41 -0500 Original-Received: from mikpom.ru ([212.193.52.17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p36yc-0000HD-Cc for help-gnu-emacs@gnu.org; Wed, 07 Dec 2022 21:49:36 -0500 Original-Received: from [192.168.0.101] (nat-88-4.nsk.sibset.net [5.44.169.94]) by mikpom.ru (Postfix) with ESMTPSA id 4E7556B6 for ; Thu, 8 Dec 2022 09:49:27 +0700 (+07) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mikpom.ru; s=dkim; t=1670467767; bh=ij3uEeoMK8sZWJX01+MpKZ3rG0AcuEtVA9jp+HvEwGU=; h=Date:To:From:Subject:From; b=HQFcxzWls/9onZ3EGD/r1c8vioTbLNpdqTlG0feFUqYMWGc7/fbvkYUIC+ns0B6Yv KY1L2yZB5lF8ISlv0UxxI8P+nGiFDzRpx0w5ksu47xwzYzcY1/XC8/pm6cfGWpG3GM bhWzZBUSNcf5k2vx3ZwW/0crCMXB+4B1jHxRa7l1bpK863JnMIEWhNcB6TkcyiRwbE N4fRarrL3ShUVWMv4xf7MZwKACnoXZ8pAbH0SpsNgeeMIm9kSasX283f4HnPMtFiqE MBlxOkMlS0fiwP7QWsMcua0CLjBHCHtf+OP3Ffi4QP65NIzQc+BW73L3Bo9ZM0cXZD wC7k1I6h83ujg== Content-Language: en-US Received-SPF: pass client-ip=212.193.52.17; envelope-from=mikpom@mikpom.ru; helo=mikpom.ru X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 08 Dec 2022 08:32:54 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141456 Archived-At: Greetings! In my daily workflows I commonly stumble upon a task of peeking into a header of a large (sometimes compressed) file. Those files can commonly be gigabytes in compressed form so can't fit into memory. I was wondering how can this be done in Emacs to leverage its search and navigate capabilities? In a terminal this task is nicely accomplished with `less`, which loads file on demand while you scroll (memory-efficiently) and automatically detects at least gzip compression. However I am struggling to do something similar in Emacs for quite a long time.  I tried VLF (requires manually switching chunks loaded, encountered problems with compression), view-file (loads everything in memory), running less in Emacs terminals (I prefer outside-Emacs terminals) but for various reasons all this solutions are suboptimal and I usually end up with using `less`. Is there something in Emacs I am missing? Is something like this makes sense to develop (I consider to write something for Emacs) ? I am using Emacs 28 and maybe in Emacs 29 there are novelties related to this issue? Kind regards, Mikhail