summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-08-15 09:51:44 +0200
committerBastien Guerry <bzg@altern.org>2011-08-15 09:51:44 +0200
commitc6bee1143345f7f3d7427731c474aecf32953ad9 (patch)
tree7dcf28972fecaf15cc357ab396919febad1d7ebf
parentbc1b688ff06a94f343f6d7545f2d5551ec721afe (diff)
downloadorg-mode-c6bee1143345f7f3d7427731c474aecf32953ad9.tar.gz
Use outline-regexp in org-overview so that global cycling works outside of Org buffers.
* org.el (org-overview): Use outline-regexp instead of org-outline-regexp so that global cycling using orgstruct-mode works outside of Org buffers. Thanks to Matt Lundin for this fix.
-rw-r--r--lisp/org.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 71c14b6..f40f46c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6227,6 +6227,9 @@ With a numeric prefix, show all headlines up to that level."
(org-cycle-hide-drawers 'all)
(org-cycle-show-empty-lines 'all)))))
+;; This function uses outline-regexp instead of the more fundamental
+;; org-outline-regexp so that org-cycle-global works outside of Org
+;; buffers, where outline-regexp is needed.
(defun org-overview ()
"Switch to overview mode, showing only top-level headlines.
Really, this shows all headlines with level equal or greater than the level
@@ -6236,7 +6239,7 @@ results."
(interactive)
(let ((level (save-excursion
(goto-char (point-min))
- (if (re-search-forward org-outline-regexp-bol nil t)
+ (if (re-search-forward (concat "^" outline-regexp) nil t)
(progn
(goto-char (match-beginning 0))
(funcall outline-level))))))