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: Mon, 17 Jan 2022 03:41:38 +0200 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32352"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 Cc: Eli Zaretskii , emacs-devel@gnu.org To: Jon Eskin , Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 17 02:44:33 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 1n9H4S-0008J3-PT for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jan 2022 02:44:32 +0100 Original-Received: from localhost ([::1]:39364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9H4R-00087M-Kg for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Jan 2022 20:44:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9H3D-0006lR-So for emacs-devel@gnu.org; Sun, 16 Jan 2022 20:43:15 -0500 Original-Received: from [2a00:1450:4864:20::331] (port=39731 helo=mail-wm1-x331.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9H3B-0002JQ-Sg; Sun, 16 Jan 2022 20:43:15 -0500 Original-Received: by mail-wm1-x331.google.com with SMTP id d18-20020a05600c251200b0034974323cfaso20734850wma.4; Sun, 16 Jan 2022 17:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JxQ09OmFwj3qAWGOUYH3/OwLsOEF0gX9SzINqAI5vcs=; b=SdvXMdP4r08jxGt4XbzTVzuiS8eLyls4CVLQB3toY7Wwsd1R8r+Z22pvOclcRpXJVQ z7/0gq9QXsVv9u2tIPN009lGM1tUaQ8lUj/XTIOcXIXk6crpn2TN9smXqD9zPlO+1i5I jxwqB7bGJLmX7F7tvZVSSqWi/k9rO7gYfqGUrWWXxrWJ66LQeOecCGs1xXO/G2+RVopj M/2fuWNuVt/3Lu6AN+Kljy0t3tEBlrnFTX6h3SmVRv0rBEClwv7Fdkgxr8XcLjnpojVk H8zd1pyuOidTxOf5rXKDNpFHe/BJ3H1NyVWm28aNU2M0io9hYBBP31Tz6WYrDp9TIAmo 1f7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JxQ09OmFwj3qAWGOUYH3/OwLsOEF0gX9SzINqAI5vcs=; b=aVNIft5nKNdFuMoqS8JDUzWk6KrQMnEW+JTTijeAIPEJjghrrT2BNI0jDiBlcABLO9 xMxvORd92vAAT03deexl7iHiY53PuB8/XVHmKhBxp+F8sTFR3mG0fqnGm9aNroqevngH 3sQJoki+MkB4g4N+Ol15Cw7Tw6ZKnDIatbbpIqkS763ObUFDeJ7F7v09TrkfVdXwS9dg 0wRU/z9EPBa6KGmkUDI+rcfk7fKWm70okF5OC+W+Cb1jlp32PbHK9/K/D5DjlW5WaOZ1 6wnlj61TtWD7BiFUZOarP75Ifr1bGnMvGkIprd2GGBEhF1CVniO5iA3nb23UXNY3fXQN mSPQ== X-Gm-Message-State: AOAM531402FCMlVdYX2bAhZQyHctzSuFLrrXj+SuyjEv//saTe5+j9ud ymlWfW/DIwfB5jqQuk3AaNu4lAMCD/4= X-Google-Smtp-Source: ABdhPJx93Jd3d7PGB8uTIpgkFS3OS7u+aQGtepszMWvBupkx/bmtqotZG1AU0FZub8ZfcJfNrSva0Q== X-Received: by 2002:adf:e78e:: with SMTP id n14mr17580020wrm.631.1642383792445; Sun, 16 Jan 2022 17:43:12 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f17sm2418449wmq.28.2022.01.16.17.43.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Jan 2022 17:43:12 -0800 (PST) In-Reply-To: <0617E8BF-CC43-4D82-8648-064252F644FD@gmail.com> Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::331 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=raaahh@gmail.com; helo=mail-wm1-x331.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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 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:284858 Archived-At: Jon, Thanks for taking a stab at this, by the way. To clarify why your patch was not enough: On 15.01.2022 11:55, Jon Eskin wrote: > When I first let-bound `read-regexp-defaults-function` around the call to `query-replace-read-args`, it didn't work- it looks like `read-regexp` needs to be passed a symbol for its `DEFAULTS` parameter or it ignores `read-regexp-default-function`. I passed in the symbol at point to `DEFAULTS` which works- if I understand correctly the value of any I pass in doesn't end up making a difference as long as it's a symbol. I wasn't sure what the reason was for that behavior, but I didn't want to mess with stuff I didn't understand. This change (having query-replace-read-from use symbol-at-point) affects all its callers, whereas the idea was to delegate the default detection logic to a piece of code determined by the caller. That's why the next step was to determine why binding 'read-regexp-defaults-function' didn't have the desired effect, rather than calling 'symbol-at-point' directly.