Tiny refactoring
* lisp/org.el (org-current-level): Tiny refactoring.
This commit is contained in:
parent
c5ba48072c
commit
6dcaafff3e
|
@ -8084,10 +8084,8 @@ in the region."
|
||||||
(defun org-current-level ()
|
(defun org-current-level ()
|
||||||
"Return the level of the current entry, or nil if before the first headline.
|
"Return the level of the current entry, or nil if before the first headline.
|
||||||
The level is the number of stars at the beginning of the headline."
|
The level is the number of stars at the beginning of the headline."
|
||||||
(save-excursion
|
(let ((level (org-with-limited-levels (org-outline-level))))
|
||||||
(org-with-limited-levels
|
(and (> level 0) level)))
|
||||||
(if (ignore-errors (org-back-to-heading t))
|
|
||||||
(funcall outline-level)))))
|
|
||||||
|
|
||||||
(defun org-get-previous-line-level ()
|
(defun org-get-previous-line-level ()
|
||||||
"Return the outline depth of the last headline before the current line.
|
"Return the outline depth of the last headline before the current line.
|
||||||
|
|
Loading…
Reference in New Issue