From: Dmitry Gutov <dgutov@yandex.ru>
To: Juri Linkov <juri@linkov.net>
Cc: Eli Zaretskii <eliz@gnu.org>,
stephen.berman@gmx.net, emacs-devel@gnu.org
Subject: Re: dired-do-find-regexp failure with latin-1 encoding
Date: Tue, 1 Dec 2020 02:34:46 +0200 [thread overview]
Message-ID: <54828043-03bc-d09a-053c-2f4d7780e3a7@yandex.ru> (raw)
In-Reply-To: <87a6uy7egn.fsf@mail.linkov.net>
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.
prev parent reply other threads:[~2020-12-01 0:34 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 18:03 dired-do-find-regexp failure with latin-1 encoding Stephen Berman
2020-11-28 18:11 ` Eli Zaretskii
2020-11-28 18:46 ` Stephen Berman
2020-11-28 19:13 ` Eli Zaretskii
2020-11-28 19:44 ` Stephen Berman
2020-11-28 19:49 ` Eli Zaretskii
2020-11-28 20:16 ` Dmitry Gutov
2020-11-28 20:29 ` Eli Zaretskii
2020-11-28 21:04 ` Dmitry Gutov
2020-11-29 0:49 ` Dmitry Gutov
2020-11-29 15:19 ` Eli Zaretskii
2020-11-29 16:27 ` Dmitry Gutov
2020-11-29 17:18 ` Eli Zaretskii
2020-11-29 17:32 ` Dmitry Gutov
2020-11-29 18:42 ` Eli Zaretskii
2020-11-29 19:48 ` Dmitry Gutov
2020-11-29 15:06 ` Eli Zaretskii
2020-11-29 15:14 ` Yuri Khan
2020-11-29 15:36 ` Stephen Berman
2020-11-29 15:50 ` Eli Zaretskii
2020-11-29 16:07 ` Dmitry Gutov
2020-11-29 17:12 ` Eli Zaretskii
2020-11-29 17:19 ` Dmitry Gutov
2020-11-29 17:25 ` Eli Zaretskii
2020-11-29 17:44 ` Dmitry Gutov
2020-11-29 18:51 ` Eli Zaretskii
2020-11-29 19:07 ` Dmitry Gutov
2020-11-29 19:32 ` Eli Zaretskii
2020-11-29 19:34 ` Eli Zaretskii
2020-11-29 19:49 ` Stephen Berman
2020-11-29 19:49 ` Gregory Heytings via Emacs development discussions.
2020-11-29 19:37 ` Juri Linkov
2020-11-30 1:08 ` Dmitry Gutov
2020-11-30 20:54 ` Juri Linkov
2020-12-01 0:34 ` Dmitry Gutov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54828043-03bc-d09a-053c-2f4d7780e3a7@yandex.ru \
--to=dgutov@yandex.ru \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).