From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: [PATCH] org-mobile.el: Skip and elements Date: Sun, 11 Aug 2013 04:11:27 +0200 Message-ID: <20130811021127.GB30350@kenny.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8L89-0007Er-Ck for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8L80-0003hJ-PJ for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:11:41 -0400 Received: from mail-ee0-x233.google.com ([2a00:1450:4013:c00::233]:48299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8L80-0003hD-I1 for emacs-orgmode@gnu.org; Sat, 10 Aug 2013 22:11:32 -0400 Received: by mail-ee0-f51.google.com with SMTP id c1so2854446eek.10 for ; Sat, 10 Aug 2013 19:11:31 -0700 (PDT) Received: from kenny.local (e179175132.adsl.alicedsl.de. [85.179.175.132]) by mx.google.com with ESMTPSA id d8sm30575491eeh.8.2013.08.10.19.11.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 19:11:31 -0700 (PDT) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * org-mobile.el (org-mobile-add-after): Variable to turn off printing of information inside element. (org-mobile-add-before): Variable to turn off printing of information inside element. (org-mobile-sumo-agenda-command): Optionally skip printing of information inside element. (org-mobile-write-agenda-for-mobile): Optionally skip printing of information inside element. The MobileOrg push command adds some information inside an element on the heading, e.g., the agenda key and name, and inside a element in the body, e.g., the category and time information. This patch adds the ability to disable this behavior. It is not very sophisticated; a better way would be to support custom layouts of the data shown in MobileOrg. TINYCHANGE --- lisp/org-mobile.el | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7cdaf34..a866293 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -255,6 +255,16 @@ using `rsync' or `scp'.") (defvar org-mobile-files-alist nil) (defvar org-mobile-checksum-files nil) +(defcustom org-mobile-add-after t + "Add information inside element." + :group 'org-mobile + :type 'boolean) + +(defcustom org-mobile-add-before t + "Add information inside element." + :group 'org-mobile + :type 'boolean) + (defun org-mobile-prepare-file-lists () (setq org-mobile-files-alist (org-mobile-files-alist)) (setq org-mobile-checksum-files nil)) @@ -581,10 +591,11 @@ The table of checksums is written to the file mobile-checksums." settings (nth 4 e)) (setq settings (cons (list 'org-agenda-title-append - (concat "KEYS=" key " TITLE: " - (if (and (stringp desc) (> (length desc) 0)) - desc (symbol-name type)) - "")) + (when org-mobile-add-after + (concat "KEYS=" key " TITLE: " + (if (and (stringp desc) (> (length desc) 0)) + desc (symbol-name type)) + ""))) settings)) (push (list type match settings) new)) ((or (functionp (nth 2 e)) (symbolp (nth 2 e))) @@ -601,9 +612,10 @@ The table of checksums is written to the file mobile-checksums." (setq settings (append gsettings settings)) (setq settings (cons (list 'org-agenda-title-append - (concat "KEYS=" gkey "#" (number-to-string - (setq cnt (1+ cnt))) - " TITLE: " atitle "")) + (when org-mobile-add-after + (concat "KEYS=" gkey "#" (number-to-string + (setq cnt (1+ cnt))) + " TITLE: " atitle ""))) settings)) (push (list type match settings) new))))) (and new (list "X" "SUMO" (reverse new) @@ -650,7 +662,9 @@ The table of checksums is written to the file mobile-checksums." pl (point-at-eol)))) (delete-region (point-at-bol) (point-at-eol)) - (insert line "" prefix "") + (insert line) + (when org-mobile-add-before + (insert "" prefix "")) (beginning-of-line 1)) (and (looking-at "[ \t]+") (replace-match ""))) (insert (if in-date "*** " "** ")) -- 1.8.3.4