emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix Org-Collector Error in Global Scope
@ 2012-03-24 13:45 Mike McLean
  2012-03-26 15:26 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Mike McLean @ 2012-03-24 13:45 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix Org-Collector Error in Global Scope
  2012-03-24 13:45 [PATCH] Fix Org-Collector Error in Global Scope Mike McLean
@ 2012-03-26 15:26 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-03-26 15:26 UTC (permalink / raw)
  To: Mike McLean; +Cc: emacs-orgmode

Hi Mike,

Mike McLean <mike.mclean@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-26 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 13:45 [PATCH] Fix Org-Collector Error in Global Scope Mike McLean
2012-03-26 15:26 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).