From 89caeaa34fb2e76626954226e51f29590ecaba91 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 11 Oct 2010 08:25:53 +0200 Subject: [PATCH 2/2] inlinetask: Make `org-inlinetask-min-level' an integer instead of a boolean. * org-footnote.el (org-footnote-normalize): Remove unnecessary check for org-inlinetask-min-level. * org-inlinetask.el (org-inlinetask-min-level): Variable is now of type integer. * org-inlinetask.el (org-inlinetask-in-task-p): Remove unnecessary check for org-inlinetask-min-level. * org-inlinetask.el (org-inlinetask-export-handler): Remove unnecessary check for org-inlinetask-min-level. * org-inlinetask.el (org-inlinetask-fontify): Remove unnecessary check for org-inlinetask-min-level. --- lisp/org-footnote.el | 1 - lisp/org-inlinetask.el | 14 +++++++------- lisp/org.el | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 36fcfb2..55c7665 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -358,7 +358,6 @@ referenced sequence." ;; This is based on Paul's function, but rewritten. (let* ((limit-level (and (boundp 'org-inlinetask-min-level) - org-inlinetask-min-level (1- org-inlinetask-min-level))) (nstars (and limit-level (if org-odd-levels-only diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index e18dce8..54b997e 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -90,7 +90,7 @@ or to a number smaller than this one. In fact, when `org-cycle-max-level' is not set, it will be assumed to be one less than the value of smaller than the value of this variable." :group 'org-inlinetask - :type 'boolean) + :type 'integer) (defcustom org-inlinetask-export t "Non-nil means export inline tasks. @@ -133,8 +133,8 @@ If prefix arg NO-STATE is set, ignore `org-inlinetask-defaut-state'." "Return true if point is inside an inline task." (save-excursion (let* ((nstars (if org-odd-levels-only - (1- (* 2 (or org-inlinetask-min-level 200))) - (or org-inlinetask-min-level 200))) + (1- (* 2 org-inlinetask-min-level)) + org-inlinetask-min-level)) (stars-re (concat "^\\(?:\\*\\{" (format "%d" (- nstars 1)) ",\\}\\)[ \t]+")) @@ -152,8 +152,8 @@ If prefix arg NO-STATE is set, ignore `org-inlinetask-defaut-state'." Either remove headline and meta data, or do special formatting." (goto-char (point-min)) (let* ((nstars (if org-odd-levels-only - (1- (* 2 (or org-inlinetask-min-level 200))) - (or org-inlinetask-min-level 200))) + (1- (* 2 org-inlinetask-min-level)) + org-inlinetask-min-level)) (re1 (format "^\\(\\*\\{%d,\\}\\) .*\n" nstars)) (re2 (concat "^[ \t]*" org-keyword-time-regexp)) headline beg end stars content indent) @@ -226,8 +226,8 @@ Either remove headline and meta data, or do special formatting." (defun org-inlinetask-fontify (limit) "Fontify the inline tasks." (let* ((nstars (if org-odd-levels-only - (1- (* 2 (or org-inlinetask-min-level 200))) - (or org-inlinetask-min-level 200))) + (1- (* 2 org-inlinetask-min-level)) + org-inlinetask-min-level)) (re (concat "^\\(\\*\\)\\(\\*\\{" (format "%d" (- nstars 3)) ",\\}\\)\\(\\*\\* .*\\)"))) diff --git a/lisp/org.el b/lisp/org.el index d9e26e9..b6805cc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5768,7 +5768,6 @@ in special contexts. (let* ((limit-level (or org-cycle-max-level (and (boundp 'org-inlinetask-min-level) - org-inlinetask-min-level (1- org-inlinetask-min-level)))) (nstars (and limit-level (if org-odd-levels-only -- 1.7.3.1