From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 27 15:15:01 2020 Received: (at submit) by debbugs.gnu.org; 27 Nov 2020 20:15:02 +0000 Received: from localhost ([127.0.0.1]:46305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kik8z-00035O-HV for submit@debbugs.gnu.org; Fri, 27 Nov 2020 15:15:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:37512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kik8x-00035G-Jm for submit@debbugs.gnu.org; Fri, 27 Nov 2020 15:15:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kik8x-0005BT-DX for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 15:14:59 -0500 Received: from sonic311-31.consmr.mail.ir2.yahoo.com ([77.238.176.163]:43125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kik8t-00009E-0h for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2020 15:14:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1606508085; bh=vZVCh1ivrakBJotZr2HhfhpWSrIiUgw1PCscdWfcL6c=; h=From:To:Subject:Date:References:From:Subject; b=pQrwNHb3Q05QXI7RG6XWWaF+7yRAAlFBsTY/57+c6nnT9vmIlqNwvhd+ZqcpVocf9K56csCxRDuK1+KaY6IJswJ9q93lVLUE/ADhd1gJcNzLqVO7zFmMW/5G1H/qHwvVeFUbQO8AFANlgH11gkn/SkjrJ+my0mkADKZAbtj3y/sfeb3E2CVWAHMSnyqhbegQsuEftVbSyO9DKP6+xVptyYywel4/SVgIsfnzymTYrOT4ueDww/IrxEFYgsNHFAji3eT3DuEcArrHApy4CZVAXs5oLXpa3qxenu8XMkP7i2Ia8ZPNGXHcZlaMB6fRi3/NqtrL3nWIP+W3CGVQkrUQ4A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1606508085; bh=wO5QxLh/lFWrlLgHx7KZ5l51saSsLif9EQoUqhRyGy5=; h=From:To:Subject:Date:From:Subject; b=Ic4TQb9gsLqfpsmWDafxRN+l1xhF6aHUioBs46ANJHIZKkcebkfvUv2xc6txKbcW4UdRJ9I0FAEcI8vyUSGfGoYEllA7xaxYJjVfmcglj1I7WvqANkpifZuChXP3AJR7ciF1yalTAilcF+/KvnnFCNsNc3JGKSX/Oy5nqbIMkYUH8AeJtcRmVUlfe56yyTUD872G7QLCEd16hTb2qBrPXQCu451YJlGZxIZbostcRDvjzfsUyipKfrUTunLLHgx2kLhnvuUBeOtvh/PSZ9q7L2Zf0PxF1YP+Ha0IlH0UxPeIaIKDVCMxoewmmeuJSFR0ir6eubOZ4YofnjM+IHcGpg== X-YMail-OSG: DtGgxl0VM1nxgxYwtJen6IBgJtgexpm0qLy6itxcNNgHKa92tzAl0OVjghFXD7Z ldOZrfNAzw0Rl_kyFYK7KQ7Q1hm7mD13NPnjXpukQI6N7le3dZuVIKzuPNvG3N61gdmCAszslCa3 vHbXCHc9h9mbEDfJqYVK_P3wAW5aEzhM47qKdOE7j8u0WHg_nxOJlghTC2s1laGJm6fNg1.1P3VV VCtUp88fF2wItXPf4SFu3BgX4DBoQlKloE8RE9HvHRMZOO_csaLDbRNurzQDfv_d_4r78xfr9jV8 M8jJH7GTIyl27dtLN6ywdh054S1372_HtmupaJTuE0PT.Xu1_WflbjJkj6GHK7hr9tZyLOEuwWKN bcP.IgjiGr2xJdU33R4Z8Fe1G0LRUJ0DV05kG4rz8DmQ4P7oAMA7aLLwBeeVFLnjC26afSWsOVtf Iel0Ugc2x0IHm_slMoUwJJ74awDNVExCMNkN7r88GDFiuqAs0MkpoT2fhsWhURAV3..jqVy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jlb_oIQMRolufRkYgja0DSy9O4MOA0FcR22cBzQrxrhvRmQhXawCOlaHe94fsA8Yq9Q0 XXjB_GYiy_U1jN0ue0cm0pQIO79SmMkkCkehPdxbi3hMDPoajtOY_.xW5.0L.yPoMsdZGFur3sOE M2hafp_2i28XiLu.6voG8tRLioIXch2_8ywbQQBT8T6DZHSD0NyLLm44a4kI9nquszDFtFD62SbI RPIHzLeJft489hpZnDO2AmjxGAg49_Y6vgu0SM61BVHilp_ayyIrErgUUF_t3fKoYVBCpbLUrkPW Fk7qobouMItfsauWZGaIIMe8CTFSO2.sAhZonBBu.c62gcaQRdwtDRCTPWBHNfblPTedA_rJMQJp u8_49IBrrk6LkyMkBV5wM7qgiAZLElgB7JlYEQdr3G_ZR3usrDPEMr1RyGualiGa_7ydg9MlOHW8 4.e6lrGQf1bgFbk1mM23wV6kPoIc04jVZyT29kIYfTBE5HmD0PwPq0z0y6deRrJyE58h8O__Ynge eOemMMt6MHsJNJNZMuVUlDIbMAVB7SX.1A0sXxrpvvvZ9sXt8Cfz0g2Ozgj9g0ydFQ0x4Da5nklN n5VqcpXTqmaugiAM6y5eK0ihcxf6ZAYXicVAmzaEhQ_8Mdz.qcmENb6FBz3FeA_vuARDtOOrpQTf wUFv7lwHYF9og7jBFgmYY_.XIxmvtRPljx5Rm67KSxqEmNFh3Y7ODPCp4x8zfaaXODQTZOd7Asr0 ry8NYx.bQ.d3KjT096P6mFcttVguiCz0SHgNdI80CDjnBJpzOJof_m25oGplTCJ3yFl5dqna1HMw rWYc4WeBzL95RgQcbOi6pKhPMdI8MydmAX7yEENAP4XIIGqoDDHru.4p.OBCwT.LoDs.aBYYzMxd y Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Fri, 27 Nov 2020 20:14:45 +0000 Received: by smtp422.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 21e8074cfbca8f817904049b23506598; Fri, 27 Nov 2020 20:14:41 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: bug-gnu-emacs@gnu.org Subject: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace Date: Fri, 27 Nov 2020 21:14:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain References: X-Mailer: WebService/1.1.17111 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 721 Received-SPF: pass client-ip=77.238.176.163; envelope-from=mardani29@yahoo.es; helo=sonic311-31.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Scenario: A package customizes xref-show-refs-function to use a different UI to show xref results. If that function does not return a valid xref buffer, then Dired's dired-do-find-regexp-and-replace (bound to Q by default) won't work anymore because it calls xref-query-replace-in-results on the buffer returned by xref--show-xrefs. A workaround is that the package explicitly calls xref--show-xref-buffer, which is done for example at https://github.com/alexmurray/ivy-xref/commit/aa97103ea8ce6ab8891e34deff7d43aa83fe36dd, but it doesn't feel like an ideal solution because of the duplicated work. Is there a way dired-do-find-regexp-and-replace could not depend on an actual xref buffer to perform the replacement? From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 28 14:05:04 2020 Received: (at 44905) by debbugs.gnu.org; 28 Nov 2020 19:05:04 +0000 Received: from localhost ([127.0.0.1]:49058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kj5Wq-0007E6-9h for submit@debbugs.gnu.org; Sat, 28 Nov 2020 14:05:04 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:40142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kj5Wo-0007DT-Dn for 44905@debbugs.gnu.org; Sat, 28 Nov 2020 14:05:02 -0500 Received: by mail-wm1-f45.google.com with SMTP id a3so10355776wmb.5 for <44905@debbugs.gnu.org>; Sat, 28 Nov 2020 11:05:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VSMGvbNb0y2EXkCCqHif9mnHfK7Dw53ljJOda62nOIY=; b=AdGTfu1kXUtxSoFj1N7n2KhFY3n2PF8prxdZcmSz22JeGxPAvuP5p02xxUeSZlu/A+ vB9IO97Lg272qKa4GS83f6KcJ/xQ3kzEG+TA4nbfcu5mMy3LjVeS8PQ+7PJURyHRy1nR NeuPw7mo8Y6QabSch9mePS9JRNWwe4X0zKkoJ+xBFNWaVm21UZMbHRyIOQum3Gb0o3yG wf5xQ0e6lpcr5cGFcT4zxFPh3HqggsD5knnUZJyB41MIdtYaZH4uzkXwR4M3+4r502KB rqvS8H8rgGPjTMIQL9zP2nIRzl/aJvAzMcubGK2LrC//cBN6cFWbsXNf8QnZf+od2My9 uNuQ== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VSMGvbNb0y2EXkCCqHif9mnHfK7Dw53ljJOda62nOIY=; b=nL4j2LyZkUPwwfuB39SrUTGGpZea2fQvmn9IKakQ99ynUFptTHOyKaRnlOFIdLdIcP 5DALV9VYFhHWZaEIjOEarCk4gCm/UmxY+vfeMKBJEbF4x3nNCxQSmCiN/e8MOW3LkPbs BFESUa1az8bJn60cJP7+dEnQIlA3SO7goYztpDuLAhoQ89ITi5M8Dwz7pjZ2K85wB1l0 gADDHj4tyr2yHjnWLFOcPG9aQPLW+RQdEHD5R5BeNdJEhcS0g/wIEhOukEdbzcsUyKHq FWGCzrH0irlu/9zO/ts3DnjvqTiD+GPFaHAWcldmOOBlLKcaUu/t7I2fsQSA8dw5xZ8a ciYw== X-Gm-Message-State: AOAM531D0lN3kj2vezgnS/6VNtfDBmXxM8PIt4rHTJp7Sj73GwoeOoKT Crytu63rEA65fX81LXOt8MZafO45rlj7tA== X-Google-Smtp-Source: ABdhPJw2NkoSZcVWt2wVrtc/YWU86OrRjYkXStcHDAI6BWhPoR1cC/dpm0RnfKayAAzZXROIINxFfQ== X-Received: by 2002:a1c:4e10:: with SMTP id g16mr15745472wmh.48.1606590296304; Sat, 28 Nov 2020 11:04:56 -0800 (PST) Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id 2sm24673662wrq.87.2020.11.28.11.04.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Nov 2020 11:04:55 -0800 (PST) Subject: Re: bug#44905: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace To: =?UTF-8?Q?Daniel_Mart=c3=adn?= , 44905@debbugs.gnu.org References: From: Dmitry Gutov Message-ID: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> Date: Sat, 28 Nov 2020 21:04:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44905 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 27.11.2020 22:14, Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > > Scenario: A package customizes xref-show-refs-function to use a > different UI to show xref results. If that function does not return a > valid xref buffer, then Dired's dired-do-find-regexp-and-replace (bound > to Q by default) won't work anymore because it calls > xref-query-replace-in-results on the buffer returned by > xref--show-xrefs. Oh, indeed. Thanks for the report. > A workaround is that the package explicitly calls > xref--show-xref-buffer, which is done for example at > https://github.com/alexmurray/ivy-xref/commit/aa97103ea8ce6ab8891e34deff7d43aa83fe36dd, > but it doesn't feel like an ideal solution because of the duplicated > work. It's too bad this wasn't reported a year ago. > Is there a way dired-do-find-regexp-and-replace could not depend on an > actual xref buffer to perform the replacement? Well, there are options like: - Mandate that any xref-show-refs-function alternative has a corresponding feature that performs replacements in the matches. - Reimplement dired-do-find-regexp-and-replace entirely in terms of a different UI (e.g. create a faster dired-do-query-replace-regexp). But in this particular scenario we can just override xref-show-xrefs-function to use the default behavior, see below. While this change in the Right Thing(tm), I have to question the wisdom of setting xref-show-xrefs-function to an Ivy or Helm-based function, though. Those UIs serve to help you choose one item, whereas commands like dired-do-find-regexp and project-find-regexp show the user a list of matches, to interact with (usually) several of them. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 94a2bbf1f3..4caafc8df6 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3140,7 +3140,10 @@ dired-do-find-regexp-and-replace (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common)))) - (with-current-buffer (dired-do-find-regexp from) + (defvar xref-show-xrefs-function) + (with-current-buffer + (let ((xref-show-xrefs-function 'xref--show-xref-buffer)) + (dired-do-find-regexp from)) (xref-query-replace-in-results from to))) (defun dired-nondirectory-p (file) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 29 07:57:35 2020 Received: (at 44905) by debbugs.gnu.org; 29 Nov 2020 12:57:35 +0000 Received: from localhost ([127.0.0.1]:49970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjMGl-0007RA-45 for submit@debbugs.gnu.org; Sun, 29 Nov 2020 07:57:35 -0500 Received: from sonic314-19.consmr.mail.ir2.yahoo.com ([77.238.177.145]:43440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjMGf-0007Qo-LE for 44905@debbugs.gnu.org; Sun, 29 Nov 2020 07:57:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1606654640; bh=Kjz9zKzVRqplkcqfQq/k9iaPuXq9QGUKp9WYeOoRW6s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject; b=M8AMWJti1EE850/xXzhk1ZGBaoA2uAyrFLYzFrmoeTazWvP8aMe4cMsii3fS4+1BIhMa+rn6BwFhxJCThYnUuImaYFASxod79HGCHY0lBGYQ++8HtoUd8XxSiaBSnfb2j7TusEb2Rj+AVOAfQD1eyYGNon81m6EKlGLlH3vkCT0OWlF06L+qDB69iRTvUgCtt7WInqZvnhZDbV27qtc0d6AwheZFYDYrWeJg7jA9/njQ3i0ozz6xphEUlEvMWOjqWca25+2AdhpnGqUWUzJHqlr8hrmQB1Ec5zIXMwFUyMQxqif6X8UNptPTBWpAklak7RK3pdnel1dj81oL3jvlew== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1606654640; bh=eCqQq9kHl0nCIDwS96Bhh3e0g5w3Ga+jh+MGcvVqNw0=;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2._0nImwzCOyVPg6m8C58q4CqSlh8xhyig18bfz4Ov_e_HTD0IIHsFPauVGVBaQ b2QdTFhNIPxjMq_o2niOW4otWfjtYTzP7zJrlZUm_ZfTM_YPmyd9Dfo3ln5vG_ciKhRPeqZv25Ok hf0dEwlTbn4b5xpedEC4pH44xZIAwU7X7painbxzmJkZsANxafMmIZfw.UeG7mrr.pyZs5r4j1e. GO9dQz7zDdJejCuVRIBX3GQTb2VSgQiS7T9y7I4iwUn9QW3VV9mNNZGph6MAfNDzJItt5s6nqlqQ 4Ibs7Nqz_qFrX5Lw8viRprMLp3nWuwEtgLgJkrNL7MatmwKcnZupex22j0Kokq5qK0oKZcbAB.Jf suWYF3iLnBZLozwvCjr6y4pxBODWxtDhBicPPsDDs78ZJd1UncTFeyuP.AoaSXsDymDqCjHeDYP_ U.o9.FT4RQSPUO2SKd3fUUu4GGHpR4Ir7eegVDCicVzXWhke4Qn1EHDtn2LUHUJxvpb9hJoXxoeq jLbL19vmqRg0RnRNYauqTz.zQN8zm3GSUtIt6mC_EC0FlN4rdQp0rOkWUjc_Ywi4PmKeLt0Klr26 GKQ4qDRusESuRBSSrvhJbaqqPEhjK2fkQA9FbGCe.9jolTAC87oIhfuL_Jx6QDKvtzKoTMz0J.wt XJc7uFTvqm8GuY1c.R22ucppbGIgrxWMRaT0eZ.X7YQzp5ZyGH_4HO.irhhKi_hXi52lSZHDs57a lWld8NHBfpfqlxk3Nec.5WHvXQ45FDuGKteIiq9C6TRAD7gvASzg6AjFyM9_J8TnCZLHHndXVe5v mnVDwUg66hL5VXFDtju783lo- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Sun, 29 Nov 2020 12:57:20 +0000 Received: by smtp422.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 96c09036ea587be88910fd55e0287144; Sun, 29 Nov 2020 12:57:14 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: Dmitry Gutov Subject: Re: bug#44905: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace References: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> Date: Sun, 29 Nov 2020 13:57:14 +0100 In-Reply-To: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> (Dmitry Gutov's message of "Sat, 28 Nov 2020 21:04:53 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.17111 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Content-Length: 1388 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 44905 Cc: 44905@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Dmitry Gutov writes: > > While this change in the Right Thing(tm), I have to question the > wisdom of setting xref-show-xrefs-function to an Ivy or Helm-based > function, though. Those UIs serve to help you choose one item, whereas > commands like dired-do-find-regexp and project-find-regexp show the > user a list of matches, to interact with (usually) several of them. I agree with you, Ivy/Helm may not be the best UX for Xref, but this particular problem can still happen even if the user returns a buffer that represents the Xref data in a different way. I think that xref-query-replace-in-results assumes certain invariants from the original *xref* buffer that are not documented. > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > index 94a2bbf1f3..4caafc8df6 100644 > --- a/lisp/dired-aux.el > +++ b/lisp/dired-aux.el > @@ -3140,7 +3140,10 @@ dired-do-find-regexp-and-replace > (query-replace-read-args > "Query replace regexp in marked files" t t))) > (list (nth 0 common) (nth 1 common)))) > - (with-current-buffer (dired-do-find-regexp from) > + (defvar xref-show-xrefs-function) > + (with-current-buffer > + (let ((xref-show-xrefs-function 'xref--show-xref-buffer)) > + (dired-do-find-regexp from)) > (xref-query-replace-in-results from to))) > > (defun dired-nondirectory-p (file) LGTM, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 29 20:00:28 2020 Received: (at 44905) by debbugs.gnu.org; 30 Nov 2020 01:00:28 +0000 Received: from localhost ([127.0.0.1]:52946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjXYK-0005xB-D7 for submit@debbugs.gnu.org; Sun, 29 Nov 2020 20:00:28 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:53144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjXYH-0005wy-V3 for 44905@debbugs.gnu.org; Sun, 29 Nov 2020 20:00:26 -0500 Received: by mail-wm1-f51.google.com with SMTP id a6so2126726wmc.2 for <44905@debbugs.gnu.org>; Sun, 29 Nov 2020 17:00:25 -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=wyfeYt8B8Lf0hutzhUQrNSWSsMe6SVKPR6zLBT9kUr8=; b=ckNLqutgemUV0mA5FnWFQyi+yBpsJjp57MRY1H2ZRru7kZNtlMEFIyqWarhTsO4T0T jXs6YjPSiMs9FpBbZBQJEmOaQTZkd8G/bNXyq9Ah/oFrJZXwStY7/ZZYc9ilK88Ifo1w mOuyzhO5nvBUSKv8T+Gz8mjBkccnYbADMwLJjvUpufRa+BHTP+ftqvyds3dnClgMTAjE rqsaebJTSgj2HhWPgwSvnAWFxidqQycrBcTVQXquEiZpbTRCHaB66L1O075f/Cb8ypcZ kKFh+2JPcw3XwOqPyeuOZzG49JMVsMr3OM3m7JRFTeFg9P6KVbm1OT5DP6OYvCdY6/lg oe5Q== 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=wyfeYt8B8Lf0hutzhUQrNSWSsMe6SVKPR6zLBT9kUr8=; b=Y4Nq14Q3jDfuz/yxSSyyhwEtkBb28su5Paetw9IpcsJ0sivtXmwCnFORuObFa3gVgs 4pnvvS8VSt2fMiAngvUSQS7LBbpWML80wwArVl2mHqJEybXjvWrOK6DoLJtLiYWIu7Lc xGtLzzo3eNiSkhQSLnQwTqcYPo8+fj/xwWvB7jQgku8KrpcxeP4r158Ac+qd/Oat/g9o RUHWsvPlv/skdNaG2Xxt7+2FcCYYq/gxtW51P3WrYHJUqDKvtHzCNo51HXwSG41oIe74 uoMuNlBkF7JT2IzA72ND7++kNCrUAGCtXOatYdWhup3NiLiKh5fN/+XwAD2vgy8bUXuy ep1w== X-Gm-Message-State: AOAM530hpQbHGPY/BcWrS5XwseWRDg31MHas7P7y8lAxUflDeodhkswO vc23EBG+0UH2+7Wuio2Po7Y= X-Google-Smtp-Source: ABdhPJw1QXB4jHbn1wQwtdpLFKVLfqIqpUS6Ssh+Xqu2i/z9gn5wEGAvcnyebXYYFcTtjqQisTs/WQ== X-Received: by 2002:a05:600c:2314:: with SMTP id 20mr16529680wmo.92.1606698019849; Sun, 29 Nov 2020 17:00:19 -0800 (PST) Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id b12sm2142005wmj.2.2020.11.29.17.00.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2020 17:00:18 -0800 (PST) Subject: Re: bug#44905: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace To: =?UTF-8?Q?Daniel_Mart=c3=adn?= References: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> From: Dmitry Gutov Message-ID: <808e5fa8-9a5f-766e-39b0-c68da53b0d50@yandex.ru> Date: Mon, 30 Nov 2020 03:00:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44905 Cc: Eli Zaretskii , 44905@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 29.11.2020 14:57, Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Dmitry Gutov writes: >> >> While this change in the Right Thing(tm), I have to question the >> wisdom of setting xref-show-xrefs-function to an Ivy or Helm-based >> function, though. Those UIs serve to help you choose one item, whereas >> commands like dired-do-find-regexp and project-find-regexp show the >> user a list of matches, to interact with (usually) several of them. > > I agree with you, Ivy/Helm may not be the best UX for Xref, but this > particular problem can still happen even if the user returns a buffer > that represents the Xref data in a different way. I think that > xref-query-replace-in-results assumes certain invariants from the > original *xref* buffer that are not documented. True. >> >> diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el >> index 94a2bbf1f3..4caafc8df6 100644 >> --- a/lisp/dired-aux.el >> +++ b/lisp/dired-aux.el >> @@ -3140,7 +3140,10 @@ dired-do-find-regexp-and-replace >> (query-replace-read-args >> "Query replace regexp in marked files" t t))) >> (list (nth 0 common) (nth 1 common)))) >> - (with-current-buffer (dired-do-find-regexp from) >> + (defvar xref-show-xrefs-function) >> + (with-current-buffer >> + (let ((xref-show-xrefs-function 'xref--show-xref-buffer)) >> + (dired-do-find-regexp from)) >> (xref-query-replace-in-results from to))) >> >> (defun dired-nondirectory-p (file) > > LGTM, thanks. Eli, is this OK for Emacs 27.2? Here's also a slightly more future-proofed version that avoids referencing the function we might want to rename/change later: diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 94a2bbf1f3..26155190d4 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3140,7 +3140,13 @@ dired-do-find-regexp-and-replace (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common)))) - (with-current-buffer (dired-do-find-regexp from) + (require 'xref) + (defvar xref-show-xrefs-function) + (with-current-buffer + (let ((xref-show-xrefs-function + ;; Some future-proofing (bug#44905). + (eval (car (get 'xref-show-xrefs-function 'standard-value))))) + (dired-do-find-regexp from)) (xref-query-replace-in-results from to))) (defun dired-nondirectory-p (file) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 10:27:14 2020 Received: (at 44905) by debbugs.gnu.org; 30 Nov 2020 15:27:14 +0000 Received: from localhost ([127.0.0.1]:56285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjl58-0002EL-ET for submit@debbugs.gnu.org; Mon, 30 Nov 2020 10:27:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjl56-0002E7-VX for 44905@debbugs.gnu.org; Mon, 30 Nov 2020 10:27:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57569) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjl51-0003BI-1A; Mon, 30 Nov 2020 10:27:07 -0500 Received: from [176.228.60.248] (port=3504 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kjl4z-0007Q4-MK; Mon, 30 Nov 2020 10:27:06 -0500 Date: Mon, 30 Nov 2020 17:26:57 +0200 Message-Id: <835z5mlvb2.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <808e5fa8-9a5f-766e-39b0-c68da53b0d50@yandex.ru> (message from Dmitry Gutov on Mon, 30 Nov 2020 03:00:17 +0200) Subject: Re: bug#44905: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace References: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> <808e5fa8-9a5f-766e-39b0-c68da53b0d50@yandex.ru> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44905 Cc: 44905@debbugs.gnu.org, mardani29@yahoo.es X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 44905@debbugs.gnu.org, Eli Zaretskii > From: Dmitry Gutov > Date: Mon, 30 Nov 2020 03:00:17 +0200 > > >> diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > >> index 94a2bbf1f3..4caafc8df6 100644 > >> --- a/lisp/dired-aux.el > >> +++ b/lisp/dired-aux.el > >> @@ -3140,7 +3140,10 @@ dired-do-find-regexp-and-replace > >> (query-replace-read-args > >> "Query replace regexp in marked files" t t))) > >> (list (nth 0 common) (nth 1 common)))) > >> - (with-current-buffer (dired-do-find-regexp from) > >> + (defvar xref-show-xrefs-function) > >> + (with-current-buffer > >> + (let ((xref-show-xrefs-function 'xref--show-xref-buffer)) > >> + (dired-do-find-regexp from)) > >> (xref-query-replace-in-results from to))) > >> > >> (defun dired-nondirectory-p (file) > > > > LGTM, thanks. > > Eli, is this OK for Emacs 27.2? Yes, thanks. > Here's also a slightly more future-proofed version that avoids > referencing the function we might want to rename/change later: That, too. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 20:50:28 2020 Received: (at 44905-done) by debbugs.gnu.org; 1 Dec 2020 01:50:28 +0000 Received: from localhost ([127.0.0.1]:57228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjuoF-0007lr-Qr for submit@debbugs.gnu.org; Mon, 30 Nov 2020 20:50:28 -0500 Received: from mail-ej1-f41.google.com ([209.85.218.41]:33806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjuoE-0007le-Lh for 44905-done@debbugs.gnu.org; Mon, 30 Nov 2020 20:50:27 -0500 Received: by mail-ej1-f41.google.com with SMTP id s13so620586ejr.1 for <44905-done@debbugs.gnu.org>; Mon, 30 Nov 2020 17:50:26 -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=OvU2kQYj6rnouJz5WPVU99eaN0nRpkJNzr7bMu6wz/I=; b=VNnczpd5uxCu+SecH4dMmjfu2XxdG1K5EsAW3vZ6xjUmswJCg7lYalcNe6Q/Iz9Lu8 1qAqNXCMq7JV6Fiw4Jmnys33pv0xeFErSG4amgeU6hjUlzHAmtx6v0Fr6XY3fgvNB+BO nklJFQ26EzbbnF1rweJQlnFTe3rRNkN3ka1BFr44sNmEVNepreJfKVNZMx+92LyVxtp9 iaCG0k8sdahHCUl35q8UTXggK/XIPICcTQ4n7uOlqF+OLOTh48t19JO4siMTkmGeVQvh 7ptIU6UXL1DTUFbadFeTUbOyTAxmIYWkhJ7K9+dlqVOCX9DRrpEfvXE6eYKO0v8eGy7g aN9Q== 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=OvU2kQYj6rnouJz5WPVU99eaN0nRpkJNzr7bMu6wz/I=; b=p/WaVQ6IZCTh8ob3vKQFV5Q+oHH85Qu8H9cw/UMQEZCqNVhgxKgO+vfUi6Ydq5HkYS b8VmYjyf2XZWJ3or6I/Jjx8dSrmBHElaVZqfLgYjTkT4kf+6a2jgMVQHGMFpm30TP06x CWQ5Vfj0VYcOXVsyajlq/VmPVD3qzijOZwOKopqxsSewJzs+lx7K61A9TvpQbNgGZH0L KD/I7Lz8iaqDfErxWznUFEphgLcidsncS/RE39gLRQznAnqeZlmT9LWGcRGNmhjTop5m qqibMxWBahqznp3RqshHO6pFaMAYFfM1bdTXO4KU6msxx39OuKXzGWRqo6ALoddAKfC9 zWJg== X-Gm-Message-State: AOAM5334gnjWuuML0xY6x7AZoj79EEN8zRp1Hg8FsaCu8KQZptFoOv14 Ikzoykjdw9aSJuW50E9nMKA= X-Google-Smtp-Source: ABdhPJyP3Quu7/9W+yVFQH3pFpbzSjmnXuJSr5XRwV6U3WgstMIbTMb1TyI78yAW/+kwuuF8heAJpg== X-Received: by 2002:a17:906:dc4:: with SMTP id p4mr801662eji.56.1606787420733; Mon, 30 Nov 2020 17:50:20 -0800 (PST) Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id o33sm69058edd.50.2020.11.30.17.50.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 17:50:19 -0800 (PST) Subject: Re: bug#44905: 27.1; Packages that customize xref-show-xrefs-function can break Dired's dired-do-find-regexp-and-replace To: Eli Zaretskii References: <7ab2afb1-33ec-bca0-4014-131130e71a04@yandex.ru> <808e5fa8-9a5f-766e-39b0-c68da53b0d50@yandex.ru> <835z5mlvb2.fsf@gnu.org> From: Dmitry Gutov Message-ID: <30fac4c6-be23-aab5-503f-77a750dd8044@yandex.ru> Date: Tue, 1 Dec 2020 03:50:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <835z5mlvb2.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 44905-done Cc: 44905-done@debbugs.gnu.org, mardani29@yahoo.es X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Version: 27.2 On 30.11.2020 17:26, Eli Zaretskii wrote: >> Cc: 44905@debbugs.gnu.org, Eli Zaretskii >> From: Dmitry Gutov >> Date: Mon, 30 Nov 2020 03:00:17 +0200 >> >>>> diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el >>>> index 94a2bbf1f3..4caafc8df6 100644 >>>> --- a/lisp/dired-aux.el >>>> +++ b/lisp/dired-aux.el >>>> @@ -3140,7 +3140,10 @@ dired-do-find-regexp-and-replace >>>> (query-replace-read-args >>>> "Query replace regexp in marked files" t t))) >>>> (list (nth 0 common) (nth 1 common)))) >>>> - (with-current-buffer (dired-do-find-regexp from) >>>> + (defvar xref-show-xrefs-function) >>>> + (with-current-buffer >>>> + (let ((xref-show-xrefs-function 'xref--show-xref-buffer)) >>>> + (dired-do-find-regexp from)) >>>> (xref-query-replace-in-results from to))) >>>> >>>> (defun dired-nondirectory-p (file) >>> >>> LGTM, thanks. >> >> Eli, is this OK for Emacs 27.2? > > Yes, thanks. > >> Here's also a slightly more future-proofed version that avoids >> referencing the function we might want to rename/change later: > > That, too. Thanks. Pushed to the release branch (will get merged to master in due time), commit 749e4b7e0b. From unknown Sat Jun 21 10:18:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Dec 2020 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator