Subject: bug#1352 closed by Juri Linkov <[email-masked]> (Re: bug#1352: 23.0.60; isearch-success-function)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1352: 23.0.60; isearch-success-function

It has been closed by Juri Linkov <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Juri Linkov <[email-masked]> by
replying to this email.

-- 
1352: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1352
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Sun Nov 16 16:47:12 2008
From: Juri Linkov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], Drew Adams <[email-masked]>
Subject: Re: bug#1352: 23.0.60; isearch-success-function
Organization: JURTA
Date: Mon, 17 Nov 2008 02:46:02 +0200

> Sounds very good, thank you, please install it.

Done.

-- 
Juri Linkov
http://www.jurta.org/emacs/

>From [email-masked] Sat Nov 15 15:39:35 2008
From: "Drew Adams" <[email-masked]>
To: <[email-masked]>
Subject: 23.0.60; isearch-success-function
Date: Sat, 15 Nov 2008 15:39:35 -0800

The name of `isearch-success-function' seems wrong, if we believe the
doc string. The doc string suggests that it is a predicate that
filters the search hits that would otherwise be available. That's very
general. If that's true, then the name should reflect this meaning -
perhaps `isearch-predicate'.
 
Similarly, the name of `isearch-success-function-default' should be
something that suggests its very limited meaning: it filters search
hits to those that are visible, unless invisible text too can be
searched. It is a particular kind of search filter, and its name
should reflect that particularity.
 
Also, in `isearch-search', there is this:
 
;; Clear RETRY unless we matched some invisible text
;; and we aren't supposed to do that.
(if (or (not isearch-success)
        (bobp) (eobp)
        (= (match-beginning 0) (match-end 0))
        (funcall isearch-success-function
                 (match-beginning 0) (match-end 0)))
    (setq retry nil)))
 
The code here is general; it is not related to text visibility. So the
comment is not general enough. It is a vestige that is appropriate now
only when the value of `isearch-success-function' is
`isearch-success-function-default'. The comment should instead say
that we clear RETRY unless the search predicate says to skip this
search hit.
 
It seems like this is a partly finished enhancement to behavior that
was originally only for searching invisible text. Seems like this was
generalized to an arbitrary predicate that filters possible search
hits - but the job seems only half done. The code presumably works in
a general way, but the comments and symbol names are inappropriate.
 
The comments and the variable and function names need to reflect the
new behavior, and this behavior should be documented for users. Users
should know how to take advantage of this feature, defining their own
search predicates that filter the search hits that would normally be
available, so that hits that dissatisfy the predicate are skipped.

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-11-08 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'