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#36967: 27.0.50; Duplicate lines in xref output Date: Fri, 4 Dec 2020 01:44:47 +0200 Message-ID: <14427ed0-a177-0524-c469-406fe6248197@yandex.ru> References: <87ef1wod82.fsf@mail.linkov.net> <950a9da4-4081-fe80-598f-eeb3931e24ad@yandex.ru> <87wnxz6glx.fsf@mail.linkov.net> <20e61edd-9ee6-deab-7ff4-94b0ba527dc4@yandex.ru> <87zh2u60iq.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="19177"; 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: 36967@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 04 00:45:12 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 1kkyHf-0004ra-Ks for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 00:45:11 +0100 Original-Received: from localhost ([::1]:41180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkyHe-0001vC-NW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Dec 2020 18:45:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkyHY-0001tn-Gc for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 18:45:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkyHV-000227-Ur for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 18:45:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkyHV-0002Bo-RR for bug-gnu-emacs@gnu.org; Thu, 03 Dec 2020 18:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Dec 2020 23:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36967 X-GNU-PR-Package: emacs Original-Received: via spool by 36967-submit@debbugs.gnu.org id=B36967.16070390988395 (code B ref 36967); Thu, 03 Dec 2020 23:45:01 +0000 Original-Received: (at 36967) by debbugs.gnu.org; 3 Dec 2020 23:44:58 +0000 Original-Received: from localhost ([127.0.0.1]:42186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkyHS-0002BL-BH for submit@debbugs.gnu.org; Thu, 03 Dec 2020 18:44:58 -0500 Original-Received: from mail-ej1-f42.google.com ([209.85.218.42]:46796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkyHQ-0002B8-Iw for 36967@debbugs.gnu.org; Thu, 03 Dec 2020 18:44:56 -0500 Original-Received: by mail-ej1-f42.google.com with SMTP id bo9so6021150ejb.13 for <36967@debbugs.gnu.org>; Thu, 03 Dec 2020 15:44:56 -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=lbMa9XfEDW+zTrQVhaINAuw26tEmamdBsjAeyS9srAw=; b=VQn6I44xKq0lZ7NggkDGFw1QAAhbKN4/NGi2aXc/bBf+V1OSD8BhIOU0iz/XiVNVLa qP8JeFaGkiv4ueR/1AcR//cl634f7E7AYWjewN9sT03A/bZWx8iIIsUjr4h2TBgMxepd bi6dxpp+fsoX8P74OXA328i809L2zqVrlp//iFMgMHSbSG/J1xJLeWzI/2Sx3x36ksL4 Ijs1cN6+hHKaT1elvuhh9nUAPCyHVjWQBrhcAEWQD5wlZAVJYx9AQ7bFugkWYbzxeg+l DEaksWtRYdxZf+2pzXJU0hVOpgqa7NBYBYlqQGFWbcHjjJ6Ls7BnPvKr2V7sdeeHabEf Ehsw== 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=lbMa9XfEDW+zTrQVhaINAuw26tEmamdBsjAeyS9srAw=; b=gtqyLY1iB+M8WjbRB7bQ2u5eN29XvuFQEmRka684hdBvcncg3/4neAh1hptWEBWRa/ 0Q/11L9dtAxr3YQ2k7vv5p8enF4Sn2GmBBKBOg4Hv1BpO19HGy7cPvHOub87nbMcikXv 2MiPef/LbpVv0PMd8ox/ElvtXJPgZy5YWVB/bICdgd5igPWgkQyBoFXgr1ZBcRxSprvD Ft307aja+lO3Jg0LljEU14QaI87ccOoxuzhQT0yHyJ/lWIwFTmlPW6zoUeouqLAmO7e6 E8I2hHyQK2PYFdBT9HDsERZNGMrTvTwQNTnoLyg3fz71ztiMyvg6mbhIN0r0+2sf4upB 8VwQ== X-Gm-Message-State: AOAM533DSaUjdUjc7bHgo25+dG3FsbQftPlRVjtUYEkEWXKC5zZxI/NE EcE1ey93LM0yeax/Sx+pTlLDYpJOntVXNA== X-Google-Smtp-Source: ABdhPJy4Zjp/EbPtTtZz4VKADgPI+dS6Xorhzft6/yX81eK3AVQlcddDimRSn742XqkpTUfQPFE9RQ== X-Received: by 2002:a17:907:2122:: with SMTP id qo2mr2602055ejb.539.1607039090433; Thu, 03 Dec 2020 15:44:50 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id dd18sm1851349ejb.53.2020.12.03.15.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2020 15:44:49 -0800 (PST) In-Reply-To: <87zh2u60iq.fsf@mail.linkov.net> 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:194929 Archived-At: On 03.12.2020 23:30, Juri Linkov wrote: >>> Here is the patch that makes the broken >> >> Pretty harsh there. > > But true: I can't use it in the current form, and was waiting > when someone will fix it. It's great to see you get this ball rolling. >> Here's an alternative proposal: >> >> Combine the lines inside the rendering code instead. >> >> So each xref will have a separate location, but then xref--insert-xrefs >> will see that xref-location-line value repeats across some consecutive >> locations, and will combine them into single line with some text property >> magic (basically, copying the summary from one of them, and then applying >> 'xref-item and 'face properties appropriately). This retains the xref item >> semantics (as opposed to, say, associating an xref item with multiple >> locations). And _hopefully_ the replace-related code won't need >> any changes. > > I tried to improve xref--insert-xrefs to group matches by lines > by using the most convenient function seq-group-by. But then > noticed that xref.el doesn't rely on seq.el. Even xref--alistify > that groups matches by files could be replaced by seq-group-by. > Is it a requirement to avoid using seq functions in xref.el? Not really, no. project.el pulls in seq already, why not have xref do it too. I'm _slightly_ worried about extra garbage if we do seq-group-by twice (with an extra list for every line, even those that don't need it), but that's what benchmarking is for (can do that later).