Re: [O] creating new #+KEYWORD: variables

2018-11-15 Thread John Kitchin
I have used something like this: (defun gb-set-filetag (tag value) "Set filetag TAG to VALUE. If VALUE is nil, remove the filetag." (save-excursion (goto-char (point-min)) (if (re-search-forward (format "#\\+%s:" tag) (point-max) 'end) ;; replace existing filetag (progn (beginning-of-line) (kill-l

Re: [O] creating new #+KEYWORD: variables

2018-11-15 Thread Matt Price
On Sat, Nov 10, 2018 at 1:58 PM Nicolas Goaziou wrote: > Hello, > > John Kitchin writes: > > > You can retrieve keywords in the org-file like this: > > > > (defun get-keyword (key) > > (org-element-map (org-element-parse-buffer) 'keyword > > (lambda (k) > > (when (string= key (org-el

Re: [O] creating new #+KEYWORD: variables

2018-11-12 Thread Diego Zamboni
Hi Nicolas, Thank you for this pointer! I have modified my own leanpub-multifile backend (derived from leanpub) to use this instead of manually extracting the keywords. In case anyone is interested, my code is here: https://github.com/zzamboni/dot-emacs/blob/master/init.org#publishing-to-leanpub

Re: [O] creating new #+KEYWORD: variables

2018-11-10 Thread Nicolas Goaziou
Hello, John Kitchin writes: > You can retrieve keywords in the org-file like this: > > (defun get-keyword (key) > (org-element-map (org-element-parse-buffer) 'keyword > (lambda (k) > (when (string= key (org-element-property :key k)) > (org-element-property :value k))) > nil t))

Re: [O] creating new #+KEYWORD: variables

2018-11-10 Thread John Kitchin
You can retrieve keywords in the org-file like this: (defun get-keyword (key) (org-element-map (org-element-parse-buffer) 'keyword (lambda (k) (when (string= key (org-element-property :key k)) (org-element-property :value k))) nil t)) (get-keyword "ORG_LMS_COURSE") John ---

Re: [O] creating new #+KEYWORD: variables

2018-11-10 Thread Matt Price
On Sat, Nov 10, 2018 at 2:22 AM Nicolas Goaziou wrote: > Hello, > > Matt Price writes: > > > I am writing this interface to my university's learning management > system: > > > https://github.com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def > . > > I am only using hte exporting s

Re: [O] creating new #+KEYWORD: variables

2018-11-09 Thread Nicolas Goaziou
Hello, Matt Price writes: > I am writing this interface to my university's learning management system: > https://github.com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def. > I am only using hte exporting system tangentially and I have not defined a > new exporter. However, I would

Re: [O] creating new #+KEYWORD: variables

2018-11-09 Thread Matt Price
ah, thank you Diego, I wil ltry it out and report back. On Fri, Nov 9, 2018 at 4:29 AM Diego Zamboni wrote: > Hi Matt, > > I found a solution for this, which I am using with my (still in > development) setup for exporting from org-mode to LeanPub. I found a > function for extracting document glo

Re: [O] creating new #+KEYWORD: variables

2018-11-09 Thread Diego Zamboni
Hi Matt, I found a solution for this, which I am using with my (still in development) setup for exporting from org-mode to LeanPub. I found a function for extracting document global properties at https://emacs.stackexchange.com/a/21715, which you could use to support your first example. After defi

[O] creating new #+KEYWORD: variables

2018-11-08 Thread Matt Price
I am writing this interface to my university's learning management system: https://github.com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def. I am only using hte exporting system tangentially and I have not defined a new exporter. However, I would really like to be able to set some v