Subject: RE: bug#15245: Search and replace, but based on text properties (inclulding face properties)

From: Drew Adams <[email-masked]>
Date: Mon, 2 Sep 2013 11:01:52 -0700 (PDT)

> > It could be incorporated into vanilla Emacs.
> 
> Does this mean you are offering it up as a patch to Emacs?  If *yes*, I
> am willing to give it a test run.

Yes, of course.  I have offered my code generally.

> Btw, can it convert the HTML rendered by eww in to let's say Oddmuse,
> Creole or Markdown formats?

No idea, and I know almost nothing about eww, Oddmuse, and Creole.

Also, when you say "convert" it makes me realize that you asked about
search and *replace*, not just search.  Not sure what you have in mind
there.

To be clear, this feature does only search.  It just limits the
contexts to be searched to buffer zones that have given text or overlay
properties.  For example, you can search for `en' within zones that
have either face `font-lock-keyword-face' or face
`font-lock-comment-face' (or whatever).

> By text properties, it need not necessarily be faces it can be any
> other text property (that stores some data)

Correct; it is not limited to property `face'.  From the description:

  Besides relying on other code to set 'face' and other text properties
  for use with 'C-t', you can use command 'isearchp-put-prop-on-region'
  (outside of Isearch) to add a text property to a zone of text.

  By default, it applies the last property and value whose zones you
  searched using 'C-t', but a prefix argument lets you specify the
  property and value to apply. This gives you an interactive way to set
  up zones for text-property search ('C-t'). For property 'face', empty
  input removes all faces from the region.

And for properties `face' and `font-lock-face', you can pick multiple
faces, as in the example I mentioned above.  Text is searched that has
a face text (or perhaps overlay) property that includes any of the
faces you choose.