From 2d3b198edd2df704bededf682e29bb9fe318b444 Mon Sep 17 00:00:00 2001 From: Andras Simonyi Date: Sat, 2 Mar 2024 09:05:50 +0100 Subject: [PATCH] Replace the cite-note attribute of style objects with category --- citeproc-context.el | 2 +- citeproc-style.el | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/citeproc-context.el b/citeproc-context.el index c32940e..b1cb745 100644 --- a/citeproc-context.el +++ b/citeproc-context.el @@ -214,7 +214,7 @@ documentation of `citeproc-render-varlist-in-rt', while MODE is the rendering mode, `bib' or `cite', and CITE-POS is a cite position. Returns an appropriate attribute to be added or nil if no internal links should be produced." - (let ((note-style (citeproc-style-cite-note style))) + (let ((note-style (string= (citeproc-style-category style) "note"))) (unless (or (and internal-links (not (memq internal-links '(auto bib-links)))) (and note-style (eq mode 'bib) (or (null internal-links) (eq internal-links 'auto)))) diff --git a/citeproc-style.el b/citeproc-style.el index e7dd4c7..5b7181c 100644 --- a/citeproc-style.el +++ b/citeproc-style.el @@ -49,7 +49,7 @@ BIB-SORT-ORDERS and CITE-SORT-ORDERS are the lists of sort orders the n-th key should be in ascending or desending order, CITE-LAYOUT-ATTRS contains the attributes of the citation layout as an alist, -CITE-NOTE is non-nil iff the style's citation-format is \"note\", +CATEGORY is the style's category as a string, DATE-TEXT and DATE-NUMERIC are the style's date formats, LOCALE contains the locale to be used or nil if not set, MACROS is an alist with macro names as keys and corresponding @@ -58,7 +58,7 @@ TERMS is the style's parsed term-list, USES-YS-VAR is non-nil iff the style uses the YEAR-SUFFIX CSL-variable." info opts bib-opts bib-sort bib-sort-orders - bib-layout cite-opts cite-note cite-sort cite-sort-orders + bib-layout cite-opts category cite-sort cite-sort-orders cite-layout cite-layout-attrs locale-opts macros terms uses-ys-var date-text date-numeric locale) @@ -98,12 +98,12 @@ in-style locale information will be loaded (if available)." (--each (cddr parsed-style) (pcase (car it) ('info - (let ((info-lst (cddr it))) + (let* ((info-lst (cddr it)) + (category-info (cl-find-if (lambda (x) (eq 'category (car x))) + info-lst)) + (category (cdaadr category-info))) (setf (citeproc-style-info style) info-lst - (citeproc-style-cite-note style) - (not (not (member '(category - ((citation-format . "note"))) - info-lst)))))) + (citeproc-style-category style) category))) ('locale (let ((lang (alist-get 'lang (cadr it)))) (when (and (citeproc-locale--compatible-p lang locale)