all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>,
	"'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: emacs-pretest-bug@gnu.org, 1352@emacsbugs.donarmstrong.com
Subject: bug#1352: 23.0.60; isearch-success-function
Date: Sun, 16 Nov 2008 16:45:34 -0800	[thread overview]
Message-ID: <000e01c9484d$cdc82f20$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <87fxlrid7i.fsf@jurta.org>

Thanks, Juri. Looks better, to me anyway.

Some details you might want to consider -


1. This doc string:

> ! (defun isearch-filter-invisible (beg end)
> !   "Default predicate to filter out invisible text.
> ! It filters search hits to those that are visible (at least 
> partially),
> ! unless invisible text too can be searched."
>     (or (eq search-invisible t)
>         (not (isearch-range-invisible beg end))))

That explains how the predicate is used, not what it, itself, does.
I'd propose something like this:

 Tests whether the current search hit is visible to Isearch.
 Returns non-nil if `search-invisible' is t or the text from BEG to END
 is visible to Isearch as determined by `isearch-range-invisible'.


2. The predicate name.

A filter can be used either way: to allow to pass or to keep out.  The
Isearch filter allows whatever passes the predicate and disallows
whatever does not pass it.

Regardless of how a predicate might be used, its doc string and name
should reflect the quality for which the predicate is true: `bluep' is
true if its arg is blue, regardless of whether the predicate is used
to filter blueness out or in.

It is the quality of being isearch-visible that is tested here; the
predicate returns true when the search hit is visible to Isearch.  A
name that reflects that is `isearch-visible-p'.

Or, if we add the prefix `isearch-' systematically,
`isearch-isearch-visible-p'.  Or `isearch-visible-to-isearch-p'.
(This is bound to be somewhat confusing whatever name we use for it,
because of the notion of normally invisible text being visible to
Isearch.)

I'd probably go with just `isearch-visible-p'.


3. Similarly, I'd suggest `dired-isearch-filename-p' instead of
`dired-isearch-filter-filenames'.  Again, the predicate name should
reflect what the predicate does, not how it might be used.  In this
case, it returns true for a search hit that is a file name.  And the
doc string:

 Tests whether the current search hit is a file name.
 Returns non-nil if the text from BEG to END is part of a visible file
 name.


4. Likewise, something like `Info-isearch-visible-body-text-p' instead
of `Info-isearch-filter-predicate'.  Name it after the kind of search
hits that pass the test: body text (not header or tag-table text) that
is visible.  And the doc string:

 Tests whether the current search hit is a visible body text.
 Returns non-nil if the text from BEG to END is visible and is not in
 a header line or a tag table.








  parent reply	other threads:[~2008-11-17  0:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87tza7kwmt.fsf@jurta.org>
2008-11-15 23:39 ` bug#1352: 23.0.60; isearch-success-function Drew Adams
2008-11-16  1:10   ` Stefan Monnier
2008-11-16  1:22     ` Drew Adams
2008-11-16 21:16     ` Juri Linkov
2008-11-16 23:07       ` Stefan Monnier
2008-11-17  0:45       ` Drew Adams [this message]
2008-12-20 21:45         ` Juri Linkov
2008-12-20 22:33           ` Drew Adams
2008-12-22  1:23             ` Juri Linkov
2008-12-22  1:57               ` Drew Adams
2008-12-22 12:32               ` Stefan Monnier
2008-11-17  0:55   ` bug#1352: marked as done (23.0.60; isearch-success-function) Emacs bug Tracking System

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

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

  git send-email \
    --in-reply-to='000e01c9484d$cdc82f20$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=1352@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=juri@jurta.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.