diff options
author | Dan Davison <dandavison7@gmail.com> | 2010-12-21 11:06:24 +0000 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2010-12-21 11:06:24 +0000 |
commit | fc70272de99d5e50623a3d26cd8881b209a96d8e (patch) | |
tree | d4e079bcc7eff78ad5269c28302e2753b6d8d285 | |
parent | 607efd4e30f3c55d471a07847b7d68986852406b (diff) | |
parent | d30d00023ac89c3268d9d3f768eb08151e5e8962 (diff) | |
download | org-mode-fc70272de99d5e50623a3d26cd8881b209a96d8e.tar.gz |
Merge branch 'master' of ssh://repo.or.cz/srv/git/org-mode
-rw-r--r-- | contrib/lisp/org-collector.el | 32 | ||||
-rw-r--r-- | lisp/org-agenda.el | 2 | ||||
-rw-r--r-- | lisp/org-inlinetask.el | 61 |
3 files changed, 37 insertions, 58 deletions
diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el index 1d4f042..d84c3ee 100644 --- a/contrib/lisp/org-collector.el +++ b/contrib/lisp/org-collector.el @@ -109,36 +109,6 @@ a column, or through the generation of an error.") 'error-conditions '(error column-prop-error org-collector-error)) -(defun org-read-prop (prop) - "Convert the string property PROP to a number if appropriate. -If prop looks like a list (meaning it starts with a '(') then -read it as lisp expression, otherwise return it unmodified as a -string. - -Results of calling: -\(org-read-prop \"12\") -> 12 -\(org-read-prop \"(1 2 3)\") -> (1 2 3) -\(org-read-prop \"+0\") -> 0 -\(org-read-prop \"aaa\") -> \"aaa\"" - (if (and (stringp prop) (not (equal prop ""))) - (let ((out (string-to-number prop))) - (if (equal out 0) - (cond - ((or - (equal "(" (substring prop 0 1)) - (equal "'" (substring prop 0 1))) - - (condition-case nil - (read prop) - (error prop))) - ((string-match "^\\(+0\\|-0\\|0\\)$" prop) - 0) - (t - (set-text-properties 0 (length prop) nil prop) - prop)) - out)) - prop)) - (defun org-dblock-write:propview (params) "collect the column specification from the #+cols line preceeding the dblock, then update the contents of the dblock." @@ -195,7 +165,7 @@ variables and values specified in props" match scope))) ;; read property values (header-props (mapcar (lambda (props) - (mapcar (lambda (pair) (cons (car pair) (org-read-prop (cdr pair)))) + (mapcar (lambda (pair) (cons (car pair) (org-babel-read (cdr pair)))) props)) header-props)) ;; collect all property names diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index f32c60e..1cdaaa0 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1316,7 +1316,7 @@ This format works similar to a printf format, with the following meaning: %t the time-of-day specification if one applies to the entry, in the format HH:MM %s Scheduling/Deadline information, a short string - %(expression) Eval expression and replaces the control string + %(expression) Eval EXPRESSION and replace the control string by the result All specifiers work basically like the standard `%s' of printf, but may diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 3f2d6fb..eb1cfb7 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -52,14 +52,18 @@ ;; An inline task is identified solely by a minimum outline level, given ;; by the variable `org-inlinetask-min-level', default 15. ;; -;; Inline tasks are normally assumed to contain at most a time planning -;; line (DEADLINE etc) after it, and then any number of drawers, for -;; example LOGBOOK of PROPERTIES. No empty lines are allowed. -;; If you need to have normal text as part of an inline task, you -;; can do so by adding an "END" headline with the same number of stars, -;; for example +;; If you need to have a time planning line (DEADLINE etc), drawers, +;; for example LOGBOOK of PROPERTIES, or even normal text as part of +;; the inline task, you must add an "END" headline with the same +;; number of stars. ;; -;; **************** TODO some small task +;; As an example, here are two valid inline tasks: +;; +;; **************** TODO a small task +;; +;; and +;; +;; **************** TODO another small task ;; DEADLINE: <2009-03-30 Mon> ;; :PROPERTIES: ;; :SOMETHING: or other @@ -196,35 +200,40 @@ The number of levels is controlled by `org-inlinetask-min-level'." (defun org-inlinetask-in-task-p () "Return true if point is inside an inline task." (save-excursion - (let* ((stars-re (org-inlinetask-outline-regexp)) + (beginning-of-line) + (let* ((case-fold-search t) + (stars-re (org-inlinetask-outline-regexp)) (task-beg-re (concat stars-re "\\(?:.*\\)")) - (task-end-re (concat stars-re "\\(?:END\\|end\\)[ \t]*$"))) - (beginning-of-line) - (or (looking-at task-beg-re) + (task-end-re (concat stars-re "END[ \t]*$"))) + (or (org-looking-at-p task-beg-re) (and (re-search-forward "^\\*+[ \t]+" nil t) - (progn (beginning-of-line) (looking-at task-end-re))))))) + (progn (beginning-of-line) (org-looking-at-p task-end-re))))))) (defun org-inlinetask-goto-beginning () "Go to the beginning of the inline task at point." (end-of-line) - (re-search-backward (org-inlinetask-outline-regexp) nil t) - (when (org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$")) - (re-search-backward (org-inlinetask-outline-regexp) nil t))) + (let ((case-fold-search t) + (inlinetask-re (org-inlinetask-outline-regexp))) + (re-search-backward inlinetask-re nil t) + (when (org-looking-at-p (concat inlinetask-re "END[ \t]*$")) + (re-search-backward inlinetask-re nil t)))) (defun org-inlinetask-goto-end () "Go to the end of the inline task at point." (beginning-of-line) - (cond - ((org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$")) - (forward-line 1)) - ((org-looking-at-p (org-inlinetask-outline-regexp)) - (forward-line 1) - (when (org-inlinetask-in-task-p) - (re-search-forward (org-inlinetask-outline-regexp) nil t) - (forward-line 1))) - (t - (re-search-forward (org-inlinetask-outline-regexp) nil t) - (forward-line 1)))) + (let ((case-fold-search t) + (inlinetask-re (org-inlinetask-outline-regexp))) + (cond + ((org-looking-at-p (concat inlinetask-re "END[ \t]*$")) + (forward-line 1)) + ((org-looking-at-p inlinetask-re) + (forward-line 1) + (when (org-inlinetask-in-task-p) + (re-search-forward inlinetask-re nil t) + (forward-line 1))) + (t + (re-search-forward inlinetask-re nil t) + (forward-line 1))))) (defun org-inlinetask-get-task-level () "Get the level of the inline task around. |