all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 18017@debbugs.gnu.org
Subject: bug#18017: 24.4.50; Isearch case sensitivity broken/confusing
Date: Mon, 14 Jul 2014 09:02:56 -0700 (PDT)	[thread overview]
Message-ID: <fec26778-9951-4a11-a3ba-4605ae7d3ad0@default> (raw)

emacs -Q

Type this in buffer *scratch*:

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).

IOW, what seems to happen is this:

When you repeat the last search string, that text is not interpreted
anew, per the current value of `case-fold-search'.  Instead, search is
put back into the state it was in for the last search
you did (from scratch), ignoring the current value of `case-fold-search'. 

If instead of C-s C-s you retype (or yank) the same text then it is
handled as you would expect (i.e., per `case-fold-search').

Similarly, if you used `M-c' during the previous search to turn off case
sensitivity, then when you start a new search by repeating the search
string, that new search acts case-insensitively, regardless of the value
of `case-fold-search'.  Again, search seems to be put back into the state
it had for the previous search session, ignoring `case-fold-search'.

Similarly, if you do C-s M-c C-s then the M-c is ignored and search
takes on the case sensitivity or lack thereof that you had for the
previous search.  Search ignores M-c if you repeat the previous search
string using C-s.

Is this considered a feature?  Or should it be considered a bug?

It seems quit confusing, at least.  Is there some advantage to having
Isearch behave this way?

Note that the doc (emacs, node Search Case) says:

  The effect [of M-c] does not extend beyond the current incremental
  search to the next one

which contradicts this behavior (starting with nil `case-fold-search'):


C-s add M-c C-s

C-s C-s

The M-c of the first search does affect the case-sensitivity of the
second search, because of the phenomenon described above: C-s C-s
restores not only the search string from the previous search but also
the case-sensitivity of the search state.


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-28 on ODIEONE
Bzr revision: 117431 rgm@gnu.org-20140628015517-eku6hj8mpgcvfnso
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





             reply	other threads:[~2014-07-14 16:02 UTC|newest]

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

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

  git send-email \
    --in-reply-to=fec26778-9951-4a11-a3ba-4605ae7d3ad0@default \
    --to=drew.adams@oracle.com \
    --cc=18017@debbugs.gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.