unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@floss.red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: isearch-yank-char
Date: 30 Apr 2004 08:58:45 -0500	[thread overview]
Message-ID: <87u0z15zze.fsf@floss.red-bean.com> (raw)
In-Reply-To: <Pine.LNX.3.96.1040430081120.566B-100000@acm.acm>

Alan Mackenzie <acm@muc.de> writes:
> Excellent idea!  Let's do it!

Great!

> >   2. Bind C-b in isearch-mode to a function (name TBD) that loses
> >      one char from the search string.
> 
> NOT SO FAST!  Tell me, where does point get left after a C-b?  Normally,
> one character backwards.  No problem.  But....

That's what I was thinking.  It would be "just as if" you hadn't typed
the character just dropped from the search string in the first place.

> Where does point get left in a regexp-search after C-b?  Suppose that the
> last character entered into the regexp search string was a closing
> parenthesis (or whatever) that caused the the regexp search to backtrack,
> moving point to an earlier position?  I can think of several ideas for
> handling this, e.g.:

Oooh.  Glad you asked -- hadn't even thought about isearch-*-regexp,
since I rarely use them.

> (i) Point moves _forward_ to where it was before the ] was entered, i.e.
> C-b works just like <del> in this case;  However, the search string might
> just have been extended by several characters at once (with M-y).  This
> looks like getting hairy;
>
> (ii) C-b only works in normal (non-regexp) search;
> 
> (iii) C-b is disallowed in regexp-search for quirky characters like );
> 
> (iv) C-b is disallowed in regexp-search whenever it would cause point to
> jump forward;
> 
> (v) Point is left where it was, and the currently highlighted "match" is
> no longer a match at all;
> 
> (vi) C-b in such circumstances acts like M-e, leaving the user directly
> editing the search string.
> 
> I think it would be a good idea to resolve this issue before implementing
> a C-b.  I'm not sure whether I'd rather do without C-b here than have
> some ugly inconsistency, even if that inconsistency only appears in
> marginal circumstances.

Yes, we should figure out the desired behavior first.

I think it should drop the last (regexp-quoted) character inserted
into the search string, for consistency, and then the search string
would behave as it normally would if that character (or characters, if
it got regexp-quoted) were dropped.

In other words, your option (i), which is to behave almost like <del>,
except remember that <del> actually drops "last unit added".  I.e.,
del after C-w drops a word, and after C-y can drop even more.  But C-b
would always drop a character, plus any regexp quoting that got added
to that character when it was brought into the search string.

I think to flesh this proposal out, we'd have to look more into how
<del> behaves currently in the isearch-*-regexp functions.  I haven't
had time to do that yet, so please don't take the above as much more
than hand-waving :-).

-Karl

  parent reply	other threads:[~2004-04-30 13:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-26  4:42 isearch-yank-char Juri Linkov
2004-04-25 23:03 ` isearch-yank-char Karl Fogel
2004-04-25 23:17   ` isearch-yank-char Karl Fogel
2004-04-26  6:15   ` isearch-yank-char Juri Linkov
2004-04-26 14:10 ` isearch-yank-char Richard Stallman
2004-04-26 22:42 ` isearch-yank-char Stefan Monnier
2004-04-26 23:03   ` isearch-yank-char Miles Bader
2004-04-26 22:48     ` isearch-yank-char Karl Fogel
2004-04-27  8:09       ` isearch-yank-char Juri Linkov
2004-04-27  9:11         ` isearch-yank-char Juri Linkov
2004-04-27  9:41         ` isearch-yank-char David Kastrup
2004-04-27 22:49           ` isearch-yank-char Karl Fogel
2004-04-28  5:04           ` isearch-yank-char Juri Linkov
2004-04-29 22:08             ` isearch-yank-char Karl Fogel
2004-04-30  4:48               ` isearch-yank-char Juri Linkov
2004-04-29 22:53                 ` isearch-yank-char Karl Fogel
2004-04-30  8:27                   ` isearch-yank-char Juri Linkov
2004-04-30 11:23                     ` isearch-yank-char Romain Francoise
2004-04-30 13:47                     ` isearch-yank-char Karl Fogel
2004-04-30 20:55                       ` isearch-yank-char Juri Linkov
2004-04-30 17:34                         ` isearch-yank-char Karl Fogel
2004-05-01  0:15                           ` isearch-yank-char Juri Linkov
2004-04-30 18:57                             ` isearch-yank-char Karl Fogel
2004-05-01  1:04                               ` isearch-yank-char Juri Linkov
2004-05-01 20:02                                 ` isearch-yank-char Kim F. Storm
2004-05-02 11:32                                   ` isearch-yank-char Juri Linkov
2004-05-03 12:40                                 ` isearch-yank-char Robert J. Chassell
2004-05-02 11:19                               ` isearch-yank-char Richard Stallman
2004-05-03 19:24                                 ` isearch-yank-char Karl Fogel
2004-05-04 20:08                                   ` isearch-yank-char Richard Stallman
2004-04-30  8:31               ` isearch-yank-char Alan Mackenzie
2004-04-30  9:52                 ` isearch-yank-char Juri Linkov
2004-04-30 10:12                 ` isearch-yank-char Miles Bader
2004-04-30 13:58                 ` Karl Fogel [this message]
2004-04-27  9:36       ` isearch-yank-char Kim F. Storm
2004-04-28  5:02   ` isearch-yank-char Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87u0z15zze.fsf@floss.red-bean.com \
    --to=kfogel@floss.red-bean.com \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).