|
From: | Dmitry Gutov |
Subject: | Re: Text property searching |
Date: | Mon, 16 Apr 2018 07:40:52 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 4/16/18 1:56 AM, Lars Ingebrigtsen wrote:
Let's say you have a region in the buffer that has the text property `shr-url' with the value "http://fsf.org/", then: (text-property-search-forward 'shr-url "http://fsf.org/" t) would place point at the end of that region, and `match-beginning' and `match-end' would point to the start and end.
Sounds quite nice.
The `t' there is the predicate: `t' means "equal", `nil' means "not equal", and then you can write your own predicates for other uses.
"Equals or includes" should be another popular predicate (think faces).
[Prev in Thread] | Current Thread | [Next in Thread] |