From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug and possible fix / work-around using org-mobile with group tags Date: Sun, 21 Feb 2016 16:35:34 +0100 Message-ID: <8760xi2i0p.fsf@nicolasgoaziou.fr> References: <608350460.2102657.1455198750254.JavaMail.yahoo.ref@mail.yahoo.com> <608350460.2102657.1455198750254.JavaMail.yahoo@mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXW1B-0007O2-WD for emacs-orgmode@gnu.org; Sun, 21 Feb 2016 10:33:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXW15-00043I-HG for emacs-orgmode@gnu.org; Sun, 21 Feb 2016 10:33:53 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:41573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXW15-00042L-7e for emacs-orgmode@gnu.org; Sun, 21 Feb 2016 10:33:47 -0500 In-Reply-To: <608350460.2102657.1455198750254.JavaMail.yahoo@mail.yahoo.com> (John Hutchinson's message of "Thu, 11 Feb 2016 13:52:30 +0000 (UTC)") 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: John Hutchinson Cc: "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain Hello, John Hutchinson writes: > - Running org-mobile-push with group tags defined in init.el file using :startgrouptag etc. results in an error, and (in my case) DropBox not being updated. Here's the log from the *Messages* buffer: Creating agendas... > Agenda written to Org file /cygdrive/c/Users/IBM_ADMIN/Dropbox/Apps/MobileOrg/agendas.org > Creating agendas...done > Saving all Org-mode buffers... > (No files need saving) > Saving all Org-mode buffers... done > Copying files... > Writing index file... > org-mobile-create-index-file: Wrong type argument: sequencep, :startgrouptag > Quit > [2 times] > > - Commenting out the group tags attributes in init.el results in Org Mobile successfully generating and pushing to DropBox. > - Turning group tags off with org-toggle-tags-groups and running org-mobile-push causes the error. > - Using Org from org-plus-contrib-20160208, the problem seems to be the :startgroup and :endgroup on lines 460 and 461 of org-mobile.el; patching them to :startgrouptag and :endgrouptag respectively appears to correct the issue (though I've not done in-depth testing for any other unintended side effects this patch may have). > - Also, changing the group attributes in my init.el from :startgrouptag :endgrouptag to :startgroup and :endgroup respectively corrects the issue, although the Org manual indicates that the longer form is correct. > > - As an aside, I note there are several instances of plain :startgroup intermingled with :startgrouptag in the org sources: org-plus-contrib-20160208 $ grep -n startgroup *.el > org.el:3492: (const :startgroup) > org.el:3495: (const :startgrouptag) > org.el:3523: (const :tag "Start radio group" (:startgroup)) > org.el:5063: (append '((:startgroup)) > org.el:5233: (:startgroup "{") > org.el:5235: (:startgrouptag "[") > org.el:5252: (push '(:startgroup) org-tag-alist) > org.el:5258: (push '(:startgrouptag) org-tag-alist) > org.el:5322: (if (or (memq (car e) '(:newline :grouptags :endgroup :startgroup)) > org.el:13093: ((equal e '(:startgroup)) > org.el:15232: ((eq (car e) :startgroup) > org.el:15241: ((eq (car e) :startgrouptag) > org-interactive-query.el:92: ((equal e '(:startgroup)) > org-interactive-query.el:268: ;; if this is not a keyword (:startgroup, etc), ignore it > org-mobile.el:460: ((eq (car x) :startgroup) "{") > org-pcomplete.el:245: ((eq :startgroup (car x)) "{") > ox-beamer.el:1128: (append '((:startgroup)) > > Regards,=John > P.S. First time writing to this list; apologies in advance for > breaches of etiquette. Thank you for the report. This is probably related to the recent introduction of Tag hierarchy. Would the following patch solve the problem? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-mobile-Fix-Wrong-type-argument-sequencep-startgr.patch >From 519d69a057b49b2f3996209145aef5b41fcfe091 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 21 Feb 2016 16:28:15 +0100 Subject: [PATCH] org-mobile: Fix Wrong type argument: sequencep, :startgrouptag * lisp/org-mobile.el (org-mobile-create-index-file): Handle group tags. Reported-by: John Hutchinson --- lisp/org-mobile.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index e6709e4..84e90fd 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -455,13 +455,16 @@ agenda view showing the flagged items." (mapconcat 'identity done-kwds " ") "\n")) (setq def-tags (mapcar (lambda (x) - (cond ((null x) nil) - ((stringp x) x) - ((eq (car x) :startgroup) "{") - ((eq (car x) :endgroup) "}") - ((eq (car x) :grouptags) nil) - ((eq (car x) :newline) nil) - ((listp x) (car x)))) + (lambda (tag) + (cl-case (car tag) + ((nil) nil) + (:startgroup "{") + (:endgroup "}") + (:startgrouptag "[") + (:endgrouptag "]") + (:grouptags ":") + (:newline nil) + (t (car tag))))) def-tags)) (setq def-tags (delq nil def-tags)) (setq tags (org-delete-all def-tags tags)) -- 2.7.1 --=-=-=--