From 09fea13de97629df79c8951bca3c6b82107fcbe9 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 23 Nov 2023 19:46:15 +0100 Subject: [PATCH] update bibtex Signed-off-by: Andreas Gerler --- .../bibtex-completion-pkg.el | 2 -- .../bibtex-completion-autoloads.el | 4 +++ .../bibtex-completion-pkg.el | 19 +++++++++++++ .../bibtex-completion.el | 28 +++++++++++++------ 4 files changed, 42 insertions(+), 11 deletions(-) delete mode 100644 elpa/bibtex-completion-20220404.1608/bibtex-completion-pkg.el rename elpa/{bibtex-completion-20220404.1608 => bibtex-completion-20230717.959}/bibtex-completion-autoloads.el (96%) create mode 100644 elpa/bibtex-completion-20230717.959/bibtex-completion-pkg.el rename elpa/{bibtex-completion-20220404.1608 => bibtex-completion-20230717.959}/bibtex-completion.el (98%) diff --git a/elpa/bibtex-completion-20220404.1608/bibtex-completion-pkg.el b/elpa/bibtex-completion-20220404.1608/bibtex-completion-pkg.el deleted file mode 100644 index 1ed7e566..00000000 --- a/elpa/bibtex-completion-20220404.1608/bibtex-completion-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; Generated package description from bibtex-completion.el -*- no-byte-compile: t -*- -(define-package "bibtex-completion" "20220404.1608" "A BibTeX backend for completion frameworks" '((parsebib "1.0") (s "1.9.0") (dash "2.6.0") (f "0.16.2") (cl-lib "0.5") (biblio "0.2") (emacs "26.1")) :commit "ce8c17690ddad73d01531084b282f221f8eb6669" :authors '(("Titus von der Malsburg" . "malsburg@posteo.de") ("Justin Burkett" . "justin@burkett.cc")) :maintainer '("Titus von der Malsburg" . "malsburg@posteo.de") :url "https://github.com/tmalsburg/helm-bibtex") diff --git a/elpa/bibtex-completion-20220404.1608/bibtex-completion-autoloads.el b/elpa/bibtex-completion-20230717.959/bibtex-completion-autoloads.el similarity index 96% rename from elpa/bibtex-completion-20220404.1608/bibtex-completion-autoloads.el rename to elpa/bibtex-completion-20230717.959/bibtex-completion-autoloads.el index 8898ba92..b2d8fa9b 100644 --- a/elpa/bibtex-completion-20220404.1608/bibtex-completion-autoloads.el +++ b/elpa/bibtex-completion-20230717.959/bibtex-completion-autoloads.el @@ -42,6 +42,10 @@ Bibtex-Completion-Notes mode. (register-definition-prefixes "bibtex-completion" '("bibtex-completion-")) +;;;*** + +;;;### (autoloads nil nil ("bibtex-completion-pkg.el") (0 0 0 0)) + ;;;*** ;; Local Variables: diff --git a/elpa/bibtex-completion-20230717.959/bibtex-completion-pkg.el b/elpa/bibtex-completion-20230717.959/bibtex-completion-pkg.el new file mode 100644 index 00000000..a83842bf --- /dev/null +++ b/elpa/bibtex-completion-20230717.959/bibtex-completion-pkg.el @@ -0,0 +1,19 @@ +(define-package "bibtex-completion" "20230717.959" "A BibTeX backend for completion frameworks" + '((parsebib "1.0") + (s "1.9.0") + (dash "2.6.0") + (f "0.16.2") + (cl-lib "0.5") + (biblio "0.2") + (emacs "26.1")) + :commit "ef07adfeda1e25d891875cb9a11983d5e26fc36d" :authors + '(("Titus von der Malsburg" . "malsburg@posteo.de") + ("Justin Burkett" . "justin@burkett.cc")) + :maintainers + '(("Titus von der Malsburg" . "malsburg@posteo.de")) + :maintainer + '("Titus von der Malsburg" . "malsburg@posteo.de") + :url "https://github.com/tmalsburg/helm-bibtex") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/bibtex-completion-20220404.1608/bibtex-completion.el b/elpa/bibtex-completion-20230717.959/bibtex-completion.el similarity index 98% rename from elpa/bibtex-completion-20220404.1608/bibtex-completion.el rename to elpa/bibtex-completion-20230717.959/bibtex-completion.el index 59bcc349..30dc3021 100644 --- a/elpa/bibtex-completion-20220404.1608/bibtex-completion.el +++ b/elpa/bibtex-completion-20230717.959/bibtex-completion.el @@ -4,8 +4,6 @@ ;; Justin Burkett ;; Maintainer: Titus von der Malsburg ;; URL: https://github.com/tmalsburg/helm-bibtex -;; Package-Version: 20220404.1608 -;; Package-Commit: ce8c17690ddad73d01531084b282f221f8eb6669 ;; Version: 1.0.0 ;; Package-Requires: ((parsebib "1.0") (s "1.9.0") (dash "2.6.0") (f "0.16.2") (cl-lib "0.5") (biblio "0.2") (emacs "26.1")) @@ -368,7 +366,6 @@ bibliography file is reparsed.") (defvar bibtex-completion-string-hash-table nil "A hash table used for string replacements.") - (defun bibtex-completion-normalize-bibliography (&optional type) "Return a list of bibliography file(s) in `bibtex-completion-bibliography'. If there are org mode bibliography-files, their corresponding @@ -383,7 +380,18 @@ their associated bibtex files." bib-file) for bibtex-file = (if (consp bib-file) (cdr bib-file) - (concat (file-name-sans-extension main-file) ".bib")) + (cond + ((string= (file-name-extension main-file) "bib") main-file) + ((string= (file-name-extension main-file) "org") + (concat (file-name-sans-extension main-file) "bib")) + ((and (string= (file-name-extension main-file) "gpg") + (string= (file-name-extension + (file-name-sans-extension main-file)) "bib")) main-file) + ((and (string= (file-name-extension main-file) "gpg") + (string= (file-name-extension + (file-name-sans-extension main-file)) "org")) + (concat (file-name-sans-extension + (file-name-sans-extension main-file)) ".bib.gpg")))) unless (equal type 'bibtex) collect main-file unless (equal type 'main) @@ -488,7 +496,7 @@ The first element of these conses is a string containing authors, editors, title, year, type, and key of the entry. This string is used for matching. The second element is the entry (only the fields listed above) as an alist." - (let ((files (nreverse (bibtex-completion-normalize-bibliography 'bibtex))) + (let ((files (bibtex-completion-normalize-bibliography 'bibtex)) (ht-strings (make-hash-table :test #'equal)) reparsed-files) @@ -569,10 +577,9 @@ fields listed above) as an alist." ;; Finally return the list of candidates: (message "Done (re)loading bibliography.") - (nreverse - (cl-loop - for file in files - append (cddr (assoc file bibtex-completion-cache)))))) + (cl-loop + for file in files + append (reverse (cddr (assoc file bibtex-completion-cache)))))) (defun bibtex-completion-resolve-crossrefs (files reparsed-files) "Expand all entries with fields from cross-referenced entries in FILES, assuming that only those files in REPARSED-FILES were reparsed whereas the other files in FILES were up-to-date." @@ -1178,6 +1185,9 @@ string if FIELD is not present in ENTRY and DEFAULT is nil." ("editor-abbrev" (when-let ((value (bibtex-completion-get-value "editor" entry))) (bibtex-completion-apa-format-editors-abbrev value))) + ((or "journal" "journaltitle") + (or (bibtex-completion-get-value "journal" entry) + (bibtex-completion-get-value "journaltitle" entry))) (_ ;; Real fields: (let ((value (bibtex-completion-get-value field entry))) -- 2.47.3