Function: c-search-forward-non-nil-char-property

c-search-forward-non-nil-char-property is a macro defined in cc-defs.el.gz.

Signature

(c-search-forward-non-nil-char-property PROPERTY &optional LIMIT)

Documentation

Search forward for a text-property PROPERTY value non-nil.

LIMIT bounds the search.

Leave point just after the character. The match data remain unchanged. Return the value of PROPERTY. If a non-nil value isn't found, return nil; point is then left undefined.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defmacro c-search-forward-non-nil-char-property (property &optional limit)
  "Search forward for a text-property PROPERTY value non-nil.
LIMIT bounds the search.

Leave point just after the character.  The match data remain
unchanged.  Return the value of PROPERTY.  If a non-nil value
isn't found, return nil; point is then left undefined."
  (declare (debug t))
  `(let* ((-limit- (or ,limit (point-max)))
	  (value (c-get-char-property (point) ,property)))
     (cond
      ((>= (point) -limit-)
       nil)
      (value
       (forward-char)
       value)
      (t (let ((place (c-next-single-property-change
		       (point) ,property nil -limit-)))
	   (when (and place
		      (< place -limit-))
	     (goto-char (1+ place))
	     (c-get-char-property place ,property)))))))