Function: org-refresh-property

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

Signature

(org-refresh-property TPROP P &optional INHERIT)

Documentation

Refresh the buffer text property TPROP from the drawer property P.

The refresh happens only for the current entry, or the whole sub-tree if optional argument INHERIT is non-nil.

If point is before first headline, the function applies to the part before the first headline. In that particular case, when optional argument INHERIT is non-nil, it refreshes properties for the whole buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-refresh-property (tprop p &optional inherit)
  "Refresh the buffer text property TPROP from the drawer property P.

The refresh happens only for the current entry, or the whole
sub-tree if optional argument INHERIT is non-nil.

If point is before first headline, the function applies to the
part before the first headline.  In that particular case, when
optional argument INHERIT is non-nil, it refreshes properties for
the whole buffer."
  (save-excursion
    (org-back-to-heading-or-point-min t)
    (let ((start (point))
	  (end (save-excursion
		 (cond ((and inherit (org-before-first-heading-p))
			(point-max))
		       (inherit
			(org-end-of-subtree t t))
		       ((outline-next-heading))
		       ((point-max))))))
      (with-silent-modifications
	(if (symbolp tprop)
	    ;; TPROP is a text property symbol.
	    (put-text-property start end tprop p)
	  ;; TPROP is an alist with (property . function) elements.
	  (pcase-dolist (`(,prop . ,f) tprop)
	    (put-text-property start end prop (funcall f p))))))))