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.bugs Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el Date: Sat, 6 Mar 2021 14:37:26 +0200 Message-ID: <109276c6-30fb-b1ca-cafa-48a15710099b@yandex.ru> 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> <4119ea30558f1e4145b0@heytings.org> <4119ea30555e80bdcf7e@heytings.org> <1c82e582-8b90-f3c5-5391-1e88ca4e7ab2@yandex.ru> <4119ea30553e3f90ab8c@heytings.org> <87y2f42ex5.fsf@mail.linkov.net> <4119ea30552873ab9870@heytings.org> <83eegvk2u0.fsf@gnu.org> <9cff0f8894658f3b50c8@heytings.org> <83y2f3huz2.fsf@gnu.org> <9cff0f88942d4103c685@heytings.org> <83mtvjhrzj.fsf@gnu.org> <9cff0f889435d8d03313@heytings.org> <834khq266r.fsf@gnu.org> <9cff0f8894ab45713d12@heytings.org> <16ac41d4-5718-0cec-a68b-4abcc736ee4a@yandex.ru> 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="5154"; 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: 46859@debbugs.gnu.org To: Gregory Heytings , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 06 13:38:13 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 1lIWCC-0001Ex-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Mar 2021 13:38:12 +0100 Original-Received: from localhost ([::1]:51276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIWCB-0008OS-VW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Mar 2021 07:38:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIWC2-0008O2-Kk for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 07:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIWC2-0004oF-Cv for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 07:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIWC2-00067i-Ao for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 07:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Mar 2021 12:38: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.161503425823504 (code B ref 46859); Sat, 06 Mar 2021 12:38:02 +0000 Original-Received: (at 46859) by debbugs.gnu.org; 6 Mar 2021 12:37:38 +0000 Original-Received: from localhost ([127.0.0.1]:36196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIWBe-000672-HS for submit@debbugs.gnu.org; Sat, 06 Mar 2021 07:37:38 -0500 Original-Received: from mail-wr1-f54.google.com ([209.85.221.54]:37416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIWBc-00066o-Ht for 46859@debbugs.gnu.org; Sat, 06 Mar 2021 07:37:37 -0500 Original-Received: by mail-wr1-f54.google.com with SMTP id v15so5443823wrx.4 for <46859@debbugs.gnu.org>; Sat, 06 Mar 2021 04:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u5pLcM2SWv+vlbB81aPAkFLcDu1WeFU13yMdpAcwhmM=; b=hsqsmfjwAu7qeBxwtAycfmZAVFwzS/MiwQZXVHv9rsa3YNE5gWVfpXzsjsEyhHmyBG 4w9M1y6PRfqyL2bE9JmRLKPg5DP5UZRPT/40LSRRbHREgr/4hbhdaShwCM9EO1wEqUHo /vuXMemSGNDx6RnhZYkKwORHymfHI90vkMdWN40Cvhlp4VUEVXts5iM3eOLgZROQvE6X NxnmgyLUVQj2pzJfYJIZXfEpLRa7/7qisPT8wmyU1acgCJCGRTTYJJWmgKe7CfdLDd98 RyVWzajesKyPRSBxxlixz6BBxLV11/M63JJAbqcLZViIVsaea95kUwPzc50+DSO5PTUe 9ujw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u5pLcM2SWv+vlbB81aPAkFLcDu1WeFU13yMdpAcwhmM=; b=QRfTITla4MpGVAEZ9BJJPx6IJr0AV/lISDg5Zs62Q6TWbLDJ/2+ChB3/2dGkIs+8Yu wjTFty/aVLxoi9d3niFCdS3klXok3abDvuxZSPafwiWInABIYujvACNkhSb9wNszXbGp 3abFGJ1mDr9hA3qORpFTsUcf1Ii009/kKcf22o3iCH8T5UyIFpDvaJ5tOvyshE0mt1ve p71ro7TKaEjQNv9ouz1RZvBvIH9Pan5AJQ7ZvzJPuT3C2t5aePOgYUNQV7ornV0Huuke zh6woKO38mKvXAILSDQ9O0I259XbrXzjkyKjkjZzfElmOTCm9GSuY5nkMyaivPqEZzCb rGhA== X-Gm-Message-State: AOAM531xNfxqYynyCPqdbTrM0/U85gNQm5zB0rbtWYfN3svWUAfhzEiA BfTUbeSfKFV1Sz3D7m5l0WWfzGbloHg= X-Google-Smtp-Source: ABdhPJwVNx3tLeE3ahRLqgIBJFJ3U5i3xSgGQkcU9RQTKj8kHEtwewBegwmNVjJ0pttp826pA6BPDg== X-Received: by 2002:adf:828e:: with SMTP id 14mr14043519wrc.123.1615034250718; Sat, 06 Mar 2021 04:37:30 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id a21sm9063858wmb.5.2021.03.06.04.37.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Mar 2021 04:37:30 -0800 (PST) In-Reply-To: <16ac41d4-5718-0cec-a68b-4abcc736ee4a@yandex.ru> Content-Language: en-US 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:201617 Archived-At: On 06.03.2021 14:31, Dmitry Gutov wrote: > Otherwise it would be possible to use this approach (by introducing a > Grep-specific location type) and avoid parsing the line contents for > every match. Except, um, we still need to fill in the "summary" attribute for all matches, so that there is something to display in the Xref buffer (the line contents around the match), and the -o flag strips those. And if we were to use the '.{0,100}file.{0,100}' trick, it messes up the location of the match, the reported byte offset become unreliable. Also: grepping for that kind of regexp is noticeably slower than grepping for 'file'. Or even '.file'. Like 85ms vs 7ms slower.