|
From: | Dmitry Gutov |
Subject: | Re: [Patch] Add project.el command to replace symbol at point throughout project |
Date: | Mon, 17 Jan 2022 03:41:38 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |