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.devel Subject: Re: dired-do-find-regexp failure with latin-1 encoding Date: Mon, 30 Nov 2020 22:54:32 +0200 Organization: LINKOV.NET Message-ID: <87a6uy7egn.fsf@mail.linkov.net> References: <87blfhjr4q.fsf@gmx.net> <83k0u5mjvf.fsf@gnu.org> <877dq5jp51.fsf@gmx.net> <83im9pmh0v.fsf@gnu.org> <106736d6-1732-3f24-15c5-af7bcfd688c6@yandex.ru> <83blfhmdho.fsf@gnu.org> <247a8edb-7b70-ad32-1ba1-43b5458a82b0@yandex.ru> <87tut8zfmk.fsf@mail.linkov.net> <59a60557-8cfc-fcdc-f0f5-e3e476c56aa1@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , stephen.berman@gmx.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 30 22:01:09 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kjqIH-000AMQ-8s for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Nov 2020 22:01:09 +0100 Original-Received: from localhost ([::1]:53716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjqIG-00008I-8j for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Nov 2020 16:01:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjqFc-0006ST-9t for emacs-devel@gnu.org; Mon, 30 Nov 2020 15:58:24 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:43267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjqFa-0005Gw-3f; Mon, 30 Nov 2020 15:58:23 -0500 X-Originating-IP: 91.129.99.98 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 78FCFE0008; Mon, 30 Nov 2020 20:58:16 +0000 (UTC) In-Reply-To: <59a60557-8cfc-fcdc-f0f5-e3e476c56aa1@yandex.ru> (Dmitry Gutov's message of "Mon, 30 Nov 2020 03:08:40 +0200") Received-SPF: pass client-ip=217.70.183.196; envelope-from=juri@linkov.net; helo=relay4-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260097 Archived-At: >> For grep output a bigger problem is that grep on binary data >> might output too long lines before the terminating newline. > > (*) We already have this kind of problem with "normal" files which contain > minified assets (JS or CSS). The file contents are usually normal ASCII, > but it's just one line which can reach several MBs in length. > > The usual way to deal with that is with project-ignores and > grep-find-ignored-files. That works for both cases. This is a bug problem - often grep output lines are so long that Emacs freezes, so need to kill the process. Updating manually ignored-files every time a new file causes freeze is very unreliable and time-consuming workaround. I tried to fix this problem, and fortunately the fix is simple with the 1-liner patch. It does exactly the same thing that we recently did to hide overly long grep command lines with 'grep-find-abbreviate'. The patch even uses the same 'grep-find-abbreviate-properties' to allow clicking the hidden part to expand it. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index dafba22f77..e0df2402ee 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -492,6 +492,9 @@ grep-mode-font-lock-keywords (0 grep-context-face) (1 (if (eq (char-after (match-beginning 1)) ?\0) `(face nil display ,(match-string 2))))) + ;; Hide excessive parts of grep output lines + ("^.+?:.\\{,64\\}\\(.*\\).\\{10\\}$" + 1 grep-find-abbreviate-properties) ;; Hide excessive part of rgrep command ("^find \\(\\. -type d .*\\\\)\\)" (1 (if grep-find-abbreviate grep-find-abbreviate-properties More customizability could be added later to define the length of the hidden part, etc.