all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18017: 24.4.50; Isearch case sensitivity broken/confusing
@ 2014-07-14 16:02 Drew Adams
  2014-07-14 21:17 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-07-14 16:02 UTC (permalink / raw)
  To: 18017

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





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

end of thread, other threads:[~2021-07-14 23:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-07-14  9:14   ` Lars Ingebrigtsen
2021-07-14 23:39     ` Juri Linkov

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.