[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 60b178e 5/7: oc-csl: Locate etc/csl for sys
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 60b178e 5/7: oc-csl: Locate etc/csl for system installs and Emacs repo |
Date: |
Sat, 2 Oct 2021 01:03:30 -0400 (EDT) |
branch: externals-release/org
commit 60b178e5962cd9023026f77483a3d4d2920967ee
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>
oc-csl: Locate etc/csl for system installs and Emacs repo
* lisp/oc-csl.el (org-cite-csl--etc-dir): Add `data-directory' case,
using it as the fallback. Also, use the more specific
file-directory-p rather than file-exists-p to inspect the candidates.
When using Org from the system installation, the CSL files will be
available in the etc/org/csl/ subdirectory underneath
`data-directory'. (This requires the etc/csl/ files to be synced to
the Emacs repo under etc/org/csl.)
Give the Org repository and package cases precedence because they are
anchored to a specific oc.el location while, for Emacs releases with
Org 9.5 or later, the data-directory files will typically always be
present.
---
lisp/oc-csl.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index cf3538b..4a6adeb 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -183,14 +183,20 @@ Used only when `second-field-align' is activated by the
used CSL style."
;;; Internal variables
(defconst org-cite-csl--etc-dir
- (let* ((oc-root (file-name-directory (locate-library "oc")))
- (oc-etc-dir-1 (expand-file-name "../etc/csl/" oc-root)))
- ;; package.el and straight will put all of org-mode/lisp/ in org-mode/.
- ;; This will cause .. to resolve to the directory above Org.
- ;; To make life easier for people using package.el or straight, we can
- ;; check to see if ../etc/csl exists, and if it doesn't try ./etc/csl.
- (if (file-exists-p oc-etc-dir-1) oc-etc-dir-1
- (expand-file-name "etc/csl/" oc-root)))
+ (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 \"etc/\" from repository.")
(defconst org-cite-csl--fallback-locales-dir org-cite-csl--etc-dir
- [elpa] externals-release/org updated (d19660b -> 9cc7f8b), ELPA Syncer, 2021/10/02
- [elpa] externals-release/org e83ee60 2/7: Backport commit d50597189 from Emacs, ELPA Syncer, 2021/10/02
- [elpa] externals-release/org 60b178e 5/7: oc-csl: Locate etc/csl for system installs and Emacs repo,
ELPA Syncer <=
- [elpa] externals-release/org fa31598 3/7: org-do-emphasis-faces: Never treat closing marker as next opening marker, ELPA Syncer, 2021/10/02
- [elpa] externals-release/org d0f774b 4/7: Merge branch 'km/from-emacs-28' into bugfix, ELPA Syncer, 2021/10/02
- [elpa] externals-release/org 9cc7f8b 7/7: etc/csl: Add a README in preparation for Emacs sync, ELPA Syncer, 2021/10/02
- [elpa] externals-release/org 7dcdf98 1/7: Backport commit f1f57a541 from Emacs, ELPA Syncer, 2021/10/02
- [elpa] externals-release/org 0f11a44 6/7: org-cite-csl--etc-dir: Broaden docstring description, ELPA Syncer, 2021/10/02