From 6dcaafff3e8ef56e88bd25945cabe331c33b6097 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 22 Dec 2014 00:09:08 +0100 Subject: [PATCH] Tiny refactoring * lisp/org.el (org-current-level): Tiny refactoring. --- lisp/org.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 6f8e4122a..56506d6b8 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -8084,10 +8084,8 @@ in the region." (defun org-current-level () "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." - (save-excursion - (org-with-limited-levels - (if (ignore-errors (org-back-to-heading t)) - (funcall outline-level))))) + (let ((level (org-with-limited-levels (org-outline-level)))) + (and (> level 0) level))) (defun org-get-previous-line-level () "Return the outline depth of the last headline before the current line. -- 2.11.4.GIT