[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: isearch-yank-until-char

From: Karl Fogel
Subject: Re: PATCH: isearch-yank-until-char
Date: Mon, 26 Aug 2019 17:21:19 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On 26 Aug 2019, Drew Adams wrote:
>Can you give an example where you think case
>insensitivity would be inappropriate for this, but
>it would be appropriate for the search with the
>updated search string?
>(Not that I'm arguing for case-insensitivity here.
>I just wonder why case-sensitivity is always TRT.)

TL;DR: by the end of this post, I'm going to come around to your way of 
thinking.  So you can just skip ahead if you want :-).  But below I'll lay it 
all out.

It might be easier if I describe the situations in which I find this feature 
useful at all.  This feature seems to be most useful in keyboard macros.  
Indeed, I'm not sure I've *ever* used it outside of a keyboard macro.  Almost 
always, it's in a programming language buffer (or markup language, or some 
other kind of system in which syntactic signifiers -- some of which are one 
character long -- are thick on the ground).  In almost all of those cases, the 
target char is not a letter anyway: it's some other kind of symbol that marks a 
boundary that's useful to the macro.  In the few cases where it's been a 
letter, that letter's case is either not going to vary on other iterations of 
the macro or is not going to matter (both of which are knowable because of the 
syntax environment).

However, the more I think about it, the less convinced I am by my own argument. 
 In ~95% of the uses, one isn't matching a letter anyway, but even more 
importantly, one is almost always in a keyboard macro.  So if case-sensitivity 
matters either way, one can just set `case-fold-search' manually before doing 
the macro.  Meanwhile, hard-setting `case-fold-search' violates the Principle 
Of Least Surprise.

So, this latest patch has that removed.  Thank you for pushing back on this and 
making me think more carefully.

Best regards,

Attachment: isearch-yank-until-char-20190826-3.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]