unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@jurta.org>
Cc: 18017@debbugs.gnu.org
Subject: bug#18017: 24.4.50; Isearch case sensitivity broken/confusing
Date: Mon, 14 Jul 2014 15:39:01 -0700 (PDT)	[thread overview]
Message-ID: <680b2b35-4afb-4c19-a04c-b6807cf0a73d@default> (raw)
In-Reply-To: <87wqbftzb9.fsf@mail.jurta.org>

> > Add
> > add
> > ADD
> > M-x set-variable case-fold-search nil
> > C-s add C-s
> > C-s M-c C-s
> >
> > The M-c says that search is now case-insensitive, but the second and
> > subsequent C-s's do not find occurrences Add and ADD.
> >
> > C-s add C-s
> > That finds all three (case-insensitive).
> 
> Did you mean `C-s M-c add C-s' in the last key sequence
> (that finds all case-insensitive)?  You have to use M-c to toggle
> case-sensitivity for case-fold-search that you set to nil.

I meant that after you use C-s add M-c C-s and then you start again
with C-s C-s, the case insensitivity of the first search continues for
the second (independent) search.  IOW, M-c *does* extend beyond the
current search, if you use C-s C-s to reuse the last search string.

From what I see, reusing the last search string really means, not
just reusing its text, but reusing the last search state, including
(at least) whether searching is case-sensitive.

> And `C-s C-s' naturally restores case-sensitivity of the
> previous search string, but it's possible to configure this
> using `isearch-keep-mode-variables' from bug#11378.

Dunno about "naturally".  I'm really not sure what the best behavior
to shoot for is.  It does seem to me that the current behavior can be
confusing.  On the other hand, perhaps someone finds it handy to not
have to repeat M-c to get back the same sensitivity as for the last search.

Perhaps you and some others could play with this and make a suggestion
wrt the best behavior.  And perhaps we should define whatever is
decided on as the _default_ behavior, and add a user option that lets
users choose.  I'd welcome your ideas about this.  Currently I think
the behavior is confusing and could probably be improved.

For non-nil `case-fold-search' I think the current behavior is OK.
But I suspect that less thought went into the behavior wrt
case-sensitivity for the nil case.

Note that things are additionally complicated for users because of
the (handy) special handling based on the case of the chars you type
(i.e., the special handling described in (emacs) `Special Isearch').

Emacs gives users lots of possibilities here, but _discovery_ of how
things work is not straightforward.  It is all too easy to stumble
into behavior that one doesn't understand, especially for a newbie.





  reply	other threads:[~2014-07-14 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 16:02 bug#18017: 24.4.50; Isearch case sensitivity broken/confusing Drew Adams
2014-07-14 21:17 ` Juri Linkov
2014-07-14 22:39   ` Drew Adams [this message]
2021-07-14  9:14   ` Lars Ingebrigtsen
2021-07-14 23:39     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=680b2b35-4afb-4c19-a04c-b6807cf0a73d@default \
    --to=drew.adams@oracle.com \
    --cc=18017@debbugs.gnu.org \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).