From 7c59da0767b59550d1961310fcf02ab16ec417cb Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 25 Nov 2009 00:53:03 +0100 Subject: [PATCH] org-mobile: Make the agendas to be pushed configurable New variable `org-mobile-agendas'. --- lisp/ChangeLog | 3 +++ lisp/org-mobile.el | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d2fb5e711..a79e5606c 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-11-24 Carsten Dominik + * org-mobile.el (org-mobile-agendas): New option. + (org-mobile-sumo-agenda-command): Select the right agendas. + * org-latex.el (org-export-latex-format-image): Preserve the original-indentation property. diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 4c7cfa528..cfcee1467 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -85,6 +85,22 @@ should point to this file." :group 'org-mobile :type 'file) +(defcustom org-mobile-agendas 'all + "The agendas that should be pushed to MobileOrg. +Allowed values: + +default the weekly agenda and the global TODO list +custom all custom agendas defined by the user +all the custom agendas and the default ones +list a list of selection key(s) as string." + :group 'org-mobile + :type '(choice + (const :tag "Default Agendas" default) + (const :tag "Custom Agendas" custom) + (const :tag "Default and Custom Agendas" all) + (repeat :tag "Selected" + (string :tag "Selection Keys")))) + (defcustom org-mobile-force-id-on-agenda-items t "Non-nil means make all agenda items carry and ID." :group 'org-mobile @@ -426,8 +442,22 @@ The table of checksums is written to the file mobile-checksums." ((not (nth 1 x)) (cons (car x) (cons "" (cddr x)))) (t (cons (car x) (cons "" (cdr x)))))) org-agenda-custom-commands))) - new e key desc type match settings cmds gkey gdesc gsettings cnt) - (while (setq e (pop custom-list)) + (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo))) + thelist new e key desc type match settings cmds gkey gdesc gsettings cnt) + (cond + ((eq org-mobile-agendas 'custom) + (setq thelist custom-list)) + ((eq org-mobile-agendas 'default) + (setq thelist default-list)) + ((eq org-mobile-agendas 'all) + (setq thelist custom-list) + (unless (assoc "t" thelist) (push '("t" "ALL TODO" alltodo) thelist)) + (unless (assoc "a" thelist) (push '("a" "Agenda" agenda) thelist))) + ((listp org-mobile-agendas) + (setq thelist (append custom-list default-list)) + (setq thelist (delq nil (mapcar (lambda (k) (assoc k thelist)) + org-mobile-agendas))))) + (while (setq e (pop thelist)) (cond ((stringp (cdr e)) ;; this is a description entry - skip it @@ -438,7 +468,7 @@ The table of checksums is written to the file mobile-checksums." ((memq (nth 2 e) '(todo-tree tags-tree occur-tree)) ;; These are trees, not really agenda commands ) - ((memq (nth 2 e) '(agenda todo tags)) + ((memq (nth 2 e) '(agenda alltodo todo tags)) ;; a normal command (setq key (car e) desc (nth 1 e) type (nth 2 e) match (nth 3 e) settings (nth 4 e))