all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 34150-done@debbugs.gnu.org
Subject: bug#34150: 26.1; Document filtering with `isearch-filter-predicate' in Elisp manual
Date: Mon, 21 Jan 2019 18:21:22 +0200	[thread overview]
Message-ID: <83o98a9e2l.fsf@gnu.org> (raw)
In-Reply-To: <8c207ca2-39ae-4ec1-acbd-358165964319@default> (message from Drew Adams on Sun, 20 Jan 2019 16:17:41 -0800 (PST))

> Date: Sun, 20 Jan 2019 16:17:41 -0800 (PST)
> From: Drew Adams <drew.adams@oracle.com>
> 
> See https://emacs.stackexchange.com/q/47302/105, as one possible
> motivaton.
> 
> The only doc I can find about making Isearch and `perform-replace' (all
> of its uses) ignore/exclude certain matches is the doc string of
> variable `isearch-filter-predicate'.

I don't see why the doc string shouldn't be enough.  This is a quite
obscure feature, so I don't think it warrants to be described in the
manual.

> And that doc string isn't very precise about the args of the predicate.
> It says only: "The function has two arguments: the positions of start
> and end of text matched by the search."
> 
> It would help to add that these positions are `(match-beginning 0)' and
> `(match-end 0)', respectively, and to say that the match start position
> is the first of the two args.

To me, "the positions of start and end of the matched text" says
precisely that.  I don't see what can references to match-beginning
and match-end add; if anything, they might confuse, because at least
some readers will be sent down the rabbit hole to the descriptions of
those two, something that IMO is entirely unnecessary for writing a
filter.

> It would also be good to state whether predefined search functions such
> as `re-search-forward' respect it.  (I imagine that they do not, but I
> haven't checked, and there's no doc about this AFAIK.)  You could guess
> no, based on the `isearch' part of the variable name.  But if you guess
> like that then you likely won't also guess that the variable applies to
> `perform-replace' - it's not just about Isearch.

I modified the doc string to mention Isearch and replace commands.

> One thing that it would also be good to make extra clear is that
> filtering takes place _after_ input matching; it is not part of
> matching.

How can it be part of matching, if the filter needs to be passed the
limits of the matched text?





  reply	other threads:[~2019-01-21 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21  0:17 bug#34150: 26.1; Document filtering with `isearch-filter-predicate' in Elisp manual Drew Adams
2019-01-21 16:21 ` Eli Zaretskii [this message]
2019-01-21 18:18   ` Drew Adams
2019-01-21 18:27     ` Eli Zaretskii
     [not found] <<8c207ca2-39ae-4ec1-acbd-358165964319@default>
     [not found] ` <<83o98a9e2l.fsf@gnu.org>
     [not found]   ` <<8c88ff94-e322-4754-b74a-c792512ec277@default>
     [not found]     ` <<83h8e1amsu.fsf@gnu.org>
2019-01-21 18:40       ` Drew Adams
2019-01-21 19:05         ` Eli Zaretskii
     [not found] <<<8c207ca2-39ae-4ec1-acbd-358165964319@default>
     [not found] ` <<<83o98a9e2l.fsf@gnu.org>
     [not found]   ` <<<8c88ff94-e322-4754-b74a-c792512ec277@default>
     [not found]     ` <<<83h8e1amsu.fsf@gnu.org>
     [not found]       ` <<208f2037-8fa0-4475-a9cf-b2417613af5c@default>
     [not found]         ` <<83ef95al1s.fsf@gnu.org>
2019-01-21 23:10           ` Drew Adams

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=83o98a9e2l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=34150-done@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 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.