From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#44983: Truncate long lines of grep output Date: Thu, 10 Dec 2020 13:08:10 +0300 Message-ID: References: <87h7p0f611.fsf@mail.linkov.net> <87a6uqafmk.fsf@mail.linkov.net> <87zh2q61n6.fsf@mail.linkov.net> <3620abd0-ce79-cc9d-3fb2-255e91f13da1@yandex.ru> <87mtyo3x1z.fsf@mail.linkov.net> <857088a6-fe90-d989-9115-2c159b2a02e6@yandex.ru> <87lfe6x1uf.fsf@mail.linkov.net> <87czzi2ju2.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32410"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: 44983@debbugs.gnu.org, Dmitry Gutov To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 10 11:44:11 2020 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 1knJQh-0008Jw-7L for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 11:44:11 +0100 Original-Received: from localhost ([::1]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knJQf-00020U-Ux for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 05:44:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knJQY-00020B-L4 for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 05:44:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knJQY-0001by-Aw for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 05:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knJQY-00064o-8v for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 05:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Dec 2020 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44983 X-GNU-PR-Package: emacs Original-Received: via spool by 44983-submit@debbugs.gnu.org id=B44983.160759702323303 (code B ref 44983); Thu, 10 Dec 2020 10:44:02 +0000 Original-Received: (at 44983) by debbugs.gnu.org; 10 Dec 2020 10:43:43 +0000 Original-Received: from localhost ([127.0.0.1]:37109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knJQF-00063n-Gy for submit@debbugs.gnu.org; Thu, 10 Dec 2020 05:43:43 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:55963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knJQD-00063V-TK for 44983@debbugs.gnu.org; Thu, 10 Dec 2020 05:43:42 -0500 Original-Received: from localhost ([::ffff:41.202.241.31]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E527.000000005FD1FBD7.00001ED3; Thu, 10 Dec 2020 03:43:34 -0700 Content-Disposition: inline In-Reply-To: <87czzi2ju2.fsf@mail.linkov.net> 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:195638 Archived-At: * Juri Linkov [2020-12-10 11:34]: > > Also see this: > > ,---- > > | grep -oE '.{0,20}jQuery.{0,20}' bootstrap.min.js > > `---- > > But what if the user enters such a regexp as "abc|xyz", > then it will be composed into such command: > > grep -oE '.{0,20}abc|xyz.{0,20}' > > that matches either 20 characters before "abc", or 20 characters > after "xyz". Then needs to add parentheses: > > grep -oE '.{0,20}(abc|xyz).{0,20}' I do not find it problematic. Grep is anyway kind of advanced tool. I think that Emacs "Search for files (grep)" menu option is anyway not user friendly. It is made for those who know what is GNU/Linux, UNIX, BSD. When user is faced with that option most probably will give up soon in using it. Because the prompt asks user to enter something like: grep --color -nH --null -e but does not tell the user what it means, neither that one has to put joker or file names after the term. Usability is degraded as the function is only for advanced users there. Majority of GNU/Linux users use GUI for any work. In that sense advanced users should know how to use grep to at least get results they need and want. You put good intentions to beautify the grep output. But it is probably not necessary. They will not mind of highlighting. They can do: grep -nH --null -e And there will be no highlighting. It gives the result. What would be more user friendly would be a form or wizard that would specify if all files are to be searched or recursively, and what would be the search term. That would degrade power of grep but it would be more user friendly to many people. In my opinion I believe that majority of users who ever clicked "Search Files (grep)" gave up after few attempts.