pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
;;; citeproc.el --- A CSL 1.0.2 Citation Processor -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2017-2021 András Simonyi
|
||||
;; Copyright (C) 2017-2022 András Simonyi
|
||||
|
||||
;; Author: András Simonyi <andras.simonyi@gmail.com>
|
||||
;; Maintainer: András Simonyi <andras.simonyi@gmail.com>
|
||||
;; URL: https://github.com/andras-simonyi/citeproc-el
|
||||
;; Keywords: bib
|
||||
;; Package-Requires: ((emacs "25") (dash "2.13.0") (s "1.12.0") (f "0.18.0") (queue "0.2") (string-inflection "1.0") (org "9") (parsebib "2.4"))
|
||||
;; Package-Requires: ((emacs "26") (dash "2.13.0") (s "1.12.0") (f "0.18.0") (queue "0.2") (string-inflection "1.0") (org "9") (parsebib "2.4"))
|
||||
;; Version: 0.9
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
@@ -105,10 +105,24 @@ effect of adding all items available in the itemgetter."
|
||||
(setf (citeproc-proc-finalized proc) nil))
|
||||
|
||||
(defun citeproc-add-subbib-filters (filters proc)
|
||||
"Add subbib FILTERS to PROC.
|
||||
FILTERS should be a list of alists in which the keys are one of
|
||||
the symbols `type', `nottype', `keyword', `notkeyword', and
|
||||
values are strings."
|
||||
"Add sub-bibliography FILTERS to PROC.
|
||||
FILTERS should be a list of alists containing symbol keys and
|
||||
string values, each pair describing an atomic condition to be
|
||||
satisified by the printed entries. The following keys are
|
||||
supported:
|
||||
- `type': print only entries of the given type. Type is the
|
||||
bib(la)tex entry type if available, otherwise the CSL type is
|
||||
used as fallback;
|
||||
- `nottype': print only entries not of the given type. Type is
|
||||
the bib(la)tex entry type if available, otherwise the CSL type
|
||||
is used as fallback;
|
||||
- `csltype', `notcsltype': same as `type' and `nottype' but uses
|
||||
the entries' CSL type even if the bib(la)tex type is also
|
||||
available;
|
||||
- `keyword': print only entries with the given keyword;
|
||||
- `notkeyword': print only entries without the given keyword;
|
||||
- `filter': print only entries for which the function named by
|
||||
the key returns a non-nil value."
|
||||
(setf (citeproc-proc-bib-filters proc) filters
|
||||
(citeproc-proc-finalized proc) nil))
|
||||
|
||||
@@ -182,23 +196,36 @@ formatting parameters keyed to the parameter names as symbols:
|
||||
punct-in-quote)))
|
||||
itemdata)
|
||||
(let* ((raw-bib
|
||||
(if filters
|
||||
;; There are filters, we need to select and sort the subbibs.
|
||||
(let ((result (make-list (length filters) nil))
|
||||
(bib-sort (citeproc-style-bib-sort (citeproc-proc-style proc))))
|
||||
(if (cdr filters)
|
||||
;; There are several filters, we need to select and sort the subbibs.
|
||||
(let* ((nr-of-filters (length filters))
|
||||
(result (make-list nr-of-filters nil))
|
||||
;; We store boolean to-be-sorted flags for each sub-bib
|
||||
(to-be-sorted (make-bool-vector nr-of-filters nil))
|
||||
(bib-sort (citeproc-style-bib-sort (citeproc-proc-style proc))))
|
||||
;; Put the itds into subbib lists.
|
||||
(maphash
|
||||
(lambda (_ itd)
|
||||
(dolist (subbib-no (citeproc-itemdata-subbib-nos itd))
|
||||
(push itd (elt result subbib-no))))
|
||||
(let ((subbib-nos (citeproc-itemdata-subbib-nos itd)))
|
||||
;; Set to-be-sorted for later subbibs if itemdata
|
||||
;; occcurs in more than one.
|
||||
(when-let ((later-subbib-nos (cdr subbib-nos)))
|
||||
(dolist (subbib-no later-subbib-nos)
|
||||
(setf (elt to-be-sorted subbib-no) t)))
|
||||
;; Push the item in all corresponding subbibs.
|
||||
(dolist (subbib-no subbib-nos)
|
||||
(push itd (elt result subbib-no)))))
|
||||
itemdata)
|
||||
;; Sort the itds in each list according to the sort settings
|
||||
;; Sort the itds in each individual list
|
||||
(setq result
|
||||
(--map (if bib-sort
|
||||
(citeproc-sort-itds it (citeproc-style-bib-sort-orders
|
||||
(citeproc-proc-style proc)))
|
||||
(citeproc-sort-itds-on-citnum it))
|
||||
result))
|
||||
(--map-indexed
|
||||
(if (and bib-sort (elt to-be-sorted it-index))
|
||||
;; Subbib contains earlier item, needs to sorted.
|
||||
(citeproc-sort-itds it (citeproc-style-bib-sort-orders
|
||||
(citeproc-proc-style proc)))
|
||||
;; No earlier item, sorting on citation-number.
|
||||
(citeproc-sort-itds-on-citnum it))
|
||||
result))
|
||||
;; Generate the raw bibs.
|
||||
(--map (mapcar #'citeproc-itemdata-rawbibitem it) result))
|
||||
;; No filters, so raw-bib is a list containg a single raw bibliograhy.
|
||||
|
||||
Reference in New Issue
Block a user