Subject: Fwd: GNU bugs information: logs for bug#10118

From: Dani Moncayo <[email-masked]>
Date: Sat, 3 Aug 2013 18:36:33 +0200

> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> To: Juri Linkov <juri <at> jurta.org>
> Cc: 10118 <at> debbugs.gnu.org
> Subject: Re: bug#10118: C-w folds case too eagerly
> Date: Thu, 01 Dec 2011 14:45:17 -0500
>
> > > % emacs -Q
> > > TOTORO TOTO M-b
> > > C-r C-w RO
> > >
> > > this fails to find "TOTORO" because we end up looking for "totoRO"
> > > (without ignoring case) rather than "TOTORO".
>
> > Sorry, I don't know how to solve this puzzle.  The value `not-yanks'
> > of `search-upper-case' explicitly tells Isearch to downcase the word
> > pulled from the buffer.
>
> I know, but I think it's wrong.  I think that rather than downcase it,
> it should only cause the case to stay ignored.  The behavior I'd expect
> is something like:
>
> - C-r C-w leads to "I-search: toto", which hides the uppercase nature of
>   the yanked string, but doesn't actually throw it away.
> - then typing "RO" leads to "I-search: TOTORO", where TOTO's uppercase
>   nature is made explicit.

I've been thinking a bit about this, and I'd like to propose this
solution:

1. Never downcase the text yanked into the search ring, because we
must remember the original text supplied by the user.  This implies
that the variable `search-upper-case' will not care about the value
`not-yanks' anymore.

2. When `search-upper-case' is non-nil, upper case chars will make the
search case-sensitive, but only when typed right from the keyboard,
i.e., not when grabbing text from another place (kill ring, buffer or
whatever).  This way, the search will be case-insensitive by default
(quite reasonable), and will only switch to case-sensitive under
explicit request from the user (either by _typing_ an upper case char
or "M-c").

WDYT?

-- 
Dani Moncayo