Function: org-fold--extend-changed-region

org-fold--extend-changed-region is a byte-compiled function defined in org-fold.el.gz.

Signature

(org-fold--extend-changed-region FROM TO)

Documentation

Consider folded regions in the next/previous line when fixing region visibility. This function is intended to be used as a member of org-fold-core-extend-changed-region-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-fold.el.gz
;;; Handling changes in folded elements

(defun org-fold--extend-changed-region (from to)
  "Consider folded regions in the next/previous line when fixing
region visibility.
This function is intended to be used as a member of
`org-fold-core-extend-changed-region-functions'."
  ;; If the edit is done in the first line of a folded drawer/block,
  ;; the folded text is only starting from the next line and needs to
  ;; be checked.
  (setq to (save-excursion (goto-char to) (line-beginning-position 2)))
  ;; If the ":END:" line of the drawer is deleted, the folded text is
  ;; only ending at the previous line and needs to be checked.
  (setq from (save-excursion (goto-char from) (line-beginning-position 0)))
  (cons from to))