Browse Source

Merge commit 'org/master' into ded-org-src

Dan Davison 15 years ago
parent
commit
6ab0d43e80
3 changed files with 81 additions and 73 deletions
  1. 4 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-exp.el
  3. 76 73
      lisp/org-mobile.el

+ 4 - 0
lisp/ChangeLog

@@ -1,3 +1,7 @@
+2009-10-15  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-exp.el (org-inlinetask-remove-END-maybe): Declare function.
+
 2009-10-14  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-10-14  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org-agenda.el (org-agenda-filter-make-matcher): Allow to filter
 	* org-agenda.el (org-agenda-filter-make-matcher): Allow to filter

+ 1 - 0
lisp/org-exp.el

@@ -40,6 +40,7 @@
 (declare-function org-infojs-options-inbuffer-template "org-jsinfo" ())
 (declare-function org-infojs-options-inbuffer-template "org-jsinfo" ())
 (declare-function org-export-htmlize-region-for-paste "org-html" (beg end))
 (declare-function org-export-htmlize-region-for-paste "org-html" (beg end))
 (declare-function htmlize-buffer "ext:htmlize" (&optional buffer))
 (declare-function htmlize-buffer "ext:htmlize" (&optional buffer))
+(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
 (autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
 (autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
 (defgroup org-export nil
 (defgroup org-export nil
   "Options for exporting org-listings."
   "Options for exporting org-listings."

+ 76 - 73
lisp/org-mobile.el

@@ -306,7 +306,8 @@ agenda view showing the flagged items."
       (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
       (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
       (insert "#+DRAWERS: " (mapconcat 'identity drawers " ") "\n")
       (insert "#+DRAWERS: " (mapconcat 'identity drawers " ") "\n")
       (insert "#+ALLPRIORITIES: A B C" "\n")
       (insert "#+ALLPRIORITIES: A B C" "\n")
-      (when (file-exists-p "agendas.org")
+      (when (file-exists-p (expand-file-name
+			    org-mobile-directory "agendas.org"))
 	(insert "* [[file:agendas.org][Agenda Views]]\n"))
 	(insert "* [[file:agendas.org][Agenda Views]]\n"))
       (while (setq entry (pop files-alist))
       (while (setq entry (pop files-alist))
 	(setq file (car entry)
 	(setq file (car entry)
@@ -739,79 +740,81 @@ and the command will return t.  If something goes wrong, a string will
 be returned that indicates what went wrong."
 be returned that indicates what went wrong."
   (let (current old1 new1)
   (let (current old1 new1)
     (if (stringp what) (setq what (intern what)))
     (if (stringp what) (setq what (intern what)))
-    (case what
-
-      ((todo todostate)
-       (setq current (org-get-todo-state))
-       (cond
-	((equal new "DONEARCHIVE")
-	 (org-todo 'done)
-	 (org-archive-subtree-default))
-	((equal new current) t) ; nothing needs to be done
-	((or (equal current old)
-	     (eq org-mobile-force-mobile-change t)
-	     (memq 'todo org-mobile-force-mobile-change))
-	 (org-todo new) t)
-	(t (error "State before change was expected as \"%s\", but is \"%s\""
-		   old current))))
+
+    (cond
+
+     ((memq what '(todo todostate))
+      (setq current (org-get-todo-state))
+      (cond
+       ((equal new "DONEARCHIVE")
+	(org-todo 'done)
+	(org-archive-subtree-default))
+       ((equal new current) t) ; nothing needs to be done
+       ((or (equal current old)
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'todo org-mobile-force-mobile-change))
+	(org-todo new) t)
+       (t (error "State before change was expected as \"%s\", but is \"%s\""
+		 old current))))
       
       
-      (tags
-       (setq current (org-get-tags)
-	     new1 (and new (org-split-string new ":+"))
-	     old1 (and old (org-split-string old ":+")))
-       (cond
-	((org-mobile-tags-same-p current new1) t) ; no change needed
-	((or (org-mobile-tags-same-p current old1)
-	     (eq org-mobile-force-mobile-change t)
-	     (memq 'tags org-mobile-force-mobile-change))
-	 (org-set-tags-to new1) t)
-	(t (error "State before change was expected as \"%s\", but is \"%s\""
-		  (or old "") (or current "")))))
-
-      (priority
-       (when (looking-at org-complex-heading-regexp)
-	 (setq current (and (match-end 3) (substring (match-string 3) 2 3)))
-	 (cond
-	  ((equal current new) t) ; no action required
-	  ((or (equal current old)
-	       (eq org-mobile-force-mobile-change t)
-	       (memq 'tags org-mobile-force-mobile-change))
-	   (org-priority (and new (string-to-char new))))
-	  (t (error "Priority was expected to be %s, but is %s"
-		    old current)))))
-      (heading
-       (when (looking-at org-complex-heading-regexp)
-	 (setq current (match-string 4))
-	 (cond
-	  ((equal current new) t) ; no action required
-	  ((or (equal current old)
-	       (eq org-mobile-force-mobile-change t)
-	       (memq 'heading org-mobile-force-mobile-change))
-	   (goto-char (match-beginning 4))
-	   (insert new)
-	   (delete-region (point) (+ (point) (length current)))
-	   (org-set-tags nil 'align))
-	  (t (error "Heading changed in MobileOrg and on the computer")))))
-
-      (body
-       (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
-				       (save-excursion (outline-next-heading)
-						       (point))))
-       (if (not (string-match "\\S-" current)) (setq current nil))
-       (cond
-	((org-mobile-bodies-same-p current new) t) ; no ation necesary
-	((or (org-mobile-bodies-same-p current old)
-	     (eq org-mobile-force-mobile-change t)
-	     (memq 'body org-mobile-force-mobile-change))
-	 (save-excursion
-	   (end-of-line 1)
-	   (insert "\n" new)
-	   (or (bolp) (insert "\n"))
-	   (delete-region (point) (progn (org-back-to-heading t)
-					 (outline-next-heading)
-					 (point))))
-	 t)
-	(t (error "Body was changed in MobileOrg and on the computer")))))))
+     ((eq what 'tags)
+      (setq current (org-get-tags)
+	    new1 (and new (org-split-string new ":+"))
+	    old1 (and old (org-split-string old ":+")))
+      (cond
+       ((org-mobile-tags-same-p current new1) t) ; no change needed
+       ((or (org-mobile-tags-same-p current old1)
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'tags org-mobile-force-mobile-change))
+	(org-set-tags-to new1) t)
+       (t (error "Tags before change were expected as \"%s\", but are \"%s\""
+		 (or old "") (or current "")))))
+     
+     ((eq what 'priority)
+      (when (looking-at org-complex-heading-regexp)
+	(setq current (and (match-end 3) (substring (match-string 3) 2 3)))
+	(cond
+	 ((equal current new) t) ; no action required
+	 ((or (equal current old)
+	      (eq org-mobile-force-mobile-change t)
+	      (memq 'tags org-mobile-force-mobile-change))
+	  (org-priority (and new (string-to-char new))))
+	 (t (error "Priority was expected to be %s, but is %s"
+		   old current)))))
+
+     ((eq what 'heading)
+      (when (looking-at org-complex-heading-regexp)
+	(setq current (match-string 4))
+	(cond
+	 ((equal current new) t) ; no action required
+	 ((or (equal current old)
+	      (eq org-mobile-force-mobile-change t)
+	      (memq 'heading org-mobile-force-mobile-change))
+	  (goto-char (match-beginning 4))
+	  (insert new)
+	  (delete-region (point) (+ (point) (length current)))
+	  (org-set-tags nil 'align))
+	 (t (error "Heading changed in MobileOrg and on the computer")))))
+     
+     ((eq what 'body)
+      (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
+				      (save-excursion (outline-next-heading)
+						      (point))))
+      (if (not (string-match "\\S-" current)) (setq current nil))
+      (cond
+       ((org-mobile-bodies-same-p current new) t) ; no ation necesary
+       ((or (org-mobile-bodies-same-p current old)
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'body org-mobile-force-mobile-change))
+	(save-excursion
+	  (end-of-line 1)
+	  (insert "\n" new)
+	  (or (bolp) (insert "\n"))
+	  (delete-region (point) (progn (org-back-to-heading t)
+					(outline-next-heading)
+					(point))))
+	t)
+       (t (error "Body was changed in MobileOrg and on the computer")))))))
        
        
 
 
 (defun org-mobile-tags-same-p (list1 list2)
 (defun org-mobile-tags-same-p (list1 list2)