[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Add project.el command to replace symbol at point throughout
From: |
Juri Linkov |
Subject: |
Re: [Patch] Add project.el command to replace symbol at point throughout project |
Date: |
Wed, 02 Feb 2022 21:51:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> 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).