Function: gnus-text-property-search

gnus-text-property-search is a byte-compiled function defined in gnus-util.el.gz.

Signature

(gnus-text-property-search PROP VALUE &optional FORWARD-ONLY GOTO END)

Documentation

Search current buffer for text property PROP with VALUE.

Behaves like a combination of text-property-any and text-property-search-forward. Searches for the beginning of a text property equal to VALUE. Returns the value of point at the beginning of the matching text property span.

If FORWARD-ONLY is non-nil, only search forward from point.

If GOTO is non-nil, move point to the beginning of that span instead.

If END is non-nil, use the end of the span instead.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-util.el.gz
(defun gnus-text-property-search (prop value &optional forward-only goto end)
  "Search current buffer for text property PROP with VALUE.
Behaves like a combination of `text-property-any' and
`text-property-search-forward'.  Searches for the beginning of a
text property `equal' to VALUE.  Returns the value of point at
the beginning of the matching text property span.

If FORWARD-ONLY is non-nil, only search forward from point.

If GOTO is non-nil, move point to the beginning of that span
instead.

If END is non-nil, use the end of the span instead."
  (let* ((start (point))
	 (found (progn
		  (unless forward-only
		    (goto-char (point-min)))
		  (text-property-search-forward
		   prop value #'equal)))
	 (target (when found
		   (if end
		       (prop-match-end found)
		     (prop-match-beginning found)))))
    (when target
      (if goto
	  (goto-char target)
	(prog1
	    target
	  (goto-char start))))))