From 08c62eb070846865f1a292dbaa9b8090fec73f62 Mon Sep 17 00:00:00 2001
From: Henning Weiss <hdweiss@gmail.com>
Date: Sun, 11 Mar 2012 00:23:23 +0100
Subject: [PATCH] org-mobile: Added 4 new edit nodes

* lisp/org-mobile.el (org-mobile-edit): Added newheading, refile, archive and delete edit nodes.

TINYCHANGE
---
 lisp/org-mobile.el |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 3bd9a7c..60d0659 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -1062,6 +1062,57 @@ be returned that indicates what went wrong."
 	  (org-set-tags nil 'align))
 	 (t (error "Heading changed in MobileOrg and on the computer")))))
 
+     ((eq what 'newheading)
+      (cond
+       ((or t ; maybe check new for validity instead?
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'tags org-mobile-force-mobile-change))
+        (save-excursion
+	  (end-of-line 1)
+	  (org-insert-heading-respect-content)
+	  (org-demote)
+          (insert new)))
+       (t (error "New heading could not be created"))))
+
+     ((eq what 'delete)
+      (setq current (buffer-substring (point-at-bol) (save-excursion
+						       (org-goto-sibling)
+						       (point-at-bol))))
+      (cond
+       ((or t ; do check here
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'tags org-mobile-force-mobile-change))
+	(beginning-of-line 1)
+	(delete-region (point-at-bol)
+		       (save-excursion (org-goto-sibling)
+				       (point-at-bol))))
+       (t (error "Could not delete heading"))))
+
+     ((eq what 'archive)
+      (setq current (buffer-substring (point-at-bol) (save-excursion
+						       (org-goto-sibling)
+						       (point-at-bol))))
+      (cond
+       ((or t ; do check here
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'tags org-mobile-force-mobile-change))
+	(beginning-of-line 1)
+	(org-archive-to-archive-sibling))
+       (t (error "Could not archive heading"))))
+
+     ((eq what 'refile)
+      (setq current (buffer-substring (point-at-bol) (save-excursion
+						       (org-goto-sibling)
+						       (point-at-bol))))
+      (cond
+       ((or t ; do check here
+	    (eq org-mobile-force-mobile-change t)
+	    (memq 'tags org-mobile-force-mobile-change))
+	(beginning-of-line 1)
+	(org-refile))
+       (t (error "Could not refile heading"))))
+
+
      ((eq what 'body)
       (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
 				      (save-excursion (outline-next-heading)
-- 
1.7.10

