unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@linkov.net>
Cc: charles@aurox.ch, 29321@debbugs.gnu.org
Subject: bug#29321: Isearch hit count
Date: Tue, 30 Oct 2018 16:35:42 -0700 (PDT)	[thread overview]
Message-ID: <8629624d-6118-4b6b-b626-77801112326a@default> (raw)
In-Reply-To: <87r2g7kp8u.fsf@mail.linkov.net>

> > I still do see the problem (did I mention this one?)
> > that if I reverse direction so that the prompt changes
> > to, say, Overwrapped..., there is no count shown.  But
> > later sometimes it comes back.
> >
> > Does this make sense?  Why would the prompt sometimes
> > disappear?  That must mean that, for some reason,
> > `isearch-lazy-count-current' is nil, right?
> >
> > Do you see this?  It might help to repeat-search
> > quickly; dunno.  I'm still searching just with the
> > regexp "se\(.*\)r", FWIW.
> 
> Congratulations, you stumbled upon long-standing backward regexp
> search controversy.
> 
> Reversing direction invalidates the number of matches
> because it will find another number.  Did you notice
> that the total number of matches is different after
> switching direction e.g. for "se\(.*\)r"?

I didn't notice it, but sure, I understand that matching
backward is not the same as forward.

Dunno why that would produce the symptoms I described,
however.

> Here is a minimal test case:
> 
> 0. emacs -Q
> 1. Paste this text to the end of *scratch*:
>   Does this make sense?  Why would the prompt sometimes disappear?
> 2. For convenience, put this regexp to the regexp search history:
>    C-M-s se\(.*\)r RET
> 3. Go to the beginning of *scratch*
> 4. Type C-M-s C-s
> 
> See the following text is matched and highlighted:
>   sense?  Why would the prompt sometimes disappear?
> 5. Type C-r
> See another part of this text is matched and highlighted:
>   se?  Why would the prompt sometimes disappear?
> 6. Type C-s
> See the second text is matched and highlighted:
>   se?  Why would the prompt sometimes disappear?
> 
> not the initial text:
>   sense?  Why would the prompt sometimes disappear?
> 
> This is why no count is shown.  Lazy-count searches
> from the top of the buffer.  However, C-s C-r C-s
> finds a shorter match after switching direction.

That all makes sense.

But I don't think that explains the part of the
behavior where the prompt does not appear without
changing direction, just by repeating search (e.g.
always forward) very quickly.  Or if it does explain
it somehow, I don't quite get it yet.

> The problem occurs only with different values of
> isearch-other-end that corresponds to match-beginning,
> not with match-end that coincides with point.
> 
> Initially I planned to use point, not isearch-other-end.
> But since there is no special isearch variable for point,
> and the value of point is changed by the lazy updating,
> I was too lazy to add a corresponding variable for point.
> 
> Now a new version attached below just let-binds the
> initial value of point.  You can compare it with the
> previous version to see the change.  The fix is very small.

I'll give it a try.

Thx - Drew





  reply	other threads:[~2018-10-30 23:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 19:27 bug#29321: Isearch hit count Charles A. Roelli
2018-10-27 20:55 ` Juri Linkov
2018-10-27 21:31   ` Drew Adams
2018-10-27 22:25   ` Drew Adams
2018-10-27 22:58     ` Drew Adams
2018-10-27 23:23       ` Drew Adams
2018-10-28  0:02         ` Drew Adams
2018-10-28  0:35           ` bug#29360: " Drew Adams
2018-10-28 22:34             ` bug#29360: Add full-buffer choice for `isearch-lazy-highlight' Juri Linkov
2018-10-28 22:57               ` Drew Adams
2018-10-28  3:35           ` bug#29321: Isearch hit count Drew Adams
2018-10-28 22:38             ` Juri Linkov
2018-10-29  0:22               ` Drew Adams
2018-10-29 23:31                 ` Juri Linkov
2018-10-30  2:43                   ` Drew Adams
2018-10-30  3:19                   ` Drew Adams
2018-10-30  3:47                     ` Drew Adams
2018-10-30  4:02                       ` Drew Adams
2018-10-30 23:07                     ` Juri Linkov
2018-10-30 23:35                       ` Drew Adams [this message]
2018-10-30 23:43                         ` Drew Adams
2018-10-31 21:30                           ` Juri Linkov
2018-10-31 22:07                             ` Drew Adams
2018-11-01 22:22                               ` Juri Linkov
2018-11-01 23:46                                 ` Drew Adams
2018-11-02 12:51                                 ` Live System User
2018-11-04  0:04                                   ` Juri Linkov
2018-11-04  0:11                                   ` Juri Linkov
2018-11-04  1:22                                     ` Drew Adams
2018-11-04 22:50                                       ` Juri Linkov
2018-11-05  3:09                                         ` Drew Adams
2018-11-04 19:13                                     ` Live System User
2018-11-22 22:03                                       ` Juri Linkov
2018-11-24 12:55                                         ` Charles A. Roelli
2018-11-04 16:47                                 ` Drew Adams
2018-11-04 22:59                                   ` Juri Linkov
2018-11-05  2:41                                     ` Drew Adams
2018-11-10 14:27                                     ` Charles A. Roelli
2018-11-10 20:45                                       ` Juri Linkov
2018-11-11  9:49                                         ` Charles A. Roelli
2018-11-11 20:02                                           ` Juri Linkov
2018-11-13 21:48                                             ` Drew Adams
2018-11-14 22:36 ` Juri Linkov
2018-11-15  8:02   ` Live System User
2018-11-15 21:16     ` Juri Linkov
2018-11-20 23:43       ` Juri Linkov
2018-11-15 21:15   ` Charles A. Roelli
2018-11-15 21:58     ` Juri Linkov
2018-11-16 20:03       ` Charles A. Roelli
2018-11-17 21:59         ` Juri Linkov
2018-11-20 23:52     ` Juri Linkov
     [not found] <<m2ineavxaz.fsf@aurox.ch>
2017-11-16 22:25 ` Drew Adams
2017-11-19 17:12   ` Charles A. Roelli
     [not found] <<<m2ineavxaz.fsf@aurox.ch>
     [not found] ` <<1585f8e7-72a7-497c-9879-8bf1dda3f28f@default>
     [not found]   ` <<m2a7ziw5uf.fsf@aurox.ch>
2017-11-19 19:06     ` Drew Adams
2017-11-20 19:25       ` Charles A. Roelli

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=8629624d-6118-4b6b-b626-77801112326a@default \
    --to=drew.adams@oracle.com \
    --cc=29321@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    --cc=juri@linkov.net \
    /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).