summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-01-10 11:25:15 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-01-10 11:25:15 +0100
commitf5380d122146a99bd497b8ae235382c21d0f8e3e (patch)
treeaa9325dad45cf92d952322bc46772cf17a475e0b
parentfcdf05b141adcd835bd687db3b1531fc81c4f390 (diff)
parent8720c4980724229545755b08fbac1724cd2e74be (diff)
downloadorg-mode-f5380d122146a99bd497b8ae235382c21d0f8e3e.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el12
1 files changed, 4 insertions, 8 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 64b0070..74b0387 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7970,14 +7970,10 @@ The level is the number of stars at the beginning of the headline."
"Return the outline depth of the last headline before the current line.
Returns 0 for the first headline in the buffer, and nil if before the
first headline."
- (let ((current-level (org-current-level))
- (prev-level (when (> (line-number-at-pos) 1)
- (save-excursion
- (beginning-of-line 0)
- (org-current-level)))))
- (cond ((null current-level) nil) ; Before first headline
- ((null prev-level) 0) ; At first headline
- (prev-level))))
+ (and (org-current-level)
+ (or (and (/= (line-beginning-position) (point-min))
+ (save-excursion (beginning-of-line 0) (org-current-level)))
+ 0)))
(defun org-reduced-level (l)
"Compute the effective level of a heading.