emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How can I get document metadata?
@ 2010-09-19  2:51 Aidan Gauland
  2010-09-19 14:25 ` Sebastian Rose
  0 siblings, 1 reply; 7+ messages in thread
From: Aidan Gauland @ 2010-09-19  2:51 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 85 bytes --]

Is there an org function to get the title, author, etc. of an org document?

--Aidan

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

* Re: How can I get document metadata?
  2010-09-19  2:51 How can I get document metadata? Aidan Gauland
@ 2010-09-19 14:25 ` Sebastian Rose
  2010-09-19 14:42   ` Sebastian Rose
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Rose @ 2010-09-19 14:25 UTC (permalink / raw)
  To: emacs-orgmode

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> Is there an org function to get the title, author, etc. of an org document?
>
> --Aidan

How about

C-h f org-parse-local-options


BTW:

C-h f org-par TAB TAB

is your friens ;)


HTH

  Sebastian

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

* Re: How can I get document metadata?
  2010-09-19 14:25 ` Sebastian Rose
@ 2010-09-19 14:42   ` Sebastian Rose
  2010-09-19 20:04     ` Aidan Gauland
  2010-09-19 21:35     ` Bastien
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Rose @ 2010-09-19 14:42 UTC (permalink / raw)
  To: emacs-orgmode

Sebastian Rose <sebastian_rose@gmx.de> writes:
> Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
>> Is there an org function to get the title, author, etc. of an org document?
>>
>> --Aidan
>
> How about
>
> C-h f org-parse-local-options
>
>
> BTW:
>
> C-h f org-par TAB TAB
>
> is your friens ;)
>
>
> HTH
>
>   Sebastian



This is awkward to use:

(org-parse-local-options
  (org-get-local-options)
  'org-export-headline-levels) 


Is that function still in use? 

`grep -Fr org-parse-local-options'  reveals nothing.



Sebastian

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

* Re: How can I get document metadata?
  2010-09-19 14:42   ` Sebastian Rose
@ 2010-09-19 20:04     ` Aidan Gauland
  2010-09-19 22:34       ` Sebastian Rose
  2010-09-19 21:35     ` Bastien
  1 sibling, 1 reply; 7+ messages in thread
From: Aidan Gauland @ 2010-09-19 20:04 UTC (permalink / raw)
  To: emacs-orgmode

Sebastian Rose <sebastian_rose <at> gmx.de> writes:
> This is awkward to use:
> 
> (org-parse-local-options
>   (org-get-local-options)
>   'org-export-headline-levels) 
> 
> Is that function still in use? 
> 
> `grep -Fr org-parse-local-options'  reveals nothing.

Not only is it awkward, it (org-get-local-options) doesn't seem to get
me everything.  For example, the title isn't in the list returned by
org-get-local-options.

Isn't there a function to get the value from a
#+KEY: VALUE
line, or has that not been factored out of the Org code that needs to
do that?

--Aidan

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

* Re: How can I get document metadata?
  2010-09-19 14:42   ` Sebastian Rose
  2010-09-19 20:04     ` Aidan Gauland
@ 2010-09-19 21:35     ` Bastien
  1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2010-09-19 21:35 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

Hi Sebastian,

Sebastian Rose <sebastian_rose@gmx.de> writes:

> Is that function still in use? 
>
> `grep -Fr org-parse-local-options'  reveals nothing.

I've double-checked and no, it's not used.  

I removed it to spare people's time when C-h f-ing for the right
function.

Thanks,

-- 
 Bastien

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

* Re: Re: How can I get document metadata?
  2010-09-19 20:04     ` Aidan Gauland
@ 2010-09-19 22:34       ` Sebastian Rose
  2010-09-20  4:11         ` Aidan Gauland
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Rose @ 2010-09-19 22:34 UTC (permalink / raw)
  To: Aidan Gauland; +Cc: emacs-orgmode

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> Sebastian Rose <sebastian_rose <at> gmx.de> writes:
>> This is awkward to use:
>>
>> (org-parse-local-options
>>   (org-get-local-options)
>>   'org-export-headline-levels)
>>
>> Is that function still in use?
>>
>> `grep -Fr org-parse-local-options'  reveals nothing.
>
> Not only is it awkward, it (org-get-local-options) doesn't seem to get
> me everything.  For example, the title isn't in the list returned by
> org-get-local-options.



(org-get-current-options) finds most export related options, the names
of which can be found in org-exp.el.


I'm not an expert in this area.  But here is what I found so far.
You could take a look at certain files and funcitons in org-mode/lisp/:

1.)  `org-publish-file' in org-publish.el
     Here the call to
     (org-publish-get-project-from-filename filename)
     is of interest, as this returns all options set for the project the
     file belongs to eventually.

2.)  `org-export-as-html' in org-html.el
     Here I find the call to
     (org-infile-export-plist)
     Which returns the in-file plist of options.



This should do for a start:


(let ((opt-plist
       (org-export-process-option-filters
        (org-combine-plists (org-default-export-plist)
         (org-publish-get-project-from-filename buffer-file-name)
         (org-infile-export-plist)))))

  ;; the calculated style:
  (message "%s" (plist-get opt-plist :style))

  ;; or show the entire content of the property list:
  (message "%S" opt-plist))



Note, that e.g. the :title might be empty in this plist, because unset.
In that case, Org uses the filename as title.



HTH

  Sebastian

 

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

* Re: Re: How can I get document metadata?
  2010-09-19 22:34       ` Sebastian Rose
@ 2010-09-20  4:11         ` Aidan Gauland
  0 siblings, 0 replies; 7+ messages in thread
From: Aidan Gauland @ 2010-09-20  4:11 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 527 bytes --]

On Mon, Sep 20, 2010 at 12:34:22AM +0200, Sebastian Rose wrote:
> (let ((opt-plist
>        (org-export-process-option-filters
>         (org-combine-plists (org-default-export-plist)
>          (org-publish-get-project-from-filename buffer-file-name)
>          (org-infile-export-plist)))))
> 
>   ;; the calculated style:
>   (message "%s" (plist-get opt-plist :style))
> 
>   ;; or show the entire content of the property list:
>   (message "%S" opt-plist))

Thanks a ton!  That works well for me.

--Aidan

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

end of thread, other threads:[~2010-09-20  4:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19  2:51 How can I get document metadata? Aidan Gauland
2010-09-19 14:25 ` Sebastian Rose
2010-09-19 14:42   ` Sebastian Rose
2010-09-19 20:04     ` Aidan Gauland
2010-09-19 22:34       ` Sebastian Rose
2010-09-20  4:11         ` Aidan Gauland
2010-09-19 21:35     ` 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).