Browse Source

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.
Bastien Guerry 8 years ago
1 changed files with 4 additions and 1 deletions
  1. 4 1

+ 4 - 1

@@ -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."
   (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)
 		       (goto-char (match-beginning 0))
 		       (funcall outline-level))))))