emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: Export to attach directory?
Date: Sun, 06 Sep 2020 16:53:52 -0700	[thread overview]
Message-ID: <87imcqsbqn.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87363usgud.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 07 Sep 2020 00:03:38 +0200")

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Eric Abrahamsen <eric@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


      reply	other threads:[~2020-09-06 23:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 17:43 Export to attach directory? Eric Abrahamsen
2020-06-12 19:18 ` [PATCH] " Eric Abrahamsen
2020-09-05  7:44   ` Bastien
2020-09-05  7:47     ` flare
2020-09-05  8:08       ` Bastien
2020-09-06 17:44     ` Eric Abrahamsen
2020-09-06 22:03       ` Nicolas Goaziou
2020-09-06 23:53         ` Eric Abrahamsen [this message]

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=87imcqsbqn.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=bzg@gnu.org \
    --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).