* MobileOrg and tags @ 2012-07-17 2:34 James Harkins 2012-07-20 16:20 ` James Harkins 0 siblings, 1 reply; 14+ messages in thread From: James Harkins @ 2012-07-17 2:34 UTC (permalink / raw) To: emacs-orgmode 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 jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-07-17 2:34 MobileOrg and tags James Harkins @ 2012-07-20 16:20 ` James Harkins 2012-07-28 17:49 ` Bastien 0 siblings, 1 reply; 14+ messages in thread From: James Harkins @ 2012-07-20 16:20 UTC (permalink / raw) To: emacs-orgmode At Mon, 16 Jul 2012 22:34:11 -0400, James Harkins wrote: > > 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. ... snip > - 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. Following up on my question about transmitting tags over to MobileOrg -- the question being how to make sure MobileOrg knows about the existing tags, so that it's possible to edit tagged nodes without breaking the tags. I found a reference to a function, org-global-tags-completion-table, that would collect all of the tags currently being used. So, as an experiment, I made a small change to org-mobile.el [1]. And, magically, in index.org, now I get: #+TAGS: Bug FarShore Hadron Hard Lament lily Lilypond......... And on my tablet, editing a node shows the correct tags (no more #+DRAWERS::) and, tapping on a tag brings up a full, correct list of tags. Great! IMO, what a typical user would expect. Obviously this is a hack, and I am 1/ not sophisticated enough with lisp and 2/ not familiar enough with the orgmode codebase to implement a real solution. I guess it would be something like a customization variable to determine whether or not to concatenate the tag completion table onto org-tag-alist-for-agenda, and then a conditional in the spot that I changed. If no objection, I'll add a feature request (if I don't find an existing one). hjh [1] Diff vs. release_7.8.11 diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 946e821..5644a05 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -430,7 +430,8 @@ agenda view showing the flagged items." ((listp e) (if (stringp (car e)) (car e) nil)) (t nil))) - org-tag-alist-for-agenda)))) +; org-tag-alist-for-agenda)))) + (org-global-tags-completion-table))))) (with-temp-file (if org-mobile-use-encryption org-mobile-encryption-tempfile -- James Harkins /// dewdrop world jamshark70@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 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-07-20 16:20 ` James Harkins @ 2012-07-28 17:49 ` Bastien 2012-07-29 20:22 ` James Harkins 0 siblings, 1 reply; 14+ messages in thread From: Bastien @ 2012-07-28 17:49 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode Hi James, James Harkins <jamshark70@gmail.com> writes: > I found a reference to a function, org-global-tags-completion-table, that > would collect all of the tags currently being used. So, as an experiment, I > made a small change to org-mobile.el [1]. And, magically, in index.org, now > I get: > > #+TAGS: Bug FarShore Hadron Hard Lament lily Lilypond......... Can you try replacing the call to the function (org-global-tags-completion-table) by a call to the variable `org-tag-alist'? I'm not using org-mobile.el, so purely a shoot in the dark. But `org-tag-alist-for-agenda' doesn't seem necessary here, and using `org-global-tags-completion-table' is too time consuming. Thanks, -- Bastien ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-07-28 17:49 ` Bastien @ 2012-07-29 20:22 ` James Harkins 2012-07-30 10:20 ` Bastien 0 siblings, 1 reply; 14+ messages in thread From: James Harkins @ 2012-07-29 20:22 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode On 7/28/12, Bastien <bzg@gnu.org> wrote: > Can you try replacing the call to the function > > (org-global-tags-completion-table) > > by a call to the variable `org-tag-alist'? > > I'm not using org-mobile.el, so purely a shoot in the dark. Nope. "org-tag-alist" is empty in my installation, and I didn't find any code that populates it automatically. Tags are still empty. > But `org-tag-alist-for-agenda' doesn't seem necessary here, > and using `org-global-tags-completion-table' is too time > consuming. Unfortunately, as far as I can see, (org-global-tags-completion-table) is the only function that will generate the tag list from multiple agenda files. Per your comment on my bug report, I tried (org-get-buffer-tags) but, as I would have expected from the name, it acquires the tags only from the active buffer when C-c C-x RET p is called. I have: Agenda file 1: { set, of, tags, from, file, 1 } Agenda file 2: { another, group, of, tags } If file 1 is the active buffer, then the tags written into the index are only "set, of, tags, from, file, 1." "Another" and "group" are omitted. By (org-get-buffer-tags): #+TAGS: DC Hadron Lilypond Maybe MusicSoftware NYC SuperCollider TaxQs TIP Today Todo Trip2012 By (org-global-tags-completion-table): #+TAGS: Bug DC FarShore Hadron Hard Lament lily Lilypond longC Maybe midfast MusicSoftware MyConcert NYC Opt SC Sheng SuperCollider TaxQs TIP Today Todo Trip2012 Wk11Docs Wk11plugs Wk2012 I would rather wait a little longer and have a correct result, than save time and have the feature not work. 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...? hjh -- James Harkins /// dewdrop world jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-07-29 20:22 ` James Harkins @ 2012-07-30 10:20 ` Bastien 2012-08-03 12:31 ` Bastien 0 siblings, 1 reply; 14+ messages in thread From: Bastien @ 2012-07-30 10:20 UTC (permalink / raw) To: jamshark70; +Cc: emacs-orgmode Hi James, James Harkins <jamshark70@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) Thanks in advance for the patch, -- Bastien ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-07-30 10:20 ` Bastien @ 2012-08-03 12:31 ` Bastien 2012-08-03 15:41 ` James Harkins 0 siblings, 1 reply; 14+ messages in thread From: Bastien @ 2012-08-03 12:31 UTC (permalink / raw) To: jamshark70; +Cc: emacs-orgmode Hi James, Bastien <bzg@gnu.org> writes: > Hi James, > > James Harkins <jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 12:31 ` Bastien @ 2012-08-03 15:41 ` James Harkins 2012-08-03 16:16 ` Bastien 0 siblings, 1 reply; 14+ messages in thread From: James Harkins @ 2012-08-03 15:41 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 722 bytes --] 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 jamshark70@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 [-- Attachment #2: 0001-Add-rebuild-tag-list-defcustom-and-implement-in-org-.patch --] [-- Type: text/plain, Size: 1902 bytes --] From 0e5b879eff9c7d7a09cbb721c763455fc14854e1 Mon Sep 17 00:00:00 2001 From: James Harkins <jamshark70@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 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 15:41 ` James Harkins @ 2012-08-03 16:16 ` Bastien 2012-08-03 17:02 ` James Harkins 0 siblings, 1 reply; 14+ messages in thread From: Bastien @ 2012-08-03 16:16 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode Hi James, James Harkins <jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 16:16 ` Bastien @ 2012-08-03 17:02 ` James Harkins 2012-08-03 17:09 ` Bastien 2012-08-03 18:06 ` Bastien 0 siblings, 2 replies; 14+ messages in thread From: James Harkins @ 2012-08-03 17:02 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode 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\b!q\210\303\304 \305\306 \"\"\207" [file org-tag-alist find-file-noselect append org-get-buffer-tags mapcar #[... "\b\242;\205 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 17:02 ` James Harkins @ 2012-08-03 17:09 ` Bastien 2012-08-03 18:06 ` Bastien 1 sibling, 0 replies; 14+ messages in thread From: Bastien @ 2012-08-03 17:09 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode James Harkins <jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 17:02 ` James Harkins 2012-08-03 17:09 ` Bastien @ 2012-08-03 18:06 ` Bastien 2012-08-03 18:50 ` James Harkins 1 sibling, 1 reply; 14+ messages in thread From: Bastien @ 2012-08-03 18:06 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode James Harkins <jamshark70@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\b!q\210\303\304 \305\306 \"\"\207" [file org-tag-alist > find-file-noselect append org-get-buffer-tags mapcar > #[... "\b\242;\205 Please check again against current HEAD, I made a small change that might make a difference. Thanks, -- Bastien ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 18:06 ` Bastien @ 2012-08-03 18:50 ` James Harkins 2012-08-04 8:24 ` Bastien 2012-08-04 8:24 ` Bastien 0 siblings, 2 replies; 14+ messages in thread From: James Harkins @ 2012-08-03 18:50 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode At Fri, 03 Aug 2012 20:06:04 +0200, Bastien wrote: > > James Harkins <jamshark70@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 jamshark70@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 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 18:50 ` James Harkins @ 2012-08-04 8:24 ` Bastien 2012-08-04 8:24 ` Bastien 1 sibling, 0 replies; 14+ messages in thread From: Bastien @ 2012-08-04 8:24 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode James Harkins <jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: MobileOrg and tags 2012-08-03 18:50 ` James Harkins 2012-08-04 8:24 ` Bastien @ 2012-08-04 8:24 ` Bastien 1 sibling, 0 replies; 14+ messages in thread From: Bastien @ 2012-08-04 8:24 UTC (permalink / raw) To: James Harkins; +Cc: emacs-orgmode James Harkins <jamshark70@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 ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-08-04 8:24 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-07-17 2:34 MobileOrg and tags James Harkins 2012-07-20 16:20 ` James Harkins 2012-07-28 17:49 ` Bastien 2012-07-29 20:22 ` James Harkins 2012-07-30 10:20 ` Bastien 2012-08-03 12:31 ` Bastien 2012-08-03 15:41 ` James Harkins 2012-08-03 16:16 ` Bastien 2012-08-03 17:02 ` James Harkins 2012-08-03 17:09 ` Bastien 2012-08-03 18:06 ` Bastien 2012-08-03 18:50 ` James Harkins 2012-08-04 8:24 ` Bastien 2012-08-04 8:24 ` Bastien
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.