From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: dired-do-find-regexp failure with latin-1 encoding Date: Tue, 1 Dec 2020 02:34:46 +0200 Message-ID: <54828043-03bc-d09a-053c-2f4d7780e3a7@yandex.ru> 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> <87a6uy7egn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25824"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Eli Zaretskii , stephen.berman@gmx.net, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 01 01:36:28 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 1kjted-0006dR-GG for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 01:36:27 +0100 Original-Received: from localhost ([::1]:34718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjtec-0008L9-9u for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Nov 2020 19:36:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjtd7-0007j2-C2 for emacs-devel@gnu.org; Mon, 30 Nov 2020 19:34:53 -0500 Original-Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:44721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjtd5-0006Gj-DP; Mon, 30 Nov 2020 19:34:53 -0500 Original-Received: by mail-ej1-x629.google.com with SMTP id m19so202803ejj.11; Mon, 30 Nov 2020 16:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=d3GvH8iM20hYVaC+yvycsV1iM7MXukJk1R5Pf/ZPORE=; b=VcVHL8TieBG7q7N0KGST2tU+AJnzoX6iDTshQdHh3TxmG/GPmOlisaGFSQpvgwyKzJ gcvgkwRoZY4u+tS2AXZcysxLVIgnVuf3Zc9ndlgzuH04Z8EaJn3Z1M4omqZ/y9pE2MQ/ 3QSxW1BMLo9jx5Ms9zXv6FvXk91cT9+tnFzU6icTeqdxPi3ZsrSOAf7ELQvmVDCIMSDc e7adrPdbY6zh5VeFE4iWe93RS9FfJB/yh0Zw0U9EC3oJH28t1nbKt6R7DCOQhCr+SrTd gIpoUK5acvXk4s7D8Fk1wOdJd9nyZXkAldFqDECoL96HIbvRkYFuMBAsVTby88OkJZhN lALA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=d3GvH8iM20hYVaC+yvycsV1iM7MXukJk1R5Pf/ZPORE=; b=LwjTSZW94Ly78LV7soEiz8IU57qMPCUzeAF3FHmFwCTl6t0eqej5JftU3enZHcCuyl CeTlfi71aKsWztgtKFrPQ5u1zpvogMW1Dzc5E+fBnKsk1ICC9X5T/v80+9lPjNzmxa7D tXLi+tEB+6uU2Sz8yJmVh4dfw5549zfGXHvTz+8I8MHCSHxgPRnapAov5zBE7C/VnmHf 2UuBqi4RLER2pWnH+ubQCumbZan7XHgONFsjH41Ydqi8u2u9/vStzvgK8QHcCI+MIfBC 5W1i7/DIQsUE7dq7K+Li9SsB7Xn0srKFEirfIhhYjovApLZFi4d+Lq4yZeVW46PHXNWQ YyFg== X-Gm-Message-State: AOAM531c9BefZkaDKM6ymYQZYl56vrMw6sBaZ/ieNi2I8p9cX5k4uOFW YhP7D9FNuVWcXFOGa0Tu76aVYbO/EHfnRQ== X-Google-Smtp-Source: ABdhPJz4GyFC+Fowgh/gfs0SQfKBv0bxh8uP8ady2djo24TfJ+Li9iSgcU4C2dS1pghOQ3lo1OQGbw== X-Received: by 2002:a17:906:b14e:: with SMTP id bt14mr469620ejb.226.1606782889534; Mon, 30 Nov 2020 16:34:49 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id e3sm32194ejq.96.2020.11.30.16.34.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 16:34:48 -0800 (PST) In-Reply-To: <87a6uy7egn.fsf@mail.linkov.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=raaahh@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:260104 Archived-At: On 30.11.2020 22:54, Juri Linkov wrote: >>> 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. And a non-obvious one (for an average user). Is the same problem exhibited by commands using the Xref UI? I don't remember seeing it, but of course our projects can be very different. > 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 Looks sensible to me, but perhaps you want to create a new discussion/bug-number for it? Unless you'd like to follow up with a patch for xref.el (if the problem applies there). > More customizability could be added later to define the > length of the hidden part, etc. Maybe we'll want it to be dynamically determined by fill-column. Or just be a big enough value (e.g. 256) that the only lines where this rule is hit are obviously too long.