Function: org-indent-refresh-maybe
org-indent-refresh-maybe is a byte-compiled function defined in
org-indent.el.gz.
Signature
(org-indent-refresh-maybe BEG END _)
Documentation
Refresh indentation properties in an adequate portion of buffer.
BEG and END are the positions of the beginning and end of the range of inserted text. DUMMY is an unused argument.
This function is meant to be called by after-change-functions.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-indent.el.gz
(defun org-indent-refresh-maybe (beg end _)
"Refresh indentation properties in an adequate portion of buffer.
BEG and END are the positions of the beginning and end of the
range of inserted text. DUMMY is an unused argument.
This function is meant to be called by `after-change-functions'."
(when org-indent-mode
(save-match-data
;; If a headline was modified or inserted, set properties until
;; next headline.
(org-with-wide-buffer
(if (or org-indent-modified-headline-flag
(save-excursion
(goto-char beg)
(forward-line 0)
(re-search-forward
(org-with-limited-levels org-outline-regexp-bol)
(save-excursion
(goto-char end)
;; Extend to headline if END is within its
;; headline stars.
(line-end-position))
t)))
(let ((end (save-excursion
(goto-char end)
(org-with-limited-levels (outline-next-heading))
(point))))
(setq org-indent-modified-headline-flag nil)
(org-indent-add-properties beg end))
;; Otherwise, only set properties on modified area.
(org-indent-add-properties beg end))))))