emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 100641b 3/5: oc-biblatex: Refactor code to simplify


From: ELPA Syncer
Subject: [elpa] externals/org 100641b 3/5: oc-biblatex: Refactor code to simplify byte-compilation
Date: Wed, 11 Aug 2021 05:57:19 -0400 (EDT)

branch: externals/org
commit 100641bc5a7df388f0880092856720b7d9ac5ff1
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    oc-biblatex: Refactor code to simplify byte-compilation
    
    * lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Refactor
    code.
    
    Reported-by: Maxim Nikulin <manikulin@gmail.com>
    <http://lists.gnu.org/r/emacs-orgmode/2021-08/msg00100.html>
---
 lisp/oc-biblatex.el | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/lisp/oc-biblatex.el b/lisp/oc-biblatex.el
index c82a770..51fe804 100644
--- a/lisp/oc-biblatex.el
+++ b/lisp/oc-biblatex.el
@@ -221,27 +221,35 @@ a property list."
    #'org-cite-biblatex--command citation info
    (pcase style
      ;; "author" style.
-     (`(,(or "author" "a") . ,(or "caps" "c"))         '("Citeauthor*"))
-     (`(,(or "author" "a") . ,(or "full" "f"))         '("citeauthor"))
-     (`(,(or "author" "a") . ,(or "caps-full" "cf"))   '("Citeauthor"))
-     (`(,(or "author" "a") . ,_)                       '("citeauthor*"))
+     (`(,(or "author" "a") . ,variant)
+      (pcase variant
+        ((or "caps" "c")            '("Citeauthor*"))
+        ((or "full" "f")            '("citeauthor"))
+        ((or "caps-full" "cf")      '("Citeauthor"))
+        (_                          '("citeauthor*"))))
      ;; "locators" style.
-     (`(,(or "locators" "l") . ,(or "bare" "b"))       '("notecite"))
-     (`(,(or "locators" "l") . ,(or "caps" "c"))       '("Pnotecite"))
-     (`(,(or "locators" "l") . ,(or "bare-caps" "bc")) '("Notecite"))
-     (`(,(or "locators" "l") . ,_)                     '("pnotecite"))
+     (`(,(or "locators" "l") . ,variant)
+      (pcase variant
+        ((or "bare" "b")            '("notecite"))
+        ((or "caps" "c")            '("Pnotecite"))
+        ((or "bare-caps" "bc")      '("Notecite"))
+        (_                          '("pnotecite"))))
      ;; "noauthor" style.
-     (`(,(or "noauthor" "na") . ,_)                    '("autocite*"))
+     (`(,(or "noauthor" "na") . ,_) '("autocite*"))
      ;; "nocite" style.
-     (`(,(or "nocite" "n") . ,_)                       '("nocite" nil t))
+     (`(,(or "nocite" "n") . ,_)    '("nocite" nil t))
      ;; "text" style.
-     (`(,(or "text" "t") . ,(or "caps" "c"))           '("Textcite" t))
-     (`(,(or "text" "t") . ,_)                         '("textcite" t))
+     (`(,(or "text" "t") . ,variant)
+      (pcase variant
+        ((or "caps" "c")            '("Textcite" t))
+        (_                          '("textcite" t))))
      ;; Default "nil" style.
-     (`(,_ . ,(or "bare" "b"))                         '("cite" t))
-     (`(,_ . ,(or "caps" "c"))                         '("Autocite" t))
-     (`(,_ . ,(or "bare-caps" "bc"))                   '("Cite" t))
-     (`(,_ . ,_)                                       '("autocite" t))
+     (`(,_ . ,variant)
+      (pcase variant
+        ((or "bare" "b")            '("cite" t))
+        ((or "caps" "c")            '("Autocite" t))
+        ((or "bare-caps" "bc")      '("Cite" t))
+        (_                          '("autocite" t))))
      ;; This should not happen.
      (_ (error "Invalid style: %S" style)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]