`org-outline-level' ignores narrowing

* lisp/org.el (org-outline-level): Ignore narrowing.  Refactor to be
  slightly faster.
This commit is contained in:
Nicolas Goaziou 2014-12-21 22:14:26 +01:00
parent 077a24b8d0
commit 4a214a0647
1 changed files with 5 additions and 5 deletions

View File

@ -6238,11 +6238,11 @@ done, nil otherwise."
"Compute the outline level of the heading at point. "Compute the outline level of the heading at point.
If this is called at a normal headline, the level is the number of stars. If this is called at a normal headline, the level is the number of stars.
Use `org-reduced-level' to remove the effect of `org-odd-levels'." Use `org-reduced-level' to remove the effect of `org-odd-levels'."
(save-excursion (org-with-wide-buffer
(if (not (ignore-errors (org-back-to-heading t))) (end-of-line)
0 (if (re-search-backward org-outline-regexp-bol nil t)
(looking-at org-outline-regexp) (1- (- (match-end 0) (match-beginning 0)))
(1- (- (match-end 0) (match-beginning 0)))))) 0)))
(defvar org-font-lock-keywords nil) (defvar org-font-lock-keywords nil)