[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 22de2e26e7 2/2: Fix Emacs 26 compatibility
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 22de2e26e7 2/2: Fix Emacs 26 compatibility |
Date: |
Sun, 24 Jul 2022 09:57:45 -0400 (EDT) |
branch: externals/org
commit 22de2e26e791163bccc87ceb9692fbffbb407b4c
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
Fix Emacs 26 compatibility
* lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Do not use
`seq-first'.
* lisp/org-persist.el (org-persist-collection-let): Suppress warnings.
* lisp/ox-latex.el (org-latex-src--engrave-mathescape-p): Do not use
`if-let'.
(org-latex-src--engrave-code): Do not use `string-trim-right'.
* lisp/ox.el (org-export-link-localise): Add require for subr-x for
`thread-first'.
---
lisp/oc-biblatex.el | 2 +-
lisp/org-persist.el | 5 ++---
lisp/ox-latex.el | 10 +++++-----
lisp/ox.el | 1 +
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lisp/oc-biblatex.el b/lisp/oc-biblatex.el
index 0031ec48b8..6221286eb4 100644
--- a/lisp/oc-biblatex.el
+++ b/lisp/oc-biblatex.el
@@ -363,7 +363,7 @@ INFO is the export state, as a property list."
(_ nil))))
(apply
#'org-cite-biblatex--command citation info
- (pcase (seq-first candidates)
+ (pcase (seq-elt candidates 0) ;; `seq-first' is not available in Emacs 26.
(`(,_ ,_ . ,command-parameters) command-parameters)
('nil
(user-error
diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index a30c75f38e..ee28fc51d5 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -358,15 +358,14 @@ FORMAT and ARGS are passed to `message'."
"Bind container and associated from COLLECTION and execute BODY."
(declare (debug (form body)) (indent 1))
`(with-no-warnings
- ;; FIXME: We only need to suppress warnings about unused
- ;; let-bindings. However, it is unclear how to achieve it with
- ;; `with-suppressed-warnings'.
(let* ((container (plist-get ,collection :container))
(associated (plist-get ,collection :associated))
(path (plist-get associated :file))
(inode (plist-get associated :inode))
(hash (plist-get associated :hash))
(key (plist-get associated :key)))
+ ;; Suppress "unused variable" warnings.
+ (ignore container associated path inode hash key)
,@body)))
(defun org-persist--find-index (collection)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6cd7514090..0d1d05f748 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -3420,10 +3420,10 @@ and FLOAT are extracted from SRC-BLOCK and INFO in
`org-latex-src-block'."
(equal '("false") (cdr opt)))
'no)))))
opts))))
- (if-let ((mathescape (or (funcall mathescape-status default-options)
- (funcall mathescape-status options))))
- (when (eq mathescape 'yes)
- (or engrave-faces-latex-mathescape t)))))
+ (let ((mathescape (or (funcall mathescape-status default-options)
+ (funcall mathescape-status options))))
+ (when (eq mathescape 'yes)
+ (or engrave-faces-latex-mathescape t)))))
(defun org-latex-src--engrave-code (content lang &optional theme options
inline)
"Engrave CONTENT to LaTeX in a LANG-mode buffer, and give the result.
@@ -3443,7 +3443,7 @@ to the Verbatim environment or Verb command."
engrave-faces-current-preset-style))
(engraved-buffer
(with-temp-buffer
- (insert (string-trim-right content "\n"))
+ (insert (replace-regexp-in-string "\n\\'" "" content))
(when lang-mode
(if (functionp lang-mode)
(funcall lang-mode)
diff --git a/lisp/ox.el b/lisp/ox.el
index 03af47001f..8223940fb6 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4520,6 +4520,7 @@ Return value can be an object or an element:
(org-persist-register location-type path
:write-immediately t))))
+(require 'subr-x) ;; FIXME: For `thread-first' in Emacs 26.
(defun org-export-link-localise (link)
"Convert remote LINK to local link.
If LINK refers to a remote resource, modify it to point to a local