aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-09-25 11:42:35 +0300
committerEli Zaretskii2019-09-25 11:42:35 +0300
commit165890a70a256ce5c5f5953ac35239c295234684 (patch)
treeb4be99218eb4945a29e892408492974789642b53
parent213bcaf1bf365d0d40639754b8123f9d770b08e8 (diff)
downloademacs-165890a70a256ce5c5f5953ac35239c295234684.tar.gz
emacs-165890a70a256ce5c5f5953ac35239c295234684.zip
Improve documentation of 'text-property-search-forward'
* lisp/emacs-lisp/text-property-search.el (text-property-search-forward) (text-property-search-backward): Improve doc strings. (Bug#37488)
-rw-r--r--lisp/emacs-lisp/text-property-search.el47
1 files changed, 23 insertions, 24 deletions
diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el
index 5329c967e35..24d11be21dc 100644
--- a/lisp/emacs-lisp/text-property-search.el
+++ b/lisp/emacs-lisp/text-property-search.el
@@ -31,28 +31,26 @@
31 31
32(defun text-property-search-forward (property &optional value predicate 32(defun text-property-search-forward (property &optional value predicate
33 not-current) 33 not-current)
34 "Search for the next region that has text property PROPERTY set to VALUE. 34 "Search for the next region of text whose PROPERTY matches VALUE.
35If not found, the return value is nil. If found, point will be 35
36placed at the end of the region and an object describing the 36If not found, return nil. If found, move point to end of the region and
37match is returned. 37return a `prop-match' object describing the match. To access the details
38 38of the match, use `prop-match-beginning' and `prop-match-end' for the
39PREDICATE is called with two values. The first is the VALUE 39buffer positions that limit the region, and `prop-match-value' for the
40parameter. The second is the value of PROPERTY. This predicate 40value of PROPERTY in the region.
41should return non-nil if there is a match. 41
42 42PREDICATE is used to decide whether a value of PROPERTY should be
43Some convenience values for PREDICATE can also be used. `t' 43considered as matching VALUE.
44means the same as `equal'. `nil' means almost the same as \"not 44If PREDICATE is t, that means a value must `equal' VALUE to be
45equal\", but will also end the match if the value of PROPERTY 45considered a match.
46changes. See the manual for extensive examples. 46If PREDICATE is nil, a value will match if it is NOT `equal' to
47 47VALUE, and will also end the match if the value of PROPERTY changes.
48If NOT-CURRENT, if the match is under point, it will not be 48If PREDICATE is a function, it will be called with two arguments:
49returned, but instead the next instance is returned, if any. 49VALUE and the value of PROPERTY. The function should return
50 50non-nil if these two values should be considered a match.
51The return value (if a match is made) is a `prop-match' 51
52structure. The accessors available are 52If NOT-CURRENT is non-nil, the function will search for the first
53`prop-match-beginning'/`prop-match-end' (the region in the buffer 53region with matching value of PROPERTY that doesn't include point."
54that's matching), and `prop-match-value' (the value of PROPERTY
55at the start of the region)."
56 (interactive 54 (interactive
57 (list 55 (list
58 (let ((string (completing-read "Search for property: " obarray))) 56 (let ((string (completing-read "Search for property: " obarray)))
@@ -122,8 +120,9 @@ at the start of the region)."
122 120
123(defun text-property-search-backward (property &optional value predicate 121(defun text-property-search-backward (property &optional value predicate
124 not-current) 122 not-current)
125 "Search for the previous region that has text property PROPERTY set to VALUE. 123 "Search for the previous region of text whose PROPERTY matches VALUE.
126See `text-property-search-forward' for further documentation." 124
125Like `text-property-search-forward', which see, but searches backward."
127 (interactive 126 (interactive
128 (list 127 (list
129 (let ((string (completing-read "Search for property: " obarray))) 128 (let ((string (completing-read "Search for property: " obarray)))