[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File local setting for export directory?
From: |
Loris Bennett |
Subject: |
Re: File local setting for export directory? |
Date: |
Tue, 04 Aug 2020 16:06:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
> On Tue, Aug 04, 2020 at 08:25:13AM +0200, Loris Bennett wrote:
>> > diff --git a/lisp/ox.el b/lisp/ox.el
>> > index 9cf62078a..77cafb20d 100644
>> > --- a/lisp/ox.el
>> > +++ b/lisp/ox.el
>> > @@ -6417,6 +6417,20 @@ Return file name as a string."
>> > "Output file: " pub-dir nil nil nil
>> > (lambda (n) (string= extension (file-name-extension n t))))))
>> > extension))
>> > + (pub-dir (or pub-dir
>> > + (and subtreep (org-entry-get
>> > + nil "EXPORT_PUB_DIR" 'selective))
>> > + (org-with-point-at (point-min)
>> > + (catch :found
>> > + (let ((case-fold-search t))
>> > + (while (re-search-forward
>> > + "^[ \t]*#\\+EXPORT_PUB_DIR:[ \t]+\\S-"
>> > + nil t)
>> > + (let ((element (org-element-at-point)))
>> > + (when (eq 'keyword (org-element-type element))
>> > + (throw :found
>> > + (org-element-property
>> > + :value element))))))))))
>> > (output-file
>> > ;; Build file name. Enforce EXTENSION over whatever user
>> > ;; may have come up with. PUB-DIR, if defined, always has
>
> Regarding this patch, have you looked at setting up Org's Publish functions
> in a
> local variable? That has a "publish destination" which I believe is the
> pub-dir
> in that export function.
>
> https://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations
>
> Perhaps this is fixed by another means?
Maybe. I did look at "publish destination" but I couldn't get it to
work, possibly because (a) I am not quite clear on difference between
"exporting" and "publishing" and (b) I was feeling lazy and it seemed
like an overly complex way of achieving what I wanted (not that patching
the source can really be considered much less complex :-/ ).
Cheers,
Loris
--
This signature is currently under construction.
- File local setting for export directory?, Loris Bennett, 2020/08/03
- Re: File local setting for export directory?, Russell Adams, 2020/08/03
- Re: File local setting for export directory?, Eric Abrahamsen, 2020/08/03
- Re: File local setting for export directory?, Loris Bennett, 2020/08/04
- Re: File local setting for export directory?, Russell Adams, 2020/08/04
- Re: File local setting for export directory?, Loris Bennett, 2020/08/04
- Re: File local setting for export directory?, Russell Adams, 2020/08/04
- Re: File local setting for export directory?, Russell Adams, 2020/08/04
- Re: File local setting for export directory?,
Loris Bennett <=
- Re: File local setting for export directory?, Eric Abrahamsen, 2020/08/04