Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Hello, > > Eric Abrahamsen <e...@ericabrahamsen.net> writes: > >> Subject: [PATCH] Add EXPORT_DIRECTORY property >> >> * lisp/ox.el (org-export-output-file-name): Check for this property >> and place the exported output file there. >> * doc/org-manual.org: Document. > > Doesn't it conflict with publishing, and with EXPORT_FILE_NAME > property/keyword? In both, you can already specify an output directory.
I did look at making this work with the publishing framework. The problem is that ox-publish looks like it will only do one or more files, whereas I'm trying to publish a subtree. More particularly, if there were a way to pass the PUB-DIR argument to `org-export-output-file-name', that would take care of it. But I can only export a subtree via the export dispatcher, and the export dispatcher only calls `org-*-export-to-*' functions, and all of those functions contain their own call to `org-export-output-file-name', so there's no clean way to inject PUB-DIR anywhere. You can't really wait until `org-export-as' does its general keyword gathering, either, since EXPORT_FILE_NAME and EXPORT_DIRECTORY both need to be available to `org-export-to-file'. So finding EXPORT_DIRECTORY in `org-export-output-file-name' seemed like the only option. I was imagining that EXPORT_FILE_NAME would take precedence, if it was an absolute filepath. Otherwise, the two options could be complementary. >> + (org-with-point-at (point-min) >> + (catch :found >> + (let ((case-fold-search t)) >> + (while (re-search-forward >> + "^[ \t]*#\\+EXPORT_DIRECTORY:[ \t]+\\S-" >> + nil t) >> + (let ((element (org-element-at-point))) >> + (when (eq 'keyword (org-element-type element)) >> + (throw :found >> + (org-element-property >> + :value element)))))))))) > > See `org-collect-keywords'. I don't have this function! org-version -> "9.3.7" Thanks, Eric