summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Richard <theonewiththeevillook@yahoo.fr>2014-07-22 18:29:00 +0200
committerBastien Guerry <bzg@altern.org>2014-07-28 16:14:39 +0200
commit3d7a9f85177c203c59636aa4b30686204cf6136c (patch)
tree53d84c161cbe1834835032b99f1c713de23d1b07
parent2cd70ef91599102cfc63dded424dd82ad61e9417 (diff)
downloadorg-mode-3d7a9f85177c203c59636aa4b30686204cf6136c.tar.gz
Make org-get-limited-outline-regexp usable outside of org.
This allows org-narrow-to-subtree to function in Outline mode. * lisp/org-macs.el (org-get-limited-outline-regexp): Use outline-regexp instead of org-outline-regexp when not in Org mode.
-rw-r--r--lisp/org-macs.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 96265ec..78174df 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -352,11 +352,16 @@ point nowhere."
(defun org-get-limited-outline-regexp ()
"Return outline-regexp with limited number of levels.
The number of levels is controlled by `org-inlinetask-min-level'"
- (if (or (not (derived-mode-p 'org-mode)) (not (featurep 'org-inlinetask)))
- org-outline-regexp
- (let* ((limit-level (1- org-inlinetask-min-level))
- (nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
- (format "\\*\\{1,%d\\} " nstars))))
+ (cond ((not (derived-mode-p 'org-mode))
+ outline-regexp)
+ ((not (featurep 'org-inlinetask))
+ org-outline-regexp)
+ (t
+ (let* ((limit-level (1- org-inlinetask-min-level))
+ (nstars (if org-odd-levels-only
+ (1- (* limit-level 2))
+ limit-level)))
+ (format "\\*\\{1,%d\\} " nstars)))))
(defun org-format-seconds (string seconds)
"Compatibility function replacing format-seconds."