emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mike McLean <mike.mclean@pobox.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix Org-Collector Error in Global Scope
Date: Sat, 24 Mar 2012 09:45:12 -0400	[thread overview]
Message-ID: <F9DFD121-C0E1-487C-BB1A-A931915523D4@pobox.com> (raw)

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

             reply	other threads:[~2012-03-24 13:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-24 13:45 Mike McLean [this message]
2012-03-26 15:26 ` [PATCH] Fix Org-Collector Error in Global Scope Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F9DFD121-C0E1-487C-BB1A-A931915523D4@pobox.com \
    --to=mike.mclean@pobox.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).