Ihor Radchenko writes:
> Jack Kamm <[email protected]> writes:
>
>> Yes I think that would be good.
>>
>> Where should the .py file go? Maybe under etc or a subfolder thereof?
>
> /etc sounds reasonable.
> I am adding Kyle to the discussion.
> Kyle, on Emacs repository side, we have /etc/org/. Do you think it will
> be OK to put a .py file in there?
I think that should be fine. (I don't recall any objections from the
Emacs side when etc/org/csl/ was added.)
> I think (1) is reasonable, because it is something we already do in
> ox-odt:
>
> (defconst org-odt-lib-dir
> (file-name-directory (or load-file-name (buffer-file-name)))
> "Location of ODT exporter.
> Use this to infer values of `org-odt-styles-dir' and
> `org-odt-schema-dir'.")
>
> (defvar org-odt-data-dir (expand-file-name "../../etc/" org-odt-lib-dir)
> "Data directory for ODT exporter.
> Use this to infer values of `org-odt-styles-dir' and
> `org-odt-schema-dir'.")
It's probably also worth considering org-cite-csl--etc-dir's logic:
(defconst org-cite-csl--etc-dir
(let ((oc-root (file-name-directory (locate-library "oc"))))
(cond
;; First check whether it looks like we're running from the main
;; Org repository.
((let ((csl-org (expand-file-name "../etc/csl/" oc-root)))
(and (file-directory-p csl-org) csl-org)))
;; Next look for the directory alongside oc.el because package.el
;; and straight will put all of org-mode/lisp/ in org-mode/.
((let ((csl-pkg (expand-file-name "etc/csl/" oc-root)))
(and (file-directory-p csl-pkg) csl-pkg)))
;; Finally fall back the location used by shared system installs
;; and when running directly from Emacs repository.
(t
(expand-file-name "org/csl/" data-directory))))
"Directory containing CSL-related data files.")