GNU bug report logs - #18017
24.4.50; Isearch case sensitivity broken/confusing

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Mon, 14 Jul 2014 16:04:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 18017 <at> debbugs.gnu.org:


Received: (at 18017) by debbugs.gnu.org; 14 Jul 2014 22:39:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 14 18:39:21 2014
Received: from localhost ([127.0.0.1]:55069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1X6otz-000373-Em
	for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 18:39:20 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:51367)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1X6otq-00036e-Ay
 for 18017 <at> debbugs.gnu.org; Mon, 14 Jul 2014 18:39:11 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
 by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 s6EMd2XF017840
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Mon, 14 Jul 2014 22:39:03 GMT
Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231])
 by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6EMd1HJ007340
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Mon, 14 Jul 2014 22:39:02 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6EMd1GT007332;
 Mon, 14 Jul 2014 22:39:01 GMT
MIME-Version: 1.0
Message-ID: <680b2b35-4afb-4c19-a04c-b6807cf0a73d@default>
Date: Mon, 14 Jul 2014 15:39:01 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#18017: 24.4.50; Isearch case sensitivity broken/confusing
References: <fec26778-9951-4a11-a3ba-4605ae7d3ad0@default>
 <87wqbftzb9.fsf@HIDDEN>
In-Reply-To: <87wqbftzb9.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8  (707110) [OL
 12.0.6691.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 18017
Cc: 18017 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18017; Package emacs. Full text available.

Message received at 18017 <at> debbugs.gnu.org:


Received: (at 18017) by debbugs.gnu.org; 14 Jul 2014 21:18:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 14 17:18:54 2014
Received: from localhost ([127.0.0.1]:55038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1X6neA-000153-4l
	for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 17:18:54 -0400
Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:34763
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1X6ne7-00014u-EJ
 for 18017 <at> debbugs.gnu.org; Mon, 14 Jul 2014 17:18:52 -0400
Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id B32C6348328ECB;
 Mon, 14 Jul 2014 14:18:49 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#18017: 24.4.50; Isearch case sensitivity broken/confusing
Organization: JURTA
References: <fec26778-9951-4a11-a3ba-4605ae7d3ad0@default>
Date: Tue, 15 Jul 2014 00:17:45 +0300
In-Reply-To: <fec26778-9951-4a11-a3ba-4605ae7d3ad0@default> (Drew Adams's
 message of "Mon, 14 Jul 2014 09:02:56 -0700 (PDT)")
Message-ID: <87wqbftzb9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > 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). [...] 
 Content analysis details:   (2.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.7 RCVD_IN_XBL            RBL: Received via a relay in Spamhaus XBL
 [69.163.216.107 listed in zen.spamhaus.org]
 1.6 RCVD_IN_BRBL_LASTEXT   RBL: RCVD_IN_BRBL_LASTEXT
 [69.163.216.107 listed in bb.barracudacentral.org]
X-Debbugs-Envelope-To: 18017
Cc: 18017 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > 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). [...] 
 
 Content analysis details:   (2.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.7 RCVD_IN_XBL            RBL: Received via a relay in Spamhaus XBL
                             [69.163.216.107 listed in zen.spamhaus.org]
  1.6 RCVD_IN_BRBL_LASTEXT   RBL: RCVD_IN_BRBL_LASTEXT
                             [69.163.216.107 listed in bb.barracudacentral.org]

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

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#18017; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jul 2014 16:03:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 14 12:03:46 2014
Received: from localhost ([127.0.0.1]:54841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1X6ij7-0000Ac-Kj
	for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 12:03:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37378)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1X6ij1-0000AJ-NW
 for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 12:03:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1X6iim-00021j-5H
 for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 12:03:30 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:43257)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1X6iim-00021e-2P
 for submit <at> debbugs.gnu.org; Mon, 14 Jul 2014 12:03:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38907)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1X6iic-0002kS-OU
 for bug-gnu-emacs@HIDDEN; Mon, 14 Jul 2014 12:03:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1X6iiS-0001sI-9u
 for bug-gnu-emacs@HIDDEN; Mon, 14 Jul 2014 12:03:10 -0400
Received: from userp1040.oracle.com ([156.151.31.81]:28449)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1X6iiS-0001s4-4E
 for bug-gnu-emacs@HIDDEN; Mon, 14 Jul 2014 12:03:00 -0400
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
 by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 s6EG2vjF015121
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Mon, 14 Jul 2014 16:02:58 GMT
Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85])
 by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6EG2vsV023517
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL)
 for <bug-gnu-emacs@HIDDEN>; Mon, 14 Jul 2014 16:02:57 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6EG2vsa023499
 for <bug-gnu-emacs@HIDDEN>; Mon, 14 Jul 2014 16:02:57 GMT
MIME-Version: 1.0
Message-ID: <fec26778-9951-4a11-a3ba-4605ae7d3ad0@default>
Date: Mon, 14 Jul 2014 09:02:56 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.4.50; Isearch case sensitivity broken/confusing
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8  (707110) [OL
 12.0.6691.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

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'.=
=20

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@HIDDEN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=3D/c/Devel/emacs/snapshot/trunk
 --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3'
 LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1
 -Ic:/Devel/emacs/include''




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#18017; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.