浏览代码

Merge branch 'master' of ssh://repo.or.cz/srv/git/org-mode

Dan Davison 15 年之前
父节点
当前提交
fc70272de9
共有 3 个文件被更改,包括 37 次插入58 次删除
  1. 1 31
      contrib/lisp/org-collector.el
  2. 1 1
      lisp/org-agenda.el
  3. 35 26
      lisp/org-inlinetask.el

+ 1 - 31
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

+ 1 - 1
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

+ 35 - 26
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.