Re: [O] MobileOrg and tags
James Harkins jamshar...@gmail.com writes: Why do I now have to take an extra step to push to mobileorg, which I did not have to take before? Let's take it separately. I'm not using org-mobile.el so I'm slow at figuring out such things. My guess is that this step was already lurking there, in case you use special characters in files you need to save, and for which Emacs can't guess the right coding system. Can you compare the older version of org-mobile with the same files for this problem? -- Bastien
Re: [O] MobileOrg and tags
James Harkins jamshar...@gmail.com writes: No, it didn't help. It seems I was right. You can't pass a list of cons-cells into org-global-tags-completion-table. It has to be a list of strings. It's necessary to get car from each item in files-alist. diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7795780..f6ab493 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -424,7 +424,7 @@ agenda view showing the flagged items. done-kwds (org-uniquify org-todo-keywords-for-agenda))) (setq drawers (org-uniquify org-drawers-for-agenda)) -(setq tags (mapcar 'car (org-global-tags-completion-table files-alist))) +(setq tags (mapcar 'car (org-global-tags-completion-table (mapcar 'car files-alist (with-temp-file (if org-mobile-use-encryption org-mobile-encryption-tempfile Okay, I've now applied this change, thanks. -- Bastien
Re: [O] MobileOrg and tags
Hi James, Bastien b...@gnu.org writes: Hi James, James Harkins jamshar...@gmail.com writes: Or have a configuration variable so the user can decide how to generate the tag list. If the global tag completion table function is too slow for some, they could manually populate org-tag-alist or...? Yes -- something like `org-mobile-rebuild-agenda-tag-alist': t or nil. (if org-mobile-rebuild-agenda-tag-alist (org-global-tags-completion-table org-mobile-files) org-tag-alist-for-agenda) I've finally committed a change for this, using `org-global-tags-completion-table' inconditionnally. Please test it and report any problem. Thanks, -- Bastien
Re: [O] MobileOrg and tags
At Fri, 03 Aug 2012 14:31:12 +0200, Bastien wrote: I've finally committed a change for this, using `org-global-tags-completion-table' inconditionnally. Please test it and report any problem. Sorry I was late in delivering the patch. How about this (to apply on top of 7.8.11)? If it doesn't apply to master, I can regenerate it against the master branch. Let me know. hjh -- James Harkins /// dewdrop world jamshar...@dewdrop-world.net http://www.dewdrop-world.net Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal. -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks From 0e5b879eff9c7d7a09cbb721c763455fc14854e1 Mon Sep 17 00:00:00 2001 From: James Harkins jamshar...@dewdrop-world.net Date: Wed, 1 Aug 2012 21:12:01 -0400 Subject: [PATCH] Add rebuild-tag-list defcustom and implement in org-mobile-create-index-file org-mobile-rebuild-tag-list is a boolean. If true, it calls org-global-tags-completion-table to generate a complete list of tags used in agenda files, to put into index.org. If false, it uses org-tag-alist-for-agenda instead (saving time). --- lisp/org-mobile.el | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 946e821..2105c5f 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -214,6 +214,18 @@ For now, it is not recommended to change this variable. :group 'org-mobile :type 'string) +(defcustom org-mobile-rebuild-tag-list t + If non-nil, use (org-global-tags-completion-table) to populate the list +of all tags used in all agenda files. This ensures that all tags are available +on the mobile device. + +If the agenda files are very large, this could be time consuming. Set to nil +to disable the automatic generation of the list. You may then supply the tag list +manually by populating org-tag-alist-for-agenda. + :type 'boolean + :group 'org-mobile +) + (defvar org-mobile-pre-push-hook nil Hook run before running `org-mobile-push'. This could be used to clean up `org-mobile-directory', for example to @@ -430,7 +442,10 @@ agenda view showing the flagged items. ((listp e) (if (stringp (car e)) (car e) nil)) (t nil))) - org-tag-alist-for-agenda + (if org-mobile-rebuild-tag-list + (org-global-tags-completion-table) +org-tag-alist-for-agenda) + (with-temp-file (if org-mobile-use-encryption org-mobile-encryption-tempfile -- 1.7.9.5
Re: [O] MobileOrg and tags
Hi James, James Harkins jamshar...@gmail.com writes: At Fri, 03 Aug 2012 14:31:12 +0200, Bastien wrote: I've finally committed a change for this, using `org-global-tags-completion-table' inconditionnally. Please test it and report any problem. Sorry I was late in delivering the patch. How about this (to apply on top of 7.8.11)? If it doesn't apply to master, I can regenerate it against the master branch. Let me know. It cannot apply, since I already made a change. Please test my change first, it spares us the cost of a new option, and it should be fast enough. If it is not, maybe we'll go with your patch. Thanks, -- Bastien
Re: [O] MobileOrg and tags
At Fri, 03 Aug 2012 18:16:55 +0200, Bastien wrote: Please test my change first, it spares us the cost of a new option, and it should be fast enough. If it is not, maybe we'll go with your patch. It's not working. I'm unsure if I'm doing something wrong or if the patch is broken. Normally, I'm running on a separate (private) branch which was checked out from the release 7.8.11 tag. I plan to keep fairly up-to-date with releases, but I don't want to run routinely on the main development branch. So this is what I did: - git checkout master - git pull - make clean - make - Restart Emacs - Switch temporarily to a different org-mobile-push working directory - org-mobile-push Two differences in behavior: - It pops up a buffer showing me the contents of agendas.org, and asks me what coding system I want to use (default raw-text). That strikes me as an unnecessary distraction in the workflow, although maybe this is intentional. - An error is produced: Debugger entered--Lisp error: (wrong-type-argument stringp (~/Documents/mobileorg/semester.org . semester-fall.org)) expand-file-name((~/Documents/mobileorg/semester.org . semester-fall.org)) find-file-noselect((~/Documents/mobileorg/semester.org . semester-fall.org)) #[(file) \302!q\210\303\304 \305\306\\\207 [file org-tag-alist find-file-noselect append org-get-buffer-tags mapcar #[... \242;\205 \242C\207 [x] 1]] 5]((~/Documents/mobileorg/semester.org . semester-fall.org)) mapcar(#[(file) \302!q\210\303\304 \305\306 \\\207 [file org-tag-alist find-file-noselect append org-get-buffer-tags mapcar #[... \242;\205 \242C\207 [x] 1]] 5] ((~/Documents/mobileorg/semester.org . semester-fall.org) (~/Documents/mobileorg/agenda_main.org . agenda_main.org))) org-global-tags-completion-table(((~/Documents/mobileorg/semester.org . semester-fall.org) (~/Documents/mobileorg/agenda_main.org . agenda_main.org))) org-mobile-create-index-file() byte-code(\303\304!\210\305 \210\306 \210\307\310!\210\311\312\313\\314 \210*\307\315!\210\316 \210\307\317!\210\320 \210\307\321!\210\322 \210\307\323!\210\324 \210\303\325!\207 [org-mobile-files-alist org-agenda-files inhibit-redisplay run-hooks org-mobile-pre-push-hook org-mobile-check-setup org-mobile-prepare-file-lists message Creating agendas... t mapcar car org-mobile-create-sumo-agenda Creating agendas...done org-save-all-org-buffers Copying files... org-mobile-copy-agenda-files Writing index file... org-mobile-create-index-file Writing checksums... org-mobile-write-checksums org-mobile-post-push-hook] 4) org-mobile-push() call-interactively(org-mobile-push nil nil) Am I going about this properly? hjh -- James Harkins /// dewdrop world jamshar...@dewdrop-world.net http://www.dewdrop-world.net Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal. -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks
Re: [O] MobileOrg and tags
James Harkins jamshar...@gmail.com writes: It's not working. Does it work with your patch? I used (org-global-tags-completion-table org-mobile-files) assuming it would DTRT. If your patch works against master, please resubmit it with a proper ChangeLog message. It would be nice to limit the files where the tags are gathered from, though, dunno what's wrong with my use of (org-global-tags-completion-table org-mobile-files) Can you have a look? Thanks, -- Bastien
Re: [O] MobileOrg and tags
James Harkins jamshar...@gmail.com writes: Two differences in behavior: - It pops up a buffer showing me the contents of agendas.org, and asks me what coding system I want to use (default raw-text). That strikes me as an unnecessary distraction in the workflow, although maybe this is intentional. You'll have this if you use `org-global-tags-completion-table' anyway. - An error is produced: Debugger entered--Lisp error: (wrong-type-argument stringp (~/Documents/mobileorg/semester.org . semester-fall.org)) expand-file-name((~/Documents/mobileorg/semester.org . semester-fall.org)) find-file-noselect((~/Documents/mobileorg/semester.org . semester-fall.org)) #[(file) \302!q\210\303\304 \305\306 \\\207 [file org-tag-alist find-file-noselect append org-get-buffer-tags mapcar #[... \242;\205 Please check again against current HEAD, I made a small change that might make a difference. Thanks, -- Bastien
Re: [O] MobileOrg and tags
At Fri, 03 Aug 2012 20:06:04 +0200, Bastien wrote: James Harkins jamshar...@gmail.com writes: Two differences in behavior: - It pops up a buffer showing me the contents of agendas.org, and asks me what coding system I want to use (default raw-text). That strikes me as an unnecessary distraction in the workflow, although maybe this is intentional. You'll have this if you use `org-global-tags-completion-table' anyway. Okay, I can see my question might have been a little confusing: Asking it in the context of the tags change suggested that I thought the coding system prompt is the result of the tag-related change. It is a separate question, though. Why do I now have to take an extra step to push to mobileorg, which I did not have to take before? - An error is produced: Debugger entered--Lisp error: (wrong-type-argument stringp (~/Documents/mobileorg/semester.org . semester-fall.org)) Please check again against current HEAD, I made a small change that might make a difference. No, it didn't help. It seems I was right. You can't pass a list of cons-cells into org-global-tags-completion-table. It has to be a list of strings. It's necessary to get car from each item in files-alist. diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7795780..f6ab493 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -424,7 +424,7 @@ agenda view showing the flagged items. done-kwds (org-uniquify org-todo-keywords-for-agenda))) (setq drawers (org-uniquify org-drawers-for-agenda)) -(setq tags (mapcar 'car (org-global-tags-completion-table files-alist))) +(setq tags (mapcar 'car (org-global-tags-completion-table (mapcar 'car files-alist (with-temp-file (if org-mobile-use-encryption org-mobile-encryption-tempfile hjh -- James Harkins /// dewdrop world jamshar...@dewdrop-world.net http://www.dewdrop-world.net Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal. -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks
[O] MobileOrg and tags
Been fiddling around with an issue that I noticed in MobileOrg for android... but I just noticed something strange that makes me think it's an issue in org-mode itself. The issue reveals itself when using MobileOrg to edit a tagged node. Instead of the actual tags, MobileOrg shows #+DRAWERS:: (as many times as there are tags for that item). Then this gets written back during org-mobile-pull. What I noticed is this, in index.org: #+TAGS: #+DRAWERS: PROPERTIES CLOCK LOGBOOK So, I guess, really two issues: - MobileOrg parses the absence of anything after TAGS as undifferentiated white space, and assumes that #+DRAWERS: is the name of a valid tag. - Orgmode doesn't populate the list of tags based on the tags that are actually used in the source files. So my questions are: - Where are the #+TAGS: supposed to come from? Only from org-tag-alist? If so, that's a bit of a bother. I don't know in advance what tags I will need. I'd rather not have to customize the variable every time I introduce a new tag. - If my guess is right, is it a reasonable enhancement to have org-mobile-push append the tags found in the files onto what is already there in org-tag-alist? Thanks, James -- James Harkins /// dewdrop world jamshar...@dewdrop-world.net http://www.dewdrop-world.net Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal. -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks