forked from mirrors/org-mode
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:
parent
90cf5009cb
commit
1e1328b41c
|
@ -645,6 +645,25 @@ The number of levels is controlled by `org-inlinetask-min-level'."
|
||||||
limit-level)))
|
limit-level)))
|
||||||
(format "\\*\\{1,%d\\} " nstars)))))
|
(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
|
;;; Motion
|
||||||
|
|
21
lisp/org.el
21
lisp/org.el
|
@ -6804,27 +6804,6 @@ frame is not changed."
|
||||||
|
|
||||||
;;; Inserting headlines
|
;;; 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)
|
(defun org--blank-before-heading-p (&optional parent)
|
||||||
"Non-nil when an empty line should precede a new heading here.
|
"Non-nil when an empty line should precede a new heading here.
|
||||||
When optional argument PARENT is non-nil, consider parent
|
When optional argument PARENT is non-nil, consider parent
|
||||||
|
|
Loading…
Reference in New Issue