summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-03-02 21:56:02 +0000
committerBastien Guerry <bzg@altern.org>2011-03-06 09:29:16 +0100
commit1e59039f8cf93830f930f7dc99117c41586552e9 (patch)
treee6b7773f31ccf25d87f6a108237e2e98d44c47e8
parentdf7f2bf3d96517eaf3a94f5615e2141b38529121 (diff)
downloadorg-mode-1e59039f8cf93830f930f7dc99117c41586552e9.tar.gz
Fix bug when narrowing to subtree with point at an inline task
* lisp/org.el (org-narrow-to-subtree): ensure `org-back-to-heading' will move point to a real heading and not an inline task by wraping function into a org-with-limited-levels macro.
-rw-r--r--lisp/org.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index e37bbba..60e88f6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7579,11 +7579,12 @@ If yes, remember the marker and the distance to BEG."
(interactive)
(save-excursion
(save-match-data
- (narrow-to-region
- (progn (org-back-to-heading t) (point))
- (progn (org-end-of-subtree t t)
- (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
- (point))))))
+ (org-with-limited-levels
+ (narrow-to-region
+ (progn (org-back-to-heading t) (point))
+ (progn (org-end-of-subtree t t)
+ (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
+ (point)))))))
(defun org-narrow-to-block ()
"Narrow buffer to the current block."