Function: org-find-property

org-find-property is a byte-compiled function defined in org.el.gz.

Signature

(org-find-property PROPERTY &optional VALUE)

Documentation

Find first entry in buffer that sets PROPERTY.

When optional argument VALUE is non-nil, only consider an entry if it contains PROPERTY set to this value. If PROPERTY should be explicitly set to nil, use string "nil" for VALUE.

Return position where the entry begins, or nil if there is no such entry. If narrowing is in effect, only search the visible part of the buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-find-property (property &optional value)
  "Find first entry in buffer that sets PROPERTY.

When optional argument VALUE is non-nil, only consider an entry
if it contains PROPERTY set to this value.  If PROPERTY should be
explicitly set to nil, use string \"nil\" for VALUE.

Return position where the entry begins, or nil if there is no
such entry.  If narrowing is in effect, only search the visible
part of the buffer."
  (save-excursion
    (goto-char (point-min))
    (let ((case-fold-search t)
	  (re (org-re-property property nil (not value) value)))
      (catch 'exit
	(while (re-search-forward re nil t)
	  (when (if value (org-at-property-p)
		  (org-entry-get (point) property nil t))
	    (throw 'exit (progn (org-back-to-heading-or-point-min t)
				(point)))))))))