Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
New feature idea: isearch with autocorrection
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom  
View profile  
 More options Aug 24 2012, 3:38 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Fri, 24 Aug 2012 19:38:28 +0000 (UTC)
Local: Fri, Aug 24 2012 3:38 pm
Subject: New feature idea: isearch with autocorrection
I was browsing the questions on StackExchange (which you can also do
here: http://stackexchange.com/filters/19474/emacs-questions?sort=noanswers )
when I saw this question:

http://stackoverflow.com/questions/12099760/emacs-incremental-search-...
the-search-string-the-characters-tha

The asker wants isearch to ignore the nonmatching character if
a later character can be used for successful matching.

What do you think? It sounds useful, not having to delete the
problematic part, but simply typing the correct characters.

It could be useful to have an option to turn on this feature.
Would it be hard to implement?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vagn Johansen  
View profile  
 More options Aug 25 2012, 1:45 pm
Newsgroups: gnu.emacs.help
From: Vagn Johansen <gonz...@hotmail.com>
Date: Sat, 25 Aug 2012 19:45:38 +0200
Local: Sat, Aug 25 2012 1:45 pm
Subject: Re: New feature idea: isearch with autocorrection

Tom <adatgyu...@gmail.com> writes:
> http://stackoverflow.com/questions/12099760/emacs-incremental-search-... the-search-string-the-characters-tha

> The asker wants isearch to ignore the nonmatching character if
> a later character can be used for successful matching.

> What do you think? It sounds useful, not having to delete the
> problematic part, but simply typing the correct characters.

This sounds a bit weird.

> It could be useful to have an option to turn on this feature.
> Would it be hard to implement?

Something close this behaviour can be found in fuzzy.el

  https://github.com/m2ym/fuzzy-el/blob/master/fuzzy.el

It has support for isearch (use turn-on-fuzzy-isearch).

--
Vagn Johansen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Aug 25 2012, 2:55 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Sat, 25 Aug 2012 18:55:33 +0000 (UTC)
Local: Sat, Aug 25 2012 2:55 pm
Subject: Re: New feature idea: isearch with autocorrection
Vagn Johansen <gonz808 <at> hotmail.com> writes:

> Something close this behaviour can be found in fuzzy.el

>   https://github.com/m2ym/fuzzy-el/blob/master/fuzzy.el

> It has support for isearch (use turn-on-fuzzy-isearch).

Thanks, I'll take a look.

In the meantime I came up with a quick and dirty solution to see
how useful a similar feature could be in standard isearch.

It is a simple advice which automatically deletes non matching characters
immediately, so it does not allow building up bad characters
in the search string:

(defadvice isearch-search-and-update
   (after isearch-search-and-update-ignore-bad-chars activate)
  (unless isearch-success
    (push 127 unread-command-events)))

I tried a few searches and it seems useful. Why is the default
implementation leaves bad characters in the search string at all? It is not
very useful, because then you must delete them manually.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Aug 25 2012, 3:08 pm
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Sat, 25 Aug 2012 19:08:04 +0000 (UTC)
Local: Sat, Aug 25 2012 3:08 pm
Subject: Re: New feature idea: isearch with autocorrection
Tom <adatgyujto <at> gmail.com> writes:

> I tried a few searches and it seems useful. Why is the default
> implementation leaves bad characters in the search string at all? It is not
> very useful, because then you must delete them manually.

It occured to me it is useful for overwrapped search when you hit the
end of the file, but then you can press C-s to search for the failed
string from the beginning.

On the other hand the above advice is quite useful when you only
want to search forward in the file without overwrapping, because
in this case collecting the nonmatching characters in the search
string is useless, because you have to delete them to fix the search
string.

So the best solution would be to somehow combine the two. Collect
the failed chars as usual to allow for quick overwrapping search,
but at the same time show those matches until the end of file
which can be found by ignoring the nonmatching chars in the
search string, so the user does not have to delete them
manually to correct the search.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yuri Khan  
View profile  
 More options Aug 27 2012, 5:25 am
Newsgroups: gnu.emacs.help
From: Yuri Khan <yuri.v.k...@gmail.com>
Date: Mon, 27 Aug 2012 16:25:14 +0700
Local: Mon, Aug 27 2012 5:25 am
Subject: Re: New feature idea: isearch with autocorrection

On Sat, Aug 25, 2012 at 2:38 AM, Tom <adatgyu...@gmail.com> wrote:
> The asker wants isearch to ignore the nonmatching character if
> a later character can be used for successful matching.

> What do you think? It sounds useful, not having to delete the
> problematic part, but simply typing the correct characters.

It sounds useful only until you actually try something that works that
way. Then you discover that, whenever you make a typo, your fingers
subconsciously press Backspace and correct the typo before your brain
even gets to realize that you “don’t have” to erase the wrong
character.

With the proposed change, the sequence of events becomes:

1. You type the prefix. The editor finds it.
2. You make a typo. The editor does not find the new string and
ignores the last character.
3. You press Backspace. Since your typo character was ignored, you end
up erasing the last character that was correct.
4. You enter the character that would correct the typo, and probably a
few more. For the purposes of isearch, it is added to the prefix
without its last character (which you involuntarily erased at step 3).
Most probably, the editor does not find the new string and drops your
correction character and whatever subsequent characters you enter.
Maybe even beeps at you, too.
5. You say “oh s#!t” and have to look at and think about your current
search string, to resume typing from the correct character.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Aug 27 2012, 9:07 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Mon, 27 Aug 2012 13:07:35 +0000 (UTC)
Local: Mon, Aug 27 2012 9:07 am
Subject: Re: New feature idea: isearch with autocorrection
Yuri Khan <yuri.v.khan <at> gmail.com> writes:
.

> It sounds useful only until you actually try something that works that
> way. Then you discover that, whenever you make a typo, your fingers
> subconsciously press Backspace and correct the typo before your brain
> even gets to realize that you “don’t have” to erase the wrong
> character.

Yes, it may not work well, but I come to realize the fixing with
backspace part could be improved anyway.

Isearch should have a binding which deletes all the non-matching
characters from the search string. C-Backspace can be a good candidate
for that.

So instead of typing backspace several times, you could just press
C-Bakspace which would leave only the matching part of the search string.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Filipp Gunbin  
View profile  
 More options Aug 27 2012, 9:18 am
Newsgroups: gnu.emacs.help
From: Filipp Gunbin <fgun...@fastmail.fm>
Date: Mon, 27 Aug 2012 17:18:55 +0400
Local: Mon, Aug 27 2012 9:18 am
Subject: Re: New feature idea: isearch with autocorrection
On 27/08/2012 17:07, Tom wrote:

> Isearch should have a binding which deletes all the non-matching
> characters from the search string. C-Backspace can be a good candidate
> for that.

It already has - `C-g'.

--
Filipp Gunbin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Aug 27 2012, 9:23 am
Newsgroups: gnu.emacs.help
From: Tom <adatgyu...@gmail.com>
Date: Mon, 27 Aug 2012 13:23:26 +0000 (UTC)
Local: Mon, Aug 27 2012 9:23 am
Subject: Re: New feature idea: isearch with autocorrection
Filipp Gunbin <fgunbin <at> fastmail.fm> writes:

> On 27/08/2012 17:07, Tom wrote:

> > Isearch should have a binding which deletes all the non-matching
> > characters from the search string. C-Backspace can be a good candidate
> > for that.

> It already has - `C-g'.

Cool, thanks. It never occurred to me to use C-g to fix the search
string. It's not a very intuitive binding, because it's usually
associated with aborting operations, not with correcting things.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ludwig, Mark  
View profile  
 More options Aug 27 2012, 12:45 pm
Newsgroups: gnu.emacs.help
From: "Ludwig, Mark" <ludwig.m...@siemens.com>
Date: Mon, 27 Aug 2012 16:45:25 +0000
Local: Mon, Aug 27 2012 12:45 pm
Subject: RE: New feature idea: isearch with autocorrection

I learned about this so long ago that my fingers sometimes do it without conscious thought, but I somehow _do_ associate this as an 'abort' of sorts: it's aborting the failing search, returning me to the successful search I had started.  (I also agree it's not exactly intuitive, because the I-search itself continues.  Pressing Control-G during a successful I-search aborts that too, of course, and at that point, there is no search running.)

Hope this helps,
Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Adams  
View profile  
 More options Aug 27 2012, 2:13 pm
Newsgroups: gnu.emacs.help
From: "Drew Adams" <drew.ad...@oracle.com>
Date: Mon, 27 Aug 2012 11:13:00 -0700
Subject: RE: New feature idea: isearch with autocorrection

> I learned about this so long ago that my fingers sometimes do
> it without conscious thought, but I somehow _do_ associate
> this as an 'abort' of sorts: it's aborting the failing
> search, returning me to the successful search I had started.  
> (I also agree it's not exactly intuitive, because the
> I-search itself continues.  Pressing Control-G during a
> successful I-search aborts that too, of course, and at that
> point, there is no search running.)

BTW, a related feature from Isearch+ was added to vanilla Emacs also: If you hit
`M-e' (to edit the search string), the cursor is moved to the mismatch position.

This is handy if you want to insert or change a char or two at that position,
for example.

(I took this idea from Icicles, where, when there is a completion mismatch, a
first `C-M-l' puts the cursor at the mismatch position.  A second `C-M-l'
removes the mismatched suffix.)

I also have a comment wrt the idea of "autocorrecting" the search string (which
I am not enthusiastic about personally, although I do support encouraging a
hundred flowers to bloom):

Isearch is often started using a previous search string, and sometimes that is
done in a different, but perhaps related, context.

In such a situation, a previous search string, even if it does not match
anything, can be useful if there is a partial match - `M-e' is your friend.
IMO, it is not necessarily desirable to automatically throw away non-matching
chars.

(More generally, I am not a big fan of autocorrection elsewhere either.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bug Dout  
View profile  
 More options Aug 29 2012, 1:02 pm
Newsgroups: gnu.emacs.help
From: Bug Dout <bugg...@mailinator.com>
Date: Wed, 29 Aug 2012 10:02:19 -0700
Local: Wed, Aug 29 2012 1:02 pm
Subject: Re: New feature idea: isearch with autocorrection

Yuri Khan <yuri.v.k...@gmail.com> writes:
> It sounds useful only until you actually try something that works that
> way. Then you discover that, whenever you make a typo, your fingers
> subconsciously press Backspace and correct the typo before your brain
> even gets to realize that you “don’t have” to erase the wrong
> character.

This is a BS answer. By this reasoning--don't judge a change on its
merits, rather on how I have to change my habits--we'd still be swinging
around in trees like our ancient ancestors.

BTW the link to fuzzy.el doesn't work, must have changed very recently
because even Google points to the incorrect location.

I haven't tried the proposed change but have this question: what about
when you're searching for a string and don't make a typo, rather, the
string isn't there? Isn't that the point of generating some sort of
error, rather than silently "fixing" it for you?
--
They made a wasteland and called it peace.
 ~ Tacitus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vagn Johansen  
View profile  
 More options Aug 29 2012, 2:50 pm
Newsgroups: gnu.emacs.help
From: Vagn Johansen <gonz...@hotmail.com>
Date: Wed, 29 Aug 2012 20:50:26 +0200
Local: Wed, Aug 29 2012 2:50 pm
Subject: Re: New feature idea: isearch with autocorrection

Bug Dout <bugg...@mailinator.com> writes:
> BTW the link to fuzzy.el doesn't work, must have changed very recently
> because even Google points to the incorrect location.

Maybe it never worked?

https://github.com/auto-complete/fuzzy-el

--
Vagn Johansen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »