Move some functions in "org-macs.el"

* lisp/org.el (org--line-empty-p):
(org-previous-line-empty-p):
(org-next-line-empty-p): Move these functions...
* lisp/org-macs.el: ... here.
This commit is contained in:
Nicolas Goaziou 2020-04-30 11:18:11 +02:00
parent 90cf5009cb
commit 1e1328b41c
2 changed files with 19 additions and 21 deletions

View File

@ -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

View File

@ -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