Re: [O] [PATCH] Fix Org-Collector Error in Global Scope
Hi Mike, Mike McLean mike.mcl...@pobox.com writes: When calling Org-Collector with =:id global=, the call to =(org-narrow-to-subtree)= generates an error when the first line of the org file is not a header. Given that =:id global= is designed to use the entire file, the call to =(org-narrow-to-subtree)= is not even necessary. This patch skips it for global scope collector calls. I applied a variant using 'eq instead of 'equal. Next time, can you provide a full commit message and a ChangeLog entry? When patches are sent using 'git format-patch', applying them with 'git am' put the correct author of the patch. Otherwise I have to do it manually, which I sometimes forget. Thanks for the patch and your help, -- Bastien
[O] [PATCH] Fix Org-Collector Error in Global Scope
When calling Org-Collector with =:id global=, the call to =(org-narrow-to-subtree)= generates an error when the first line of the org file is not a header. Given that =:id global= is designed to use the entire file, the call to =(org-narrow-to-subtree)= is not even necessary. This patch skips it for global scope collector calls. This is a TINYCHANGE Mike Modified contrib/lisp/org-collector.el diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el index ad198ed..eac97f9 100644 --- a/contrib/lisp/org-collector.el +++ b/contrib/lisp/org-collector.el @@ -131,7 +131,8 @@ preceeding the dblock, then update the contents of the dblock. ((setq idpos (org-find-entry-with-id id)) (goto-char idpos)) (t (error Cannot find entry with :ID: %s id - (org-narrow-to-subtree) + (unless (equal id 'global) + (org-narrow-to-subtree)) (setq stringformat (if noquote %s %S)) (setq table (org-propview-to-table (org-propview-collect cols stringformat conds match scope inherit