emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bastien.guerry@wikimedia.fr>
To: Dan Davison <dandavison7@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: [PATCH] Allow property retrieval before first heading?
Date: Sat, 12 Feb 2011 19:04:52 +0100	[thread overview]
Message-ID: <87lj1lruwr.fsf@gnu.org> (raw)
In-Reply-To: <m1r5bdtd9y.fsf@94.197.159.103.threembb.co.uk> (Dan Davison's message of "Sat, 12 Feb 2011 16:42:49 +0000")

Hi Dan,

Dan Davison <dandavison7@gmail.com> writes:

> Dan Davison <dandavison7@gmail.com> writes:
>
>> Currently (org-entry-get) throws an error if point is before the first
>> heading. Is there a reason that this must be so? Org is too essential
>> for headings to be obligatory!

Thanks for the patch -- makes sense, I applied it.

>> An example of when it would be useful to get properties is in a buffer
>> containing src blocks but no headings (babel takes header args from Org
>> properties). 
>
> Hmm, for the record I was confused on that point; Eric already has a
> workaround for the error to the effect that babel will take header args
> from a #+PROPERTY line in a buffer with no headings. But my question
> stands, as this error is a gotcha, requiring code like this
>
>   (or (condition-case nil
> 	  (org-entry-get (point) header-arg t)
> 	(error nil))
>       (cdr (assoc header-arg org-file-properties))))

Yes - I removed a few useless condition-case wrapping since your patch.

Please report any problem.

Thanks,

-- 
 Bastien

  reply	other threads:[~2011-02-12 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12 16:26 [PATCH] Allow property retrieval before first heading? Dan Davison
2011-02-12 16:42 ` Dan Davison
2011-02-12 18:04   ` Bastien [this message]
2011-02-12 18:03 ` [Accepted] " Bastien Guerry

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=87lj1lruwr.fsf@gnu.org \
    --to=bastien.guerry@wikimedia.fr \
    --cc=dandavison7@gmail.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).