emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-mobile newheading, delete, refile and archive edit nodes
@ 2012-04-07 15:54 Henning Weiss
  2012-04-09 10:50 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Weiss @ 2012-04-07 15:54 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 333 bytes --]

Hi!

I have attached a patch for org-mobile.el which adds four additional edit
nodes. They seem to work and adding and deleting has already been
implemented "client-side wise" in mobileorg-android.

The current versions could be improved by using the "old value" to compare
it to the current, as to prevent conflicts.

Henning Weiss

[-- Attachment #1.2: Type: text/html, Size: 427 bytes --]

[-- Attachment #2: org-mobile-edit-nodes.txt --]
[-- Type: text/plain, Size: 2118 bytes --]

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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] org-mobile newheading, delete, refile and archive edit nodes
  2012-04-07 15:54 [PATCH] org-mobile newheading, delete, refile and archive edit nodes Henning Weiss
@ 2012-04-09 10:50 ` Bastien
  2012-04-14 18:08   ` Henning Weiss
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2012-04-09 10:50 UTC (permalink / raw)
  To: Henning Weiss; +Cc: emacs-orgmode

Hi Henning,

Henning Weiss <hdweiss@gmail.com> writes:

> I have attached a patch for org-mobile.el which adds four additional
> edit nodes. They seem to work and adding and deleting has already
> been implemented "client-side wise" in mobileorg-android.

Thanks.

Can you rewrite the patch following instructions in 
  http://orgmode.org/worg/org-contribute.html#sec-4

?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] org-mobile newheading, delete, refile and archive edit nodes
  2012-04-09 10:50 ` Bastien
@ 2012-04-14 18:08   ` Henning Weiss
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Weiss @ 2012-04-14 18:08 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 557 bytes --]

Hi Bastien,

On Mon, Apr 9, 2012 at 12:50 PM, Bastien <bzg@gnu.org> wrote:

> Hi Henning,
>
> Henning Weiss <hdweiss@gmail.com> writes:
>
> > I have attached a patch for org-mobile.el which adds four additional
> > edit nodes. They seem to work and adding and deleting has already
> > been implemented "client-side wise" in mobileorg-android.
>
> Thanks.
>
> Can you rewrite the patch following instructions in
>  http://orgmode.org/worg/org-contribute.html#sec-4
>

I attached the same patch created by (hopefully) following the guidelines.

Henning Weiss

[-- Attachment #1.2: Type: text/html, Size: 1026 bytes --]

[-- Attachment #2: 0001-org-mobile-Added-4-new-edit-nodes.patch --]
[-- Type: application/octet-stream, Size: 2559 bytes --]

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-14 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-07 15:54 [PATCH] org-mobile newheading, delete, refile and archive edit nodes Henning Weiss
2012-04-09 10:50 ` Bastien
2012-04-14 18:08   ` Henning Weiss

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).