unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10118: Fwd: GNU bugs information: logs for bug#10118
       [not found] ` <handler.s.R.13755413702453.info.0@debbugs.gnu.org>
@ 2013-08-03 16:36   ` Dani Moncayo
  2024-03-05  7:06     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Dani Moncayo @ 2013-08-03 16:36 UTC (permalink / raw)
  To: 10118

> 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10118: Fwd: GNU bugs information: logs for bug#10118
  2013-08-03 16:36   ` bug#10118: Fwd: GNU bugs information: logs for bug#10118 Dani Moncayo
@ 2024-03-05  7:06     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-03-05 16:32       ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-03-05  7:06 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: Juri Linkov, 10118

> 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?

Sounds good to me!


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10118: Fwd: GNU bugs information: logs for bug#10118
  2024-03-05  7:06     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-03-05 16:32       ` Juri Linkov
  2024-03-05 16:51         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2024-03-05 16:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10118, Dani Moncayo

>> 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?
>
> Sounds good to me!

Then UI won't be WYSIWYG.  There will be upper-case characters
in the isearch message, but the search will ignore them.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#10118: Fwd: GNU bugs information: logs for bug#10118
  2024-03-05 16:32       ` Juri Linkov
@ 2024-03-05 16:51         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-03-05 16:51 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 10118, Dani Moncayo

>>> 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?
>>
>> Sounds good to me!
>
> Then UI won't be WYSIWYG.  There will be upper-case characters
> in the isearch message, but the search will ignore them.

What I proposed wasn't WYSIWYG either, because the string was displayed
as lower-case until we switch off case-folding at which point it
"magically" reveals its latent capitalization.

I can think of some ways to try and visually indicate what's going on
(e.g. using colors on the upper-case-but-case-folded chars, or an
additional flag in the prompt).  Not sure what's the better option.


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-05 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAH8Pv0hkLk3zFSwPkMtqT_nDFN7t3S9udbrdqYKSvSVD+y+UqQ@mail.gmail.com>
     [not found] ` <handler.s.R.13755413702453.info.0@debbugs.gnu.org>
2013-08-03 16:36   ` bug#10118: Fwd: GNU bugs information: logs for bug#10118 Dani Moncayo
2024-03-05  7:06     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-05 16:32       ` Juri Linkov
2024-03-05 16:51         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).