From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el Date: Wed, 03 Mar 2021 17:11:12 +0000 Message-ID: <4119ea30558f1e4145b0@heytings.org> References: <87im69uzlt.fsf@mail.linkov.net> <878s74fv27.fsf@mail.linkov.net> <4119ea3055ef8f306fc0@heytings.org> <4119ea30557ef84ca190@heytings.org> <7eb7ee0f-7dba-c90d-cb58-af42c3828643@yandex.ru> <4119ea30554b406efbbf@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6lDZpfECT8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12237"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46859@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 03 18:12:21 2021 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 1lHV2q-00034w-Nb for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 18:12:20 +0100 Original-Received: from localhost ([::1]:38100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHV2p-0003Sc-QK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 12:12:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHV2Y-0003SI-UO for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 12:12:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHV2Y-0002z2-N2 for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 12:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHV2Y-0005ok-I0 for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 12:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Mar 2021 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46859 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46859-submit@debbugs.gnu.org id=B46859.161479147622297 (code B ref 46859); Wed, 03 Mar 2021 17:12:02 +0000 Original-Received: (at 46859) by debbugs.gnu.org; 3 Mar 2021 17:11:16 +0000 Original-Received: from localhost ([127.0.0.1]:56874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHV1n-0005nZ-U0 for submit@debbugs.gnu.org; Wed, 03 Mar 2021 12:11:16 -0500 Original-Received: from heytings.org ([95.142.160.155]:41640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHV1m-0005nR-Ma for 46859@debbugs.gnu.org; Wed, 03 Mar 2021 12:11:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1614791473; bh=LCgcftj7fcUBEktxdraaUo8j/bOOytLop9/p1sqeCzk=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=aEnZMtaIq03fYKtozJmFYBwDqTWaX8QcAbGcg5Y+S9qfBLkBQEzI9/J2+HSRagcz4 ldYQv9Gip+nvRu3JV/bDJiR2jQtLtnEohnC/bmJhnBD6kQmuJ2xnzyWZKOLGvfCLkG 3lX5lR59yum7BaIdKqLf0fStQN1FQo8JUz0Eod4cII2c381CNCn2PmoI/VW7rNDkZz P232TQDkK3ztJsK7bu6rfjMoDfjUeDV/OKNPaWpW0r1KllAMIHQ5Crq+3uLr2V1mnO 2QS+nX5e3AybwI6o2SryEKUk/7pAces9FZOmWghqjObN8sEXh6ploOY/QdC8SjnYmx Zp/DVAqfo5hPA== In-Reply-To: <4119ea30554b406efbbf@heytings.org> 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:201294 Archived-At: --6lDZpfECT8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable >>> How so?=C2=A0 AFAICS, it's the exact same kind of output, except that i= t=20 >>> gets truncated.=C2=A0 And it's (obviously?) better to see the context o= f=20 >>> the pattern you are searching for, instead of the first characters of= =20 >>> the lines on which the pattern is found, in which the pattern might=20 >>> not be present. >>=20 >> Since Grep doesn't return the column number of the match, we get it=20 >> from parsing the string again. And if the string is now modified to be= =20 >> truncated from both sides, the column number will become wrong. > > I did not understand that you need the column number of the match.=20 > That could perhaps become a feature request for GNU grep: with -o and=20 > -n, also print the column number of the first character. > I wrote too fast. In fact you can get the column number with GNU grep=20 without parsing the original line: grep -nb -oE '.{0,100}PATTERN.{0,100}' --6lDZpfECT8--