diff --git a/lisp/org-macs.el b/lisp/org-macs.el index fcf4e9b28..a02f713ca 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -645,6 +645,25 @@ The number of levels is controlled by `org-inlinetask-min-level'." limit-level))) (format "\\*\\{1,%d\\} " nstars))))) +(defun org--line-empty-p (n) + "Is the Nth next line empty? +Counts the current line as N = 1 and the previous line as N = 0; +see `beginning-of-line'." + (and (not (bobp)) + (save-excursion + (beginning-of-line n) + (looking-at-p "[ \t]*$")))) + +(defun org-previous-line-empty-p () + "Is the previous line a blank line? +When NEXT is non-nil, check the next line instead." + (org--line-empty-p 0)) + +(defun org-next-line-empty-p () + "Is the previous line a blank line? +When NEXT is non-nil, check the next line instead." + (org--line-empty-p 2)) + ;;; Motion diff --git a/lisp/org.el b/lisp/org.el index 25c01b1c9..e82463046 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6804,27 +6804,6 @@ frame is not changed." ;;; Inserting headlines -(defun org--line-empty-p (n) - "Is the Nth next line empty? - -Counts the current line as N = 1 and the previous line as N = 0; -see `beginning-of-line'." - (save-excursion - (and (not (bobp)) - (or (beginning-of-line n) t) - (save-match-data - (looking-at "[ \t]*$"))))) - -(defun org-previous-line-empty-p () - "Is the previous line a blank line? -When NEXT is non-nil, check the next line instead." - (org--line-empty-p 0)) - -(defun org-next-line-empty-p () - "Is the previous line a blank line? -When NEXT is non-nil, check the next line instead." - (org--line-empty-p 2)) - (defun org--blank-before-heading-p (&optional parent) "Non-nil when an empty line should precede a new heading here. When optional argument PARENT is non-nil, consider parent