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.devel Subject: Re: [Patch] Add project.el command to replace symbol at point throughout project Date: Wed, 2 Feb 2022 23:09:56 +0200 Message-ID: <966dd6d0-0e3f-f1e4-36e7-7334ddc95e2f@yandex.ru> References: <83zgo2770l.fsf@gnu.org> <83zgo15dhp.fsf@gnu.org> <83czkw3uvl.fsf@gnu.org> <170a1c89-7767-0930-f726-f7b2551876b2@yandex.ru> <44f72f97-d1d8-0b4c-73a0-7f077fb1ef26@yandex.ru> <0617E8BF-CC43-4D82-8648-064252F644FD@gmail.com> <86pmos3no7.fsf@mail.linkov.net> <86czkr36ll.fsf@mail.linkov.net> <921c0b69-7bac-b78a-54d8-987165331661@yandex.ru> <0b8d87f8-e6db-9902-bd89-d81864d626d6@yandex.ru> <861r16235x.fsf@mail.linkov.net> <829a1d78-c07e-4bb8-e3bd-07263271fc30@yandex.ru> <86sft3kbja.fsf@mail.linkov.net> <35a7ae0c-7d9f-4feb-be3b-a93ad4f7a795@yandex.ru> <86a6famjr8.fsf@mail.linkov.net> <9915e49c-81c9-5a8e-2aa9-a223740231dd@yandex.ru> <86mtj9xd1g.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="13775"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Cc: Jon Eskin , Eli Zaretskii , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 02 22:13:25 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nFMwO-0003Om-Qj for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Feb 2022 22:13:24 +0100 Original-Received: from localhost ([::1]:37204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFMwN-0000UJ-37 for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Feb 2022 16:13:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFMtB-0006Ub-CE for emacs-devel@gnu.org; Wed, 02 Feb 2022 16:10:07 -0500 Original-Received: from [2a00:1450:4864:20::433] (port=36401 helo=mail-wr1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFMt8-0001cD-5B; Wed, 02 Feb 2022 16:10:04 -0500 Original-Received: by mail-wr1-x433.google.com with SMTP id u15so951429wrt.3; Wed, 02 Feb 2022 13:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=JwomIZlfmg5L52CxEYjtI30tt7zLD18TVdGIgZawtX8=; b=Y0hcblPpTnYiIpLdMTsUtOFw7XmuneuoD66hoqnAeUdO4gD8l9MjHzGMtK7ufKLUta 2lk80mnLhj9QkEon92svpthstLEzxPnm6b61sIBx0Qq+0h+wWDCYwJ/Fj0qbCw67Noh6 pzUnmcf/0SpgAJifnuFl82okqY2mVB6ScCiQOAY7ZX3SgHeinlG95igj8982zlTMy6UX WFB/5CjxNKaqhwYMbOxWuuiRKbX3ltwPxDthUxYNCg++PczjiAlhpEYBraP4gR9461vM WfOmSBnbc/JJ6fSTUHmH9Vqd6NySY1uAMzV43ZXExthNvCwZa8gMRoMcxTCCVDSciguV U17w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=JwomIZlfmg5L52CxEYjtI30tt7zLD18TVdGIgZawtX8=; b=h28ztynqsPhuD+DUqhSZOofUysH4aZJSsp67to2KZuOdfNgJoN4Y/owNh3zz+nS+Qy RQ8k2eYXZEITIF61G5QBgeCTJeNwIkUpItjK/e9w/uWPHkcietliWck7uqEvbQZFeLrb 9PdBrKedtvHawFGGGs/9faiuqLc/JqTpkZmgggZa+pkJvsiZF0CYHd7w+eMSkMp8PaqQ 4/HxhltDlFu98IzVInC7cZTUl/TnHMs4Rh4LujCx7cSg7QC4Oy0dNGMvLDDsTiQJ1XEt nndiFkGyno8HakZhaO7FMJojXCtGle4poeYTyLHhjWbMvUsJ0ButCyPvw1bL3vNDRWeq HsZA== X-Gm-Message-State: AOAM533mC0B0wtxlto6Vx7Q7xpNS0hmWS0m9HXUEWj8SsDB636T1EmJH LqF1UKAsU9ZT3Mvw48Mr6zE= X-Google-Smtp-Source: ABdhPJxZpLF22qxfPQil6Sqoz0TLXm4a/bS4CZ1L1NelBo3pXdcoiqB0Si/Rkdy/j8cqN9YAh/8C0Q== X-Received: by 2002:a5d:6090:: with SMTP id w16mr26488657wrt.476.1643836199294; Wed, 02 Feb 2022 13:09:59 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id m4sm5507990wmc.1.2022.02.02.13.09.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Feb 2022 13:09:58 -0800 (PST) Content-Language: en-US In-Reply-To: <86mtj9xd1g.fsf@mail.linkov.net> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::433 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=raaahh@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285808 Archived-At: On 02.02.2022 21:51, Juri Linkov wrote: >> On 01.02.2022 22:09, Juri Linkov wrote: >>>>> After thinking more about this, I can't find a possible use for >>>>> read-string-defaults-function, because every call of read-string >>>>> provides own default value. Also using read-regexp-defaults-function >>>>> in query-replace-read-from is not the right thing either - when >>>>> the users already customized it for e.g. occur, it would be too >>>>> unexpected when it will use a tag at point instead of from->to >>>>> pairs in query-replace. >>>>> Since query-replace is a very special command, the most uncontroversial >>>>> thing to do for a conservative approach would be to add two specific >>>>> variables (that later could be turned into options when needed): >>>> Sounds reasonable, thanks. >>>> >>>> If you're satisfied with the change, please go ahead and install the >>>> patches. >>> So now patches are installed in master. >> >> Thanks! >> >> Could you try testing the new behavior in xref-find-references-and-replace? > > Sorry, I tested everything in the previous version of the patch, > but then forgot that read-string is different from read-from-minibuffer. > >> I'm seeing this: >> >> - If there are no entries in history, I see the appropriate text in the >> first prompt (featuring the tag near point), but when I press RET, the >> next prompt which should mention the thing to replace, just has two >> spaces in a row. And indeed, the behavior is as if it's read an empty >> string. >> >> - If there are history entries, and I press RET (to use the default FROM), >> it proceeds to do a search right away instead of prompting me for TO. And >> it uses the from-to pair from history instead of the current input. > > Now everything is fixed (at least in all tested cases). Looking good now. Thanks!