GNU bug report logs - #26580
25.1; inappropriate case folding while isearch-forward-regexp

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Thu, 20 Apr 2017 17:57:02 UTC

Severity: normal

Found in version 25.1

To reply to this bug, email your comments to 26580 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Thu, 20 Apr 2017 17:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ynyaaa <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Apr 2017 17:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ynyaaa <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 02:55:43 +0900
'M-C-s \A' matches both lower letter a and upper letter A.
'M-C-s [\A]' matches \ and lower letter a and upper letter A.
'M-C-s \cCa' matches 一a, but does not match 一A.




In GNU Emacs 25.1.1 (i686-w64-mingw32)
 of 2016-09-18 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.0.6002
Configured using:
 'configure --host=i686-w64-mingw32 --without-dbus
 --without-compress-install CFLAGS=-static'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
misearch multi-isearch help-mode easymenu cl-loaddefs pcase cl-lib
time-date mule-util japan-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table
w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 8 92081 7564)
 (symbols 32 19681 0)
 (miscs 32 54 161)
 (strings 16 15921 3924)
 (string-bytes 1 430154)
 (vectors 8 13169)
 (vector-slots 4 519590 4478)
 (floats 8 165 28)
 (intervals 28 217 13)
 (buffers 520 19))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 03:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: ynyaaa <at> gmail.com
Cc: 26580 <at> debbugs.gnu.org, tino.calancha <at> gmail.com,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 12:40:50 +0900
ynyaaa <at> gmail.com writes:

> 'M-C-s \A' matches both lower letter a and upper letter A.
> 'M-C-s [\A]' matches \ and lower letter a and upper letter A.
> 'M-C-s \cCa' matches 一a, but does not match 一A.

Thanks for the report.  I guess this is a feature.
A capital letter triggers a case sensitive search.  In your last example,
upper letter C turned on the case sensitive search.  It might be argue
if that should happen in this case.  I think the current way is handy.
Maybe we should mention about this in the `isearch-forward' docstring.

In the former examples the slash somehow prevents this to happen.  For instance,
if you don't escape 'A' in the first example, then the search will match just 'A'.

Try the following:
'M-C-s A' matches upper letter A.
'M-C-s [a\]' matches \ and lower letter a and upper letter A.
'M-C-s [A\]' matches \ and upper letter A.

'M-C-s \cca' matches 一a, and 一A.
'M-C-s \ccA' just matches 一A.
'M-C-s \cCA' just matches 一A.
'M-C-s \cCa' just matches 一a.

Of couse, you always can toggle the case sensitivity during
those searches with M-c:
'M-C-s A M-c' matches both lower letter a and upper letter A.
'M-C-s \cCa M-c' matches 一a, and 一A.


Regards,
Tino




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 09:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, 26580 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 11:22:42 +0200
On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> A capital letter triggers a case sensitive search.  In your last example,
> upper letter C turned on the case sensitive search.  It might be argue
> if that should happen in this case.  I think the current way is handy.

IMHO that is a bug.  Just like \W doesn't trigger it, \cC should not do
it either.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 09:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: ynyaaa <at> gmail.com, Juri Linkov <juri <at> linkov.net>, 26580 <at> debbugs.gnu.org,
 Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#26580: 25.1; inappropriate case folding while
 isearch-forward-regexp
Date: Fri, 21 Apr 2017 18:50:39 +0900 (JST)

On Fri, 21 Apr 2017, Andreas Schwab wrote:

> On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>
>> A capital letter triggers a case sensitive search.  In your last example,
>> upper letter C turned on the case sensitive search.  It might be argue
>> if that should happen in this case.  I think the current way is handy.
>
> IMHO that is a bug.  Just like \W doesn't trigger it, \cC should not do
> it either.
Yeah, it looks strange.  I would say, if \W doesn't trigger, then c\C 
would not either (\cC might do, because the upper case is not escaped).

I'm also wondering if \W should do what is doing.  Is it documented 
somewhere that the slash does not trigger case sensitivity?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 12:05:02 GMT) Full text and rfc822 format available.

Message #17 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, 26580 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 14:04:33 +0200
On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> I'm also wondering if \W should do what is doing.  Is it documented
> somewhere that the slash does not trigger case sensitivity?

\W has nothing to do with case, it's just a non-word character.  Same
for \cC.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 12:17:01 GMT) Full text and rfc822 format available.

Message #20 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: ynyaaa <at> gmail.com, Juri Linkov <juri <at> linkov.net>, 26580 <at> debbugs.gnu.org,
 Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#26580: 25.1; inappropriate case folding while
 isearch-forward-regexp
Date: Fri, 21 Apr 2017 21:16:27 +0900 (JST)

On Fri, 21 Apr 2017, Andreas Schwab wrote:

> On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>
>> I'm also wondering if \W should do what is doing.  Is it documented
>> somewhere that the slash does not trigger case sensitivity?
>
> \W has nothing to do with case, it's just a non-word character.  Same
> for \cC.
OK, i just picked up \W from you.  Let's changed to \T:
emacs -Q:
C-M-s \T ; matches lower and upper T
C-M-s T ; just matches upper T

I don't see in the manual this effect on an escaped upper letter.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 13:26:02 GMT) Full text and rfc822 format available.

Message #23 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, schwab <at> linux-m68k.org, 26580 <at> debbugs.gnu.org,
 juri <at> linkov.net
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 16:26:14 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Fri, 21 Apr 2017 21:16:27 +0900 (JST)
> Cc: ynyaaa <at> gmail.com, Tino Calancha <tino.calancha <at> gmail.com>,
> 	26580 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
> 
> C-M-s \T ; matches lower and upper T
> C-M-s T ; just matches upper T
> 
> I don't see in the manual this effect on an escaped upper letter.

  (defcustom search-upper-case 'not-yanks
    "If non-nil, upper case chars disable case fold searching.
  That is, upper and lower case chars must match exactly.
  This applies no matter where the chars come from, but does not
  apply to chars in regexps that are prefixed with `\\'.
  If this value is `not-yanks', text yanked into the search string
  in Isearch mode is always downcased."
    :type '(choice (const :tag "off" nil)
		   (const not-yanks)
		   (other :tag "on" t)))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 13:32:02 GMT) Full text and rfc822 format available.

Message #26 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, 26580 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 15:31:04 +0200
On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> OK, i just picked up \W from you.  Let's changed to \T:

Since \T has no meaning nobody would use it anyway.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 15:00:02 GMT) Full text and rfc822 format available.

Message #29 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ynyaaa <at> gmail.com, juri <at> linkov.net, schwab <at> linux-m68k.org,
 26580 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#26580: 25.1; inappropriate case folding while
 isearch-forward-regexp
Date: Fri, 21 Apr 2017 23:59:23 +0900 (JST)

On Fri, 21 Apr 2017, Eli Zaretskii wrote:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Fri, 21 Apr 2017 21:16:27 +0900 (JST)
>> Cc: ynyaaa <at> gmail.com, Tino Calancha <tino.calancha <at> gmail.com>,
>> 	26580 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
>>
>> C-M-s \T ; matches lower and upper T
>> C-M-s T ; just matches upper T
>>
>> I don't see in the manual this effect on an escaped upper letter.
>
>  (defcustom search-upper-case 'not-yanks
>    "If non-nil, upper case chars disable case fold searching.
>  That is, upper and lower case chars must match exactly.
>  This applies no matter where the chars come from, but does not
>  apply to chars in regexps that are prefixed with `\\'.
>  If this value is `not-yanks', text yanked into the search string
>  in Isearch mode is always downcased."
>    :type '(choice (const :tag "off" nil)
> 		   (const not-yanks)
> 		   (other :tag "on" t)))
>
Great, thanks!
Now it's clear why \A matches both 'a' and 'A'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 15:19:01 GMT) Full text and rfc822 format available.

Message #32 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: ynyaaa <at> gmail.com, Juri Linkov <juri <at> linkov.net>, eliz <at> gnu.org,
 26580 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#26580: 25.1; inappropriate case folding while
 isearch-forward-regexp
Date: Sat, 22 Apr 2017 00:17:54 +0900 (JST)

On Fri, 21 Apr 2017, Andreas Schwab wrote:

> On Apr 21 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>
>> OK, i just picked up \W from you.  Let's changed to \T:
>
> Since \T has no meaning nobody would use it anyway.
Someone might want to use it to disable the case sensitivity search.

After Eli e-mail, i agree with the OP and you that would be more
consistent if '\cCa' disables case sensitive searches as '\cc\A' does.

In case that is difficult to implement, we might want to document
that the  slash trick just works for single characters.  Then, the user
would just use '\cca' which loks even simpler.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Fri, 21 Apr 2017 17:43:01 GMT) Full text and rfc822 format available.

Message #35 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, eliz <at> gnu.org, 26580 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Fri, 21 Apr 2017 19:42:31 +0200
On Apr 22 2017, Tino Calancha <tino.calancha <at> gmail.com> wrote:

> would just use '\cca' which loks even simpler.

\cc means something quite different than \cC.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26580; Package emacs. (Tue, 25 Apr 2017 20:59:02 GMT) Full text and rfc822 format available.

Message #38 received at 26580 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: ynyaaa <at> gmail.com, Andreas Schwab <schwab <at> linux-m68k.org>,
 26580 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#26580: 25.1;
 inappropriate case folding while isearch-forward-regexp
Date: Tue, 25 Apr 2017 23:57:06 +0300
> In case that is difficult to implement, we might want to document
> that the  slash trick just works for single characters.  Then, the user
> would just use '\cca' which loks even simpler.

The implementation that takes care of ‘\’ is in ‘isearch-no-upper-case-p’.
I guess we need a special casing for ‘\cC’ here as well.




This bug report was last modified 8 years and 60 days ago.

Previous Next


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