GNU bug report logs -
#21277
char-fold isearch: how to disable
Previous Next
Reported by: rms <at> gnu.org
Date: Mon, 17 Aug 2015 05:05:02 UTC
Severity: minor
Found in version 25.0.50
To reply to this bug, email your comments to 21277 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Mon, 17 Aug 2015 05:05:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
rms <at> gnu.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 17 Aug 2015 05:05:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
1. Char-fold isearch is a screw. I wanted to search for lines
starting with a space, so I searched for C-j SPC, but it did something
useless. It found every blank line!
2. So I decided to try to disable it, but the doc string of
isearch says nothing about how to turn that off. It should say how.
3. I tried using C-h v to find a variable, but although there is
isearch-case-fold-search, there is no isearch-char-fold-search.
For parallelism's sake, isearch-char-fold-search should exist.
4. I searched in etc/NEWS for 'char fold' and 'char-fold'.
Neither appears. Both of them SHOULD appear, for the sake
of people who search for them.
5. I did find 'isearch', and that entry described the new inconvenient
feature. However the entry there did not say how to disable this
feature. It should say how.
In GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.23)
of 2015-08-12 on freetop
Repository revision: 79a169684dfad2c0bbb9fdbae539c1f30d9f0ac3
System Description: Trisquel GNU/Linux 7.0, Belenos
Configured using:
`configure 'CFLAGS=-g -O0''
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GCONF GSETTINGS NOTIFY
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Help
Minor modes in effect:
diff-auto-refine-mode: t
shell-dirtrack-mode: t
gpm-mouse-mode: t
tooltip-mode: t
global-eldoc-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
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Recent messages:
Mark set
Mark saved where search started [7 times]
Quit
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark saved where search started [2 times]
Auto-saving...
Mark saved where search started
Making completion list...
Quit
C-x 4 C-g is undefined
Load-path shadows:
None found.
Features:
(eieio-opt speedbar sb-image ezimage dframe find-func novice vc
vc-dispatcher vc-git bug-reference add-log pp shadow emacsbug
parse-time vc-cvs etags thingatpt xref project cal-move cal-menu
calendar cal-loaddefs wid-edit battery sgml-mode epa-file rmailkwd
ispell epa-mail epa derived epg diff-mode easy-mmode diff dired-aux
sh-script smie executable quail rmailsum conf-mode rmailout shr-color
color url-util url-parse auth-source cl-seq eieio byte-opt bytecomp
byte-compile cl-extra seq cconv eieio-core cl-macs gv gnus-util
password-cache url-vars shr dom subr-x browse-url misearch
multi-isearch dabbrev shell pcomplete grep compile comint ansi-color
ring mailalias qp rmailmm message sendmail format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums mm-util help-fns
help-mode cl-loaddefs pcase cl-lib mail-prsvr mail-utils dired t-mouse
view time-date paren cus-start cus-load advice finder-inf package
easymenu epg-config mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
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
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 8 387608 101135)
(symbols 24 28231 3)
(miscs 20 5511 4232)
(strings 16 51815 17926)
(string-bytes 1 1899171)
(vectors 8 31455)
(vector-slots 4 1538023 39042)
(floats 8 453 880)
(intervals 28 70732 2674)
(buffers 520 156)
(heap 1024 23258 2927))
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Changed bug title to 'char-fold isearch: how to disable' from '25.0.50; char-fold search is a screw, and I can't see how to disable'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 17 Aug 2015 06:58:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Mon, 17 Aug 2015 07:24:03 GMT)
Full text and
rfc822 format available.
Message #10 received at 21277 <at> debbugs.gnu.org (full text, mbox):
Richard Stallman <rms <at> gnu.org> writes:
> 1. Char-fold isearch is a screw. I wanted to search for lines
> starting with a space, so I searched for C-j SPC, but it did something
> useless. It found every blank line!
That has nothing to do with char-fold, this feature already exists since
24.3 and is called lax-whitespace.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 03:42:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 21277 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> That has nothing to do with char-fold, this feature already exists since
> 24.3 and is called lax-whitespace.
How come it did not occur in the Emacs I was running before last week?
I built that from master a few months ago.
Anyway, it is a total screw. Who likes this as a default?
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 03:42:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 21277 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> That has nothing to do with char-fold, this feature already exists since
> 24.3 and is called lax-whitespace.
If char-fold really only affects ASCII and Unicode lookalikes, is it
important enough to be worth mentioning in the echo area? If not,
let's delete it from the echo area.
Does anyone really want to disable it?
On the other hand, lax whitespace search by default is a drastic
change. That should be listed in the echo area, and its default
should be nil.
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 12:31:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 21277 <at> debbugs.gnu.org (full text, mbox):
Richard Stallman <rms <at> gnu.org> writes:
> > That has nothing to do with char-fold, this feature already exists since
> > 24.3 and is called lax-whitespace.
>
> How come it did not occur in the Emacs I was running before last week?
> I built that from master a few months ago.
>
> Anyway, it is a total screw. Who likes this as a default?
I like that behavior because I frequently search for "some text" in
prose, and then it allows me to find also the matches where the two
words are wrapped around.
But I think the `isearch-lax-whitespace' feature can still be improved:
1. The `isearch-lax-whitespace' docstring speaks of "ordinary
incremental search" which I've read as "non-regex isearch". But it
seems that regex isearch is also affected. I'd just strip the
"ordinary".
2. More importantly, isearching for C-j SPC matches any sequence of two
whitespace characters, e.g., it matches between here and here, too.
^^ ^^
I had expected that only space characters in the search string are
replaced by `search-whitespace-regexp' but it seems that any whitespace
character is replaced by it. I think this is not good.
And IMHO, it would be a good idea to disable lax-whitespace for the
current search as soon as the search string contains a non-space
whitespace character. I think if the user explicitly types C-j, C-i,
etc. she's probably not interested in treating spaces as any-whitespace
but wants to distinguish newlines from tabs and spaces.
Bye,
Tassilo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 13:11:01 GMT)
Full text and
rfc822 format available.
Message #22 received at submit <at> debbugs.gnu.org (full text, mbox):
Richard Stallman <rms <at> gnu.org> writes:
> 2. So I decided to try to disable it, but the doc string of
> isearch says nothing about how to turn that off. It should say how.
>
> 3. I tried using C-h v to find a variable, but although there is
> isearch-case-fold-search, there is no isearch-char-fold-search.
> For parallelism's sake, isearch-char-fold-search should exist.
>
> 4. I searched in etc/NEWS for 'char fold' and 'char-fold'.
> Neither appears. Both of them SHOULD appear, for the sake
> of people who search for them.
>
> 5. I did find 'isearch', and that entry described the new inconvenient
> feature. However the entry there did not say how to disable this
> feature. It should say how.
As I understand it, the variables `character-fold-search' and
`replace-character-fold' control the new folding features. I have it all
disabled--both variables set to nil. At least they have docstrings;
however, yes, they need to be documented in isearch, replace, and NEWS.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 14:26:01 GMT)
Full text and
rfc822 format available.
Message #25 received at 21277 <at> debbugs.gnu.org (full text, mbox):
FYI: This is the thread that discussed this feature, in quite a lot
of detail (behavior, defaults, toggling, chars to match, indication
in echo area or elsewhere, etc.).
http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00502.html
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 21:59:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 21277 <at> debbugs.gnu.org (full text, mbox):
2015-08-18 13:30 GMT+01:00 Tassilo Horn <tsdh <at> gnu.org>:
> I like that behavior because I frequently search for "some text" in
> prose, and then it allows me to find also the matches where the two
> words are wrapped around.
Me too, it's very useful in prose. I agree that it's not super useful
in code. But it's also not harmful enough in code that it should be
disabled in prose.
> But I think the `isearch-lax-whitespace' feature can still be improved:
> [...]
> I had expected that only space characters in the search string are
> replaced by `search-whitespace-regexp' but it seems that any whitespace
> character is replaced by it. I think this is not good.
I agree.
> And IMHO, it would be a good idea to disable lax-whitespace for the
> current search as soon as the search string contains a non-space
> whitespace character. I think if the user explicitly types C-j, C-i,
> etc. she's probably not interested in treating spaces as any-whitespace
> but wants to distinguish newlines from tabs and spaces.
I'm so sure this would be good, but I'm not sure it would be bad either.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 21:59:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 21277 <at> debbugs.gnu.org (full text, mbox):
>> but wants to distinguish newlines from tabs and spaces.
>
> I'm so sure this would be good, but I'm not sure it would be bad either.
I'm NOT so sure...
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Tue, 18 Aug 2015 22:30:04 GMT)
Full text and
rfc822 format available.
Message #34 received at 21277 <at> debbugs.gnu.org (full text, mbox):
> 2. So I decided to try to disable it, but the doc string of
> isearch says nothing about how to turn that off. It should say how.
>
> 3. I tried using C-h v to find a variable, but although there is
> isearch-case-fold-search, there is no isearch-char-fold-search.
> For parallelism's sake, isearch-char-fold-search should exist.
>
> 4. I searched in etc/NEWS for 'char fold' and 'char-fold'.
> Neither appears. Both of them SHOULD appear, for the sake
> of people who search for them.
>
> 5. I did find 'isearch', and that entry described the new inconvenient
> feature. However the entry there did not say how to disable this
> feature. It should say how.
All good points. I'll try to address all of these when I can.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Wed, 19 Aug 2015 18:15:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 21277 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> Me too, it's very useful in prose. I agree that it's not super useful
> in code. But it's also not harmful enough in code that it should be
> disabled in prose.
It was in prose that it screwed me! I wanted to search for NL SPC,
but it found NL NL instead.
See another message in this batch
for an idea for making this work better.
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Wed, 19 Aug 2015 22:29:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 21277 <at> debbugs.gnu.org (full text, mbox):
> 3. I tried using C-h v to find a variable, but although there is
> isearch-case-fold-search, there is no isearch-char-fold-search.
> For parallelism's sake, isearch-char-fold-search should exist.
There are both case-fold-search and its isearch-specific counterpart
isearch-case-fold-search, so maybe both char-fold-search and
isearch-char-fold-search should exist.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Wed, 19 Aug 2015 22:29:03 GMT)
Full text and
rfc822 format available.
Message #43 received at 21277 <at> debbugs.gnu.org (full text, mbox):
> If char-fold really only affects ASCII and Unicode lookalikes, is it
> important enough to be worth mentioning in the echo area? If not,
> let's delete it from the echo area.
One idea was to not display default parameters in the echo area.
So when e.g. char-fold search is t by default then it should not
be indicated in the echo area.
> Does anyone really want to disable it?
Like case-fold search, char-fold search could be disabled either by
customizing the corresponding variable, or interactively with ‘M-s '’.
> On the other hand, lax whitespace search by default is a drastic
> change. That should be listed in the echo area, and its default
> should be nil.
AFAIK, a drastic change was not in lax whitespace search per se, but
only in its combination with char-fold search that we could fix now.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Wed, 19 Aug 2015 22:29:03 GMT)
Full text and
rfc822 format available.
Message #46 received at 21277 <at> debbugs.gnu.org (full text, mbox):
> But I think the `isearch-lax-whitespace' feature can still be improved:
>
> 1. The `isearch-lax-whitespace' docstring speaks of "ordinary
> incremental search" which I've read as "non-regex isearch". But it
> seems that regex isearch is also affected. I'd just strip the
> "ordinary".
Regexp isearch is affected by ‘isearch-regexp-lax-whitespace’.
> And IMHO, it would be a good idea to disable lax-whitespace for the
> current search as soon as the search string contains a non-space
> whitespace character. I think if the user explicitly types C-j, C-i,
> etc. she's probably not interested in treating spaces as any-whitespace
> but wants to distinguish newlines from tabs and spaces.
Good idea - it could work the same way as case-fold search detects the presence
of uppercase chars in the search string to automatically toggle itself.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Thu, 20 Aug 2015 09:37:02 GMT)
Full text and
rfc822 format available.
Message #49 received at 21277 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> There are both case-fold-search and its isearch-specific counterpart
> isearch-case-fold-search, so maybe both char-fold-search and
> isearch-char-fold-search should exist.
Actually, `isearch-case-fold-search' is an internal variable and
configuring it has no effect. If you want configure isearch's case-folding,
you have to use the general `case-fold-search'.
That is why there's no isearch-char-fold-search.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21277
; Package
emacs
.
(Thu, 20 Aug 2015 16:57:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 21277 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > If char-fold really only affects ASCII and Unicode lookalikes, is it
> > important enough to be worth mentioning in the echo area? If not,
> > let's delete it from the echo area.
> One idea was to not display default parameters in the echo area.
> So when e.g. char-fold search is t by default then it should not
> be indicated in the echo area.
Might be good.
> > Does anyone really want to disable it?
> Like case-fold search, char-fold search could be disabled either by
> customizing the corresponding variable, or interactively with ‘M-s '’.
Yes, but does anyone really ever want to disable it?
> > On the other hand, lax whitespace search by default is a drastic
> > change. That should be listed in the echo area, and its default
> > should be nil.
> AFAIK, a drastic change was not in lax whitespace search per se, but
> only in its combination with char-fold search that we could fix now.
Is that a certainty? I now think the problem is simply in lax
whitespace search. Some evidence is that it occurs in an Emacs from a
year ago, in which char-fold search did not exist.
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
This bug report was last modified 9 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.