GNU bug report logs -
#1352
23.0.60; isearch-success-function
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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 <juri <at> jurta.org>.
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 <juri <at> jurta.org> by
replying to this email.
--
1352: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1352
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> Sounds very good, thank you, please install it.
Done.
--
Juri Linkov
http://www.jurta.org/emacs/
[Message part 3 (message/rfc822, inline)]
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'
This bug report was last modified 15 years and 193 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.