Re: [Orgmode] Automatic noexport tag based on rules?
On Fri, Feb 11, 2011 at 2:34 AM, Carsten Dominik wrote: > > On Feb 9, 2011, at 1:29 AM, John Hendy wrote: > > An alternative to using the :noexport: tag, and also to > the other suggestions given here in this thread would > be to use `org-map-entries' to physically remove all > subtrees which match your condition. And this physically removes the TODOs from the "blob" being exported, not from my .org files, right? If so, perhaps that would be an option. Strip it from the stream headed for export. Thanks for giving the code. John > You can call the > mapper from one of the preprocessing hooks: > > (defun my-export-remove-TODO () > (org-map-entries > ;; The following form will be evaluated at each matching tree > '(progn > (outline-mark-subtree) ; mark tree > (delete-region (point) (mark))) ; remove it > ;; Now the tags/property/todo matcher to select trees > "LEVEL<15+TODO={.}" > )) > > ;; Call this after other tree selection has been processed > (add-hook 'org-export-preprocess-after-tree-selection-hook > 'my-export-remove-TODO) > > The matcher includes a LEVEL<15 test to make sure this will > not mess with inline tasks. > > Export preprocessor hooks are a good place for such tasks. > Also Nick's proposal could be used in such a hook, but not > the same hook as I have used above. Maybe in > org-export-preprocessor-after-include-files-hook. > > > - Carsten > > > > > > >> Or simply add the TODO category to the noexport category altogether? >> >> I haven't turned up anything quite along these lines. One post suggested >> using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude >> from export (didn't try) but I know for sure it removes it from agenda view. >> I want TODOs in agenda but don't want them showing up with my LaTeX export. >> I typically print out my work to-date each month or so and have to comb >> through my org file for that month, manually adding :noexport: to my TODOs. >> Even if I still do this for a few things here and there... it will save me a >> lot of time. >> >> I suppose I could keep a separate "TODO.org" file, but I really like the >> process of being able to add them anywhere -- it seems more natural to do >> that in the flow, particularly in meetings, than to constantly switch >> buffers or even use remember to keep sending things related to the current >> topic away to their own island. >> >> I'm 80% confident that the answer is ridiculously simply and I just >> haven't searched the right thing. Thanks for enlightening me! >> >> >> Thanks, >> John >> ___ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
On Feb 9, 2011, at 1:29 AM, John Hendy wrote: Hi, My apologies if this has been discussed. I couldn't find it. I write everything from work in org-mode for several reasons. Primarily, it's my documentation system for research in order to properly document Intellectual Property (IP) information. It's also for todos and contacts. When it comes to exporting my notes into PDF for use in an IP notebook... I dont' want my todos in there. Is there a way to automatically tag TODOs with :noexport:? An alternative to using the :noexport: tag, and also to the other suggestions given here in this thread would be to use `org-map-entries' to physically remove all subtrees which match your condition. You can call the mapper from one of the preprocessing hooks: (defun my-export-remove-TODO () (org-map-entries ;; The following form will be evaluated at each matching tree '(progn (outline-mark-subtree) ; mark tree (delete-region (point) (mark))) ; remove it ;; Now the tags/property/todo matcher to select trees "LEVEL<15+TODO={.}" )) ;; Call this after other tree selection has been processed (add-hook 'org-export-preprocess-after-tree-selection-hook 'my-export-remove-TODO) The matcher includes a LEVEL<15 test to make sure this will not mess with inline tasks. Export preprocessor hooks are a good place for such tasks. Also Nick's proposal could be used in such a hook, but not the same hook as I have used above. Maybe in org-export-preprocessor-after-include-files-hook. Nick, an easy way to set a particular tag is (org-toggle-tag "noexport" 'on) The line number stuff in org-change-tag-in-region is there to allow people to have point in the line *after* the last headline to change. But maybe you can fix this by making a special case for point and mark in the same line... - Carsten Or simply add the TODO category to the noexport category altogether? I haven't turned up anything quite along these lines. One post suggested using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude from export (didn't try) but I know for sure it removes it from agenda view. I want TODOs in agenda but don't want them showing up with my LaTeX export. I typically print out my work to-date each month or so and have to comb through my org file for that month, manually adding :noexport: to my TODOs. Even if I still do this for a few things here and there... it will save me a lot of time. I suppose I could keep a separate "TODO.org" file, but I really like the process of being able to add them anywhere -- it seems more natural to do that in the flow, particularly in meetings, than to constantly switch buffers or even use remember to keep sending things related to the current topic away to their own island. I'm 80% confident that the answer is ridiculously simply and I just haven't searched the right thing. Thanks for enlightening me! Thanks, John ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
Hello, > Eric S Fraga writes: > You can then customise =org-inlinetask-export-templates= to generate > latex code that basically ignores the inline task. For the record, if the goal is to completely ignore inline tasks upon exporting, you should set org-inlinetask-export to nil instead of modifying org-inlinetask-export-templates. Regards, -- Nicolas ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
On Wed, Feb 9, 2011 at 12:13 PM, Nicolas Goaziou wrote: > Hello, > > > Eric S Fraga writes: > > You can then customise =org-inlinetask-export-templates= to generate > > latex code that basically ignores the inline task. > > For the record, if the goal is to completely ignore inline tasks upon > exporting, you should set org-inlinetask-export to nil instead of > modifying org-inlinetask-export-templates. > > Yes -- I read org-inlinetask.el and saw this setting in the preamble. I added ,--- | (setq org-inlinetask-export nil) `--- to .emacs and it works. John > Regards, > > -- > Nicolas > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
Nevermind. Once I located 'org-inlinetask.el' the answer was clear. John On Wed, Feb 9, 2011 at 9:18 AM, John Hendy wrote: > On Wed, Feb 9, 2011 at 1:40 AM, Eric S Fraga wrote: > >> John Hendy writes: >> >> [...] >> >> > Yeah.. most of my todos aren't medium-sized projects, though. Many of >> them >> > are more along the lines of one-liner action items I need to jot to >> myself >> > so I don't forget as well as keeping them as a sort of rolling "next >> > actions" queue. For that reason, I'd much rather keep them in their >> original >> > context. >> >> On possible suggestion: if you use inline tasks for these one liner >> TODOs, >> >> > Perhaps that's the way to go. I just find them ugly :( > > >> , >> | C-c C-x t runs the command org-inlinetask-insert-task, which is an >> | interactive compiled Lisp function in `org-inlinetask.el'. >> | >> | It is bound to C-c C-x t. >> | >> | (org-inlinetask-insert-task &optional NO-STATE) >> | >> | Insert an inline task. >> | If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'. >> ` >> >> > This isn't working for me and it's been quite difficult to find mention of > inline tasks in documentation. My searching only pulls a mention from the > 6.29v list of visible changes: > http://orgmode.org/Changes_old.html#sec-1_1_6 > > Is there something I need to set up to get this working? > > > Thanks, > John > > >> You can then customise =org-inlinetask-export-templates= to >> generate latex code that basically ignores the inline task. >> >> -- >> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 >> : using Org-mode version 7.4 (release_7.4.324.gca7a) >> > > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
On Wed, Feb 9, 2011 at 1:40 AM, Eric S Fraga wrote: > John Hendy writes: > > [...] > > > Yeah.. most of my todos aren't medium-sized projects, though. Many of > them > > are more along the lines of one-liner action items I need to jot to > myself > > so I don't forget as well as keeping them as a sort of rolling "next > > actions" queue. For that reason, I'd much rather keep them in their > original > > context. > > On possible suggestion: if you use inline tasks for these one liner > TODOs, > > Perhaps that's the way to go. I just find them ugly :( > , > | C-c C-x t runs the command org-inlinetask-insert-task, which is an > | interactive compiled Lisp function in `org-inlinetask.el'. > | > | It is bound to C-c C-x t. > | > | (org-inlinetask-insert-task &optional NO-STATE) > | > | Insert an inline task. > | If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'. > ` > > This isn't working for me and it's been quite difficult to find mention of inline tasks in documentation. My searching only pulls a mention from the 6.29v list of visible changes: http://orgmode.org/Changes_old.html#sec-1_1_6 Is there something I need to set up to get this working? Thanks, John > You can then customise =org-inlinetask-export-templates= to > generate latex code that basically ignores the inline task. > > -- > : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 > : using Org-mode version 7.4 (release_7.4.324.gca7a) > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules? (and a possible bug)
John Hendy wrote: > Yeah.. most of my todos aren't medium-sized projects, though. Many of them > are more along the lines of one-liner action items I need to jot to myself > so I don't forget as well as keeping them as a sort of rolling "next > actions" queue. For that reason, I'd much rather keep them in their original > context. > > This can't be too hard. > > ,--- > | sed '/[*]* TODO/ s/$/ :noexport:/g' > `--- > That's perfectly workable[fn:1]. > Or (facetious) > > ,--- > | setq (prefix-for-noexport-custom-variable) > | setq (default-tags-for-no-export-variable) > `--- > This isn't ;-) > I just don't know what the elegant, "right" elisp/org method is for > something like this. > Eye of the beholder and all that. Here's my attempt which should work, except I think there is a bug in org-change-tag-in-region (see below): --8<---cut here---start->8--- (defun set-noexport () (org-change-tag-in-region (save-excursion (beginning-of-line) (point)) (save-excursion (end-of-line) (point)) "noexport" nil)) (defun jh-mark-todo-noexport () (org-map-entries 'set-noexport "/+TODO" 'file)) --8<---cut here---end--->8--- There might be a simpler way to set the tag, but if so, I didn't find it. OTOH, mapping over the entries is as elegant as it gets. Now for the (purported) bug: org-change-tag-in-region does the following , | ... | (goto-char end) | (setq l2 (1- (org-current-line))) | (goto-char beg) | (setq l1 (org-current-line)) | (loop for l from l1 to l2 do | ... ` so if the region is a single line (say line 3), l2 becomes 2, l1 becomes 3 and the loop is not executed at all, whereas methinks it should be executed once. Shouldn't l2 be set to (org-current-line)? Thanks, Nick Footnotes: [fn:1] ...except that you might not want to add the tag if it's there already - I'm not sure whether that would cause a problem. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
John Hendy writes: [...] > Yeah.. most of my todos aren't medium-sized projects, though. Many of them > are more along the lines of one-liner action items I need to jot to myself > so I don't forget as well as keeping them as a sort of rolling "next > actions" queue. For that reason, I'd much rather keep them in their original > context. On possible suggestion: if you use inline tasks for these one liner TODOs, , | C-c C-x t runs the command org-inlinetask-insert-task, which is an | interactive compiled Lisp function in `org-inlinetask.el'. | | It is bound to C-c C-x t. | | (org-inlinetask-insert-task &optional NO-STATE) | | Insert an inline task. | If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'. ` You can then customise =org-inlinetask-export-templates= to generate latex code that basically ignores the inline task. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.4 (release_7.4.324.gca7a) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
On Tue, Feb 8, 2011 at 9:39 PM, John Hendy wrote: > I just don't know what the elegant, "right" elisp/org method is for > something like this. I'll leave that to the experts. ;) Best wishes. -- Jeffrey Horn http://www.failuretorefrain.com/jeff/ ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
On Tue, Feb 8, 2011 at 7:58 PM, Jeff Horn wrote: > I'm not handy with emacs-lisp, but perhaps someone could whip up a > handy function that iterates org-refile over each TODO heading to move > it into a new, top-level * Tasks headline? > > Thanks for the suggestion. I'm not a huge fan, but it would get done what I want to accomplish as far as the export goes. > Then you can tag the tasks headline with :noexport:. This would > destroy the "context", but I find keeping tasks in a separate heading > fine for most of *my* medium sized projects. YMMV. > Yeah.. most of my todos aren't medium-sized projects, though. Many of them are more along the lines of one-liner action items I need to jot to myself so I don't forget as well as keeping them as a sort of rolling "next actions" queue. For that reason, I'd much rather keep them in their original context. This can't be too hard. ,--- | sed '/[*]* TODO/ s/$/ :noexport:/g' `--- Or (facetious) ,--- | setq (prefix-for-noexport-custom-variable) | setq (default-tags-for-no-export-variable) `--- I just don't know what the elegant, "right" elisp/org method is for something like this. John > On Tue, Feb 8, 2011 at 7:29 PM, John Hendy wrote: > > Hi, > > > > My apologies if this has been discussed. I couldn't find it. I write > > everything from work in org-mode for several reasons. Primarily, it's my > > documentation system for research in order to properly document > Intellectual > > Property (IP) information. It's also for todos and contacts. When it > comes > > to exporting my notes into PDF for use in an IP notebook... I dont' want > my > > todos in there. > > Is there a way to automatically tag TODOs with :noexport:? > > Or simply add the TODO category to the noexport category altogether? > > I haven't turned up anything quite along these lines. One post suggested > > using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude > > from export (didn't try) but I know for sure it removes it from agenda > view. > > I want TODOs in agenda but don't want them showing up with my LaTeX > export. > > I typically print out my work to-date each month or so and have to comb > > through my org file for that month, manually adding :noexport: to my > TODOs. > > Even if I still do this for a few things here and there... it will save > me a > > lot of time. > > I suppose I could keep a separate "TODO.org" file, but I really like the > > process of being able to add them anywhere -- it seems more natural to do > > that in the flow, particularly in meetings, than to constantly switch > > buffers or even use remember to keep sending things related to the > current > > topic away to their own island. > > I'm 80% confident that the answer is ridiculously simply and I just > haven't > > searched the right thing. Thanks for enlightening me! > > > > Thanks, > > John > > ___ > > Emacs-orgmode mailing list > > Please use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > > > > > -- > Jeffrey Horn > http://www.failuretorefrain.com/jeff/ > ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Automatic noexport tag based on rules?
I'm not handy with emacs-lisp, but perhaps someone could whip up a handy function that iterates org-refile over each TODO heading to move it into a new, top-level * Tasks headline? Then you can tag the tasks headline with :noexport:. This would destroy the "context", but I find keeping tasks in a separate heading fine for most of *my* medium sized projects. YMMV. On Tue, Feb 8, 2011 at 7:29 PM, John Hendy wrote: > Hi, > > My apologies if this has been discussed. I couldn't find it. I write > everything from work in org-mode for several reasons. Primarily, it's my > documentation system for research in order to properly document Intellectual > Property (IP) information. It's also for todos and contacts. When it comes > to exporting my notes into PDF for use in an IP notebook... I dont' want my > todos in there. > Is there a way to automatically tag TODOs with :noexport:? > Or simply add the TODO category to the noexport category altogether? > I haven't turned up anything quite along these lines. One post suggested > using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude > from export (didn't try) but I know for sure it removes it from agenda view. > I want TODOs in agenda but don't want them showing up with my LaTeX export. > I typically print out my work to-date each month or so and have to comb > through my org file for that month, manually adding :noexport: to my TODOs. > Even if I still do this for a few things here and there... it will save me a > lot of time. > I suppose I could keep a separate "TODO.org" file, but I really like the > process of being able to add them anywhere -- it seems more natural to do > that in the flow, particularly in meetings, than to constantly switch > buffers or even use remember to keep sending things related to the current > topic away to their own island. > I'm 80% confident that the answer is ridiculously simply and I just haven't > searched the right thing. Thanks for enlightening me! > > Thanks, > John > ___ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Jeffrey Horn http://www.failuretorefrain.com/jeff/ ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Automatic noexport tag based on rules?
Hi, My apologies if this has been discussed. I couldn't find it. I write everything from work in org-mode for several reasons. Primarily, it's my documentation system for research in order to properly document Intellectual Property (IP) information. It's also for todos and contacts. When it comes to exporting my notes into PDF for use in an IP notebook... I dont' want my todos in there. Is there a way to automatically tag TODOs with :noexport:? Or simply add the TODO category to the noexport category altogether? I haven't turned up anything quite along these lines. One post suggested using "TODO keyword COMMENT" [1], but that just seems to perhaps exclude from export (didn't try) but I know for sure it removes it from agenda view. I want TODOs in agenda but don't want them showing up with my LaTeX export. I typically print out my work to-date each month or so and have to comb through my org file for that month, manually adding :noexport: to my TODOs. Even if I still do this for a few things here and there... it will save me a lot of time. I suppose I could keep a separate "TODO.org" file, but I really like the process of being able to add them anywhere -- it seems more natural to do that in the flow, particularly in meetings, than to constantly switch buffers or even use remember to keep sending things related to the current topic away to their own island. I'm 80% confident that the answer is ridiculously simply and I just haven't searched the right thing. Thanks for enlightening me! Thanks, John ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode