From 1e09c024e2c634b18c64ba80e3abddf1ae49ce11 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 23 Nov 2023 19:30:47 +0100 Subject: [PATCH] update biblio Signed-off-by: Andreas Gerler --- elpa/biblio-20190624.1408/biblio-pkg.el | 6 -- .../biblio-arxiv.el | 8 +- .../biblio-autoloads.el | 28 +++---- .../biblio-crossref.el | 6 +- .../biblio-dblp.el | 9 +-- .../biblio-dissemin.el | 8 +- .../biblio-doi.el | 23 +++--- .../biblio-download.el | 4 +- .../biblio-hal.el | 4 +- .../biblio-ieee.el | 6 +- elpa/biblio-20230202.1721/biblio-pkg.el | 13 ++++ .../biblio.el | 16 ++-- .../biblio-core-pkg.el | 2 - .../biblio-core-autoloads.el | 8 +- .../biblio-core-pkg.el | 17 ++++ .../biblio-core.el | 78 ++++++++++++++----- 16 files changed, 148 insertions(+), 88 deletions(-) delete mode 100644 elpa/biblio-20190624.1408/biblio-pkg.el rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-arxiv.el (95%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-autoloads.el (77%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-crossref.el (96%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-dblp.el (90%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-dissemin.el (95%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-doi.el (87%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-download.el (94%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-hal.el (97%) rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio-ieee.el (95%) create mode 100644 elpa/biblio-20230202.1721/biblio-pkg.el rename elpa/{biblio-20190624.1408 => biblio-20230202.1721}/biblio.el (88%) delete mode 100644 elpa/biblio-core-20190624.1408/biblio-core-pkg.el rename elpa/{biblio-core-20190624.1408 => biblio-core-20230202.1721}/biblio-core-autoloads.el (83%) create mode 100644 elpa/biblio-core-20230202.1721/biblio-core-pkg.el rename elpa/{biblio-core-20190624.1408 => biblio-core-20230202.1721}/biblio-core.el (92%) diff --git a/elpa/biblio-20190624.1408/biblio-pkg.el b/elpa/biblio-20190624.1408/biblio-pkg.el deleted file mode 100644 index ffc6a5fc..00000000 --- a/elpa/biblio-20190624.1408/biblio-pkg.el +++ /dev/null @@ -1,6 +0,0 @@ -(define-package "biblio" "20190624.1408" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org" - '((emacs "24.3") - (biblio-core "0.2"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/biblio-20190624.1408/biblio-arxiv.el b/elpa/biblio-20230202.1721/biblio-arxiv.el similarity index 95% rename from elpa/biblio-20190624.1408/biblio-arxiv.el rename to elpa/biblio-20230202.1721/biblio-arxiv.el index e5498a26..81660c56 100644 --- a/elpa/biblio-20190624.1408/biblio-arxiv.el +++ b/elpa/biblio-20230202.1721/biblio-arxiv.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; @@ -84,7 +84,7 @@ primaryClass = {%s}}" (defun biblio-arxiv--pdf-url (id) "Extract PDF url from ID of an arXiv entry." (when id - (concat "http://arxiv.org/pdf/" id))) + (concat "https://arxiv.org/pdf/" id))) (defun biblio-arxiv--extract-interesting-fields (entry) "Prepare an arXiv search result ENTRY for display." @@ -116,7 +116,7 @@ primaryClass = {%s}}" (defun biblio-arxiv--url (query) "Create an arXiv url to look up QUERY." - (format "http://export.arxiv.org/api/query?search_query=%s" + (format "https://export.arxiv.org/api/query?search_query=%s" (url-encode-url query))) ;;;###autoload diff --git a/elpa/biblio-20190624.1408/biblio-autoloads.el b/elpa/biblio-20230202.1721/biblio-autoloads.el similarity index 77% rename from elpa/biblio-20190624.1408/biblio-autoloads.el rename to elpa/biblio-20230202.1721/biblio-autoloads.el index 1ebfebc7..793e61f8 100644 --- a/elpa/biblio-20190624.1408/biblio-autoloads.el +++ b/elpa/biblio-20230202.1721/biblio-autoloads.el @@ -1,4 +1,4 @@ -;;; biblio-autoloads.el --- automatically extracted autoloads +;;; biblio-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -24,7 +24,7 @@ Start an arXiv search for QUERY, prompting if needed. (defalias 'arxiv-lookup 'biblio-arxiv-lookup) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-arxiv" '("biblio-arxiv-"))) +(register-definition-prefixes "biblio-arxiv" '("biblio-arxiv-")) ;;;*** @@ -47,7 +47,7 @@ Start a CrossRef search for QUERY, prompting if needed. (defalias 'crossref-lookup 'biblio-crossref-lookup) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-crossref" '("biblio-crossref-"))) +(register-definition-prefixes "biblio-crossref" '("biblio-crossref-")) ;;;*** @@ -69,7 +69,7 @@ Start a DBLP search for QUERY, prompting if needed. (defalias 'dblp-lookup 'biblio-dblp-lookup) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-dblp" '("biblio-dblp--"))) +(register-definition-prefixes "biblio-dblp" '("biblio-dblp--")) ;;;*** @@ -87,25 +87,23 @@ Interactively, or if CLEANUP is non-nil, pass DOI through (defalias 'dissemin-lookup 'biblio-dissemin-lookup) (autoload 'biblio-dissemin--register-action "biblio-dissemin" "\ -Add Dissemin to list of `biblio-selection-mode' actions. - -\(fn)" nil nil) +Add Dissemin to list of `biblio-selection-mode' actions." nil nil) (add-hook 'biblio-selection-mode-hook #'biblio-dissemin--register-action) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-dissemin" '("biblio-dissemin--"))) +(register-definition-prefixes "biblio-dissemin" '("biblio-dissemin--")) ;;;*** ;;;### (autoloads nil "biblio-doi" "biblio-doi.el" (0 0 0 0)) ;;; Generated autoloads from biblio-doi.el -(autoload 'doi-insert-bibtex "biblio-doi" "\ +(autoload 'biblio-doi-insert-bibtex "biblio-doi" "\ Insert BibTeX entry matching DOI. \(fn DOI)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-doi" '("biblio-doi-"))) +(register-definition-prefixes "biblio-doi" '("biblio-doi-" "doi-insert-bibtex")) ;;;*** @@ -114,13 +112,11 @@ Insert BibTeX entry matching DOI. ;;; Generated autoloads from biblio-download.el (autoload 'biblio-download--register-action "biblio-download" "\ -Add download to list of `biblio-selection-mode' actions. - -\(fn)" nil nil) +Add download to list of `biblio-selection-mode' actions." nil nil) (add-hook 'biblio-selection-mode-hook #'biblio-download--register-action) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-download" '("biblio-download-"))) +(register-definition-prefixes "biblio-download" '("biblio-download-")) ;;;*** @@ -142,7 +138,7 @@ Start a HAL search for QUERY, prompting if needed. (defalias 'hal-lookup 'biblio-hal-lookup) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-hal" '("biblio-hal--"))) +(register-definition-prefixes "biblio-hal" '("biblio-hal--")) ;;;*** @@ -164,7 +160,7 @@ Start a IEEE search for QUERY, prompting if needed. (defalias 'ieee-lookup 'biblio-ieee-lookup) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-ieee" '("biblio-ieee--"))) +(register-definition-prefixes "biblio-ieee" '("biblio-ieee--")) ;;;*** diff --git a/elpa/biblio-20190624.1408/biblio-crossref.el b/elpa/biblio-20230202.1721/biblio-crossref.el similarity index 96% rename from elpa/biblio-20190624.1408/biblio-crossref.el rename to elpa/biblio-20230202.1721/biblio-crossref.el index 8ad57784..f0a25347 100644 --- a/elpa/biblio-20190624.1408/biblio-crossref.el +++ b/elpa/biblio-20230202.1721/biblio-crossref.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; @@ -80,7 +80,7 @@ more details." (defun biblio-crossref--url (query) "Create a CrossRef url to look up QUERY." - (format "http://api.crossref.org/works?query=%s%s" + (format "https://api.crossref.org/works?query=%s%s" (url-encode-url query) (if biblio-crossref-user-email-address (format "&mailto=%s" (url-encode-url biblio-crossref-user-email-address)) ""))) diff --git a/elpa/biblio-20190624.1408/biblio-dblp.el b/elpa/biblio-20230202.1721/biblio-dblp.el similarity index 90% rename from elpa/biblio-20190624.1408/biblio-dblp.el rename to elpa/biblio-20230202.1721/biblio-dblp.el index 1e23c076..5eacd2be 100644 --- a/elpa/biblio-20190624.1408/biblio-dblp.el +++ b/elpa/biblio-20230202.1721/biblio-dblp.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; @@ -38,8 +38,7 @@ (lambda () ;; No allowed errors, so no arguments "Parse DBLP BibTeX results." (funcall forward-to - (biblio-format-bibtex - (biblio-response-as-utf-8)))))))) + (biblio-response-as-utf-8))))))) (defun biblio-dblp--extract-interesting-fields (item) "Prepare a DBLP search result ITEM for display." @@ -66,7 +65,7 @@ (defun biblio-dblp--url (query) "Create a DBLP url to look up QUERY." - (format "http://dblp.uni-trier.de/search/publ/api?q=%s&format=xml" (url-encode-url query))) + (format "https://dblp.uni-trier.de/search/publ/api?q=%s&format=xml" (url-encode-url query))) ;;;###autoload (defun biblio-dblp-backend (command &optional arg &rest more) diff --git a/elpa/biblio-20190624.1408/biblio-dissemin.el b/elpa/biblio-20230202.1721/biblio-dissemin.el similarity index 95% rename from elpa/biblio-20190624.1408/biblio-dissemin.el rename to elpa/biblio-20230202.1721/biblio-dissemin.el index 7463f7e3..73980ab4 100644 --- a/elpa/biblio-20190624.1408/biblio-dissemin.el +++ b/elpa/biblio-20230202.1721/biblio-dissemin.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; @@ -69,7 +69,7 @@ (insert "\n\nDid you write this paper? ") (biblio-with-fontification '(:weight bold) (insert - (biblio-make-url-button (format "http://dissem.in/%s" doi) "upload it"))) + (biblio-make-url-button (format "https://dissem.in/%s" doi) "upload it"))) (insert "!\n")) (defun biblio-dissemin--pretty-print (paper doi) @@ -114,7 +114,7 @@ (defun biblio-dissemin--url (doi) "Create a DBLP url to look up DOI." - (format "http://dissem.in/api/%s" (url-encode-url doi))) + (format "https://dissem.in/api/%s" (url-encode-url doi))) (defun biblio-dissemin--callback (doi) "Generate a callback to parse Dissemin results for DOI." diff --git a/elpa/biblio-20190624.1408/biblio-doi.el b/elpa/biblio-20230202.1721/biblio-doi.el similarity index 87% rename from elpa/biblio-20190624.1408/biblio-doi.el rename to elpa/biblio-20230202.1721/biblio-doi.el index e4b1a4e9..308d4efe 100644 --- a/elpa/biblio-20190624.1408/biblio-doi.el +++ b/elpa/biblio-20230202.1721/biblio-doi.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: @@ -35,17 +35,17 @@ (defun biblio-doi--dx-url (doi) "Create a doi.org url for DOI." - (format "http://doi.org/%s" doi)) + (format "https://doi.org/%s" doi)) (defun biblio-doi--crosscite-url (doi) "Create a crosscite URL to use as a fallback for DOI. Not all content providers provide BibTeX formatted entries, so instead of failing reroute the request through crosscite, which requests a generic format and crates the BibTeX on its own." - (format "http://crosscite.org/citeproc/format?doi=%s&style=bibtex&lang=en-US" doi)) + (format "https://crosscite.org/citeproc/format?doi=%s&style=bibtex&lang=en-US" doi)) (defconst biblio-doi--dx-mime-accept - ;; “Accept:” header; Zenodo recognize x-bibtex but not text/bibliography + ;; “Accept:” header; Zenodo recognizes x-bibtex but not text/bibliography "text/bibliography;style=bibtex, application/x-bibtex") (defun biblio-doi--set-mime-accept () @@ -68,9 +68,7 @@ requests a generic format and crates the BibTeX on its own." (defun biblio-doi--generic-url-callback-1 (errors forward-to) "Helper function for `biblio-doi--generic-url-callback'. ERRORS, FORWARD-TO: see there." - (funcall forward-to - (unless errors - (biblio-format-bibtex (biblio-response-as-utf-8))))) + (funcall forward-to (unless errors (biblio-response-as-utf-8)))) (defun biblio-doi--generic-url-callback (cleanup-fn forward-to) "Make an URL-ready callback. @@ -111,13 +109,18 @@ FORWARD-TO is the callback to call with the results of the search." (biblio-doi--forward-bibtex-crosscite doi forward-to))))) ;;;###autoload -(defun doi-insert-bibtex (doi) +(defun biblio-doi-insert-bibtex (doi) "Insert BibTeX entry matching DOI." (interactive "MDOI: ") (let ((target-buffer (current-buffer))) (biblio-doi-forward-bibtex (biblio-cleanup-doi doi) - (lambda (result) (biblio-doi--insert result target-buffer))))) + (lambda (result) + (biblio-doi--insert + (biblio-format-bibtex result biblio-bibtex-use-autokey) + target-buffer))))) + +(defalias 'doi-insert-bibtex 'biblio-doi-insert-bibtex) (provide 'biblio-doi) ;;; biblio-doi.el ends here diff --git a/elpa/biblio-20190624.1408/biblio-download.el b/elpa/biblio-20230202.1721/biblio-download.el similarity index 94% rename from elpa/biblio-20190624.1408/biblio-download.el rename to elpa/biblio-20230202.1721/biblio-download.el index ef8acaeb..6e937b85 100644 --- a/elpa/biblio-20190624.1408/biblio-download.el +++ b/elpa/biblio-20230202.1721/biblio-download.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; diff --git a/elpa/biblio-20190624.1408/biblio-hal.el b/elpa/biblio-20230202.1721/biblio-hal.el similarity index 97% rename from elpa/biblio-20190624.1408/biblio-hal.el rename to elpa/biblio-20230202.1721/biblio-hal.el index 0d2b0154..d5072c67 100644 --- a/elpa/biblio-20190624.1408/biblio-hal.el +++ b/elpa/biblio-20230202.1721/biblio-hal.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; diff --git a/elpa/biblio-20190624.1408/biblio-ieee.el b/elpa/biblio-20230202.1721/biblio-ieee.el similarity index 95% rename from elpa/biblio-20190624.1408/biblio-ieee.el rename to elpa/biblio-20230202.1721/biblio-ieee.el index 39b16f8e..26b30dfe 100644 --- a/elpa/biblio-20190624.1408/biblio-ieee.el +++ b/elpa/biblio-20230202.1721/biblio-ieee.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; @@ -35,7 +35,7 @@ "API key used to query IEEE; for use only with biblio.el!") (defconst biblio-ieee--api-root-url - "http://ieeexploreapi.ieee.org/api/v1/search/articles") + "https://ieeexploreapi.ieee.org/api/v1/search/articles") (defun biblio-ieee--forward-bibtex (metadata forward-to) "Forward BibTeX for IEEE Xplore entry METADATA to FORWARD-TO." diff --git a/elpa/biblio-20230202.1721/biblio-pkg.el b/elpa/biblio-20230202.1721/biblio-pkg.el new file mode 100644 index 00000000..217396dd --- /dev/null +++ b/elpa/biblio-20230202.1721/biblio-pkg.el @@ -0,0 +1,13 @@ +(define-package "biblio" "20230202.1721" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org" + '((emacs "24.3") + (biblio-core "0.2")) + :commit "ee52f6cda82ea6fbc3b400e7b12132595cc0374c" :authors + '(("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) + :maintainer + '("Clément Pit-Claudel" . "clement.pitclaudel@live.com") + :keywords + '("bib" "tex" "convenience" "hypermedia") + :url "https://github.com/cpitclaudel/biblio.el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/biblio-20190624.1408/biblio.el b/elpa/biblio-20230202.1721/biblio.el similarity index 88% rename from elpa/biblio-20190624.1408/biblio.el rename to elpa/biblio-20230202.1721/biblio.el index cfffbca9..949f8290 100644 --- a/elpa/biblio-20190624.1408/biblio.el +++ b/elpa/biblio-20230202.1721/biblio.el @@ -3,10 +3,10 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; Version: 0.2 -;; Package-Requires: ((emacs "24.3") (biblio-core "0.2")) +;; Version: 0.3 +;; Package-Requires: ((emacs "24.3") (biblio-core "0.3")) ;; Keywords: bib, tex, convenience, hypermedia -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; # biblio.el: An extensible Emacs package for browsing and fetching references @@ -61,7 +61,7 @@ ;; ;; ## Examples ;; -;; * To insert a clean BibTeX entry for http://doi.org/10.1145/2676726.2677006 +;; * To insert a clean BibTeX entry for https://doi.org/10.1145/2676726.2677006 ;; in the current buffer, use ;; ;; M-x crossref-lookup RET fiat deductive delaware RET i @@ -71,14 +71,14 @@ ;; ;; * To find publications by computer scientist Leslie Lamport, use ‘M-x ;; dblp-lookup RET author:Lamport RET’ (see more info about DBLP's syntax at -;; ) +;; ) ;; ;; * To check whether an article is freely available online, use ‘x’ in the list ;; of results. For example ‘M-x crossref-lookup RET Emacs stallman RET’ ;; followed by ‘x Dissemin RET’ will help you find open access copies of -;; Stallman's paper on EMACS (spoiler: http://hdl.handle.net/1721.1/5736). +;; Stallman's paper on EMACS (spoiler: https://hdl.handle.net/1721.1/5736). ;; -;; See http://github.com/cpitclaudel/biblio.el for more information, including +;; See https://github.com/cpitclaudel/biblio.el for more information, including ;; documentation on extending this framework. ;;; Code: diff --git a/elpa/biblio-core-20190624.1408/biblio-core-pkg.el b/elpa/biblio-core-20190624.1408/biblio-core-pkg.el deleted file mode 100644 index afd62697..00000000 --- a/elpa/biblio-core-20190624.1408/biblio-core-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "biblio-core" "20190624.1408" "A framework for looking up and displaying bibliographic entries" '((emacs "24.3") (let-alist "1.0.4") (seq "1.11") (dash "2.12.1")) :commit "efeeab720cb8e3f95ddb4298d0cc62393cf237e9" :keywords '("bib" "tex" "convenience" "hypermedia") :authors '(("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) :maintainer '("Clément Pit-Claudel" . "clement.pitclaudel@live.com") :url "http://github.com/cpitclaudel/biblio.el") diff --git a/elpa/biblio-core-20190624.1408/biblio-core-autoloads.el b/elpa/biblio-core-20230202.1721/biblio-core-autoloads.el similarity index 83% rename from elpa/biblio-core-20190624.1408/biblio-core-autoloads.el rename to elpa/biblio-core-20230202.1721/biblio-core-autoloads.el index 78f53452..13b191e0 100644 --- a/elpa/biblio-core-20190624.1408/biblio-core-autoloads.el +++ b/elpa/biblio-core-20230202.1721/biblio-core-autoloads.el @@ -1,4 +1,4 @@ -;;; biblio-core-autoloads.el --- automatically extracted autoloads +;;; biblio-core-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -18,7 +18,11 @@ inserted. \(fn &optional BACKEND QUERY)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "biblio-core" '("biblio-"))) +(register-definition-prefixes "biblio-core" '("biblio-")) + +;;;*** + +;;;### (autoloads nil nil ("biblio-core-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/biblio-core-20230202.1721/biblio-core-pkg.el b/elpa/biblio-core-20230202.1721/biblio-core-pkg.el new file mode 100644 index 00000000..f3c7c00d --- /dev/null +++ b/elpa/biblio-core-20230202.1721/biblio-core-pkg.el @@ -0,0 +1,17 @@ +(define-package "biblio-core" "20230202.1721" "A framework for looking up and displaying bibliographic entries" + '((emacs "24.3") + (let-alist "1.0.4") + (seq "1.11") + (dash "2.12.1")) + :commit "ee52f6cda82ea6fbc3b400e7b12132595cc0374c" :authors + '(("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) + :maintainers + '(("Clément Pit-Claudel" . "clement.pitclaudel@live.com")) + :maintainer + '("Clément Pit-Claudel" . "clement.pitclaudel@live.com") + :keywords + '("bib" "tex" "convenience" "hypermedia") + :url "https://github.com/cpitclaudel/biblio.el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/biblio-core-20190624.1408/biblio-core.el b/elpa/biblio-core-20230202.1721/biblio-core.el similarity index 92% rename from elpa/biblio-core-20190624.1408/biblio-core.el rename to elpa/biblio-core-20230202.1721/biblio-core.el index a5a2304d..917346c2 100644 --- a/elpa/biblio-core-20190624.1408/biblio-core.el +++ b/elpa/biblio-core-20230202.1721/biblio-core.el @@ -3,11 +3,10 @@ ;; Copyright (C) 2016 Clément Pit-Claudel ;; Author: Clément Pit-Claudel -;; Version: 0.2 -;; Package-Version: 20190624.1408 +;; Version: 0.3 ;; Package-Requires: ((emacs "24.3") (let-alist "1.0.4") (seq "1.11") (dash "2.12.1")) ;; Keywords: bib, tex, convenience, hypermedia -;; URL: http://github.com/cpitclaudel/biblio.el +;; URL: https://github.com/cpitclaudel/biblio.el ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -20,7 +19,7 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see . ;;; Commentary: ;; A framework for browsing bibliographic search results. This is the core @@ -105,8 +104,7 @@ Also see `biblio-cleanup-bibtex-function'.") DIALECT is `BibTeX' or `biblatex'. AUTOKEY: see `biblio-format-bibtex'." (let ((bibtex-entry-format biblio--bibtex-entry-format) (bibtex-align-at-equal-sign t) - (bibtex-autokey-edit-before-use nil) - (bibtex-autokey-year-title-separator ":")) + (bibtex-autokey-edit-before-use nil)) ;; Use biblatex to allow for e.g. @Online ;; Use BibTeX to allow for e.g. @TechReport (bibtex-set-dialect dialect t) @@ -114,7 +112,7 @@ DIALECT is `BibTeX' or `biblatex'. AUTOKEY: see `biblio-format-bibtex'." (defun biblio--cleanup-bibtex (autokey) "Default value of `biblio-cleanup-bibtex-function'. -AUTOKEY: See biblio-format-bibtex." +AUTOKEY: See `biblio-format-bibtex'." (save-excursion (when (search-forward "@data{" nil t) (replace-match "@misc{"))) @@ -140,10 +138,10 @@ With non-nil AUTOKEY, automatically generate a key for BIBTEX." (bibtex-mode) (save-excursion (insert (biblio-strip bibtex))) - (when (functionp biblio-cleanup-bibtex-function) - (funcall biblio-cleanup-bibtex-function autokey)) (if (fboundp 'font-lock-ensure) (font-lock-ensure) (with-no-warnings (font-lock-fontify-buffer))) + (when (functionp biblio-cleanup-bibtex-function) + (funcall biblio-cleanup-bibtex-function autokey)) (buffer-substring-no-properties (point-min) (point-max)))) (defun biblio--beginning-of-response-body () @@ -215,7 +213,7 @@ URL and CALLBACK; see `url-queue-retrieve'" (if biblio-synchronous (with-current-buffer (url-retrieve-synchronously url) (funcall callback nil)) - (setq url-queue-timeout 1) + (setq url-queue-timeout 5) (url-queue-retrieve url callback))) (defun biblio-strip (str) @@ -294,7 +292,7 @@ non-sparse keymaps." "Return a list of bindings in V, prefixed by K." (biblio--flatten-map v (biblio--as-list k))) keymap))))) - ;; This breaks if keymap is a symbol whose function cell is a keymap + ;; FIXME This breaks if keymap is a symbol whose function cell is a keymap ((symbolp keymap) (list (cons prefix keymap)))))) @@ -329,12 +327,14 @@ That is, if two key map to `eq' values, they are grouped." (defun biblio--help-with-major-mode-1 (keyseqs-command) "Print help on KEYSEQS-COMMAND to standard output." - ;; (biblio-with-fontification 'font-lock-function-name-face - (insert (format "%s (%S)\n" - (biblio--quote-keys (car keyseqs-command)) - (cdr keyseqs-command))) - (biblio-with-fontification 'font-lock-doc-face - (insert (format " %s\n\n" (biblio--brief-docs (cdr keyseqs-command)))))) + (insert (biblio--quote-keys (car keyseqs-command)) " ") + (insert (propertize "\t" 'display '(space :align-to 10))) + (insert-text-button (format "%S" (cdr keyseqs-command))) + (insert "\n") + (biblio-with-fontification '(font-lock-comment-face (:height 0.95)) + (insert (format " %s\n" (biblio--brief-docs (cdr keyseqs-command))))) + (biblio-with-fontification '(:height 0.3) + (insert "\n"))) (defun biblio--help-with-major-mode () "Display help with current major mode." @@ -444,6 +444,13 @@ Uses .url, and .doi as a fallback." (or (get-text-property (point) 'biblio-metadata) (user-error "No entry at point"))) +(defcustom biblio-bibtex-use-autokey nil + "Whether to generate new BibTeX keys for inserted entries." + :type '(choice (const :tag "Keep original BibTeX keys" nil) + (const :tag "Generate new BibTeX keys" t)) + :group 'biblio + :package-version '(biblio . "0.2.1")) + (defun biblio--selection-forward-bibtex (forward-to &optional quit) "Retrieve BibTeX for entry at point and pass it to FORWARD-TO. If QUIT is set, also kill the results buffer." @@ -454,7 +461,10 @@ If QUIT is set, also kill the results buffer." 'forward-bibtex metadata (lambda (bibtex) (with-current-buffer results-buffer - (funcall forward-to (biblio-format-bibtex bibtex) metadata)))) + (funcall + forward-to + (biblio-format-bibtex bibtex biblio-bibtex-use-autokey) + metadata)))) (when quit (quit-window))))) (defun biblio--selection-change-buffer (buffer-name) @@ -473,7 +483,10 @@ will be called with the metadata of the current item.") (defun biblio--completing-read-function () "Return ido, unless user picked another completion package." - (if (eq completing-read-function #'completing-read-default) + (if (and (eq completing-read-function #'completing-read-default) + (not (catch 'advised ;; https://github.com/cpitclaudel/biblio.el/issues/55 + (advice-mapc (lambda (&rest _args) (throw 'advised t)) + 'completing-read-default)))) #'ido-completing-read completing-read-function)) @@ -520,8 +533,10 @@ Interactively, query for ACTION from (let ((map (make-sparse-keymap))) (define-key map (kbd "") #'biblio--selection-previous) (define-key map (kbd "C-p") #'biblio--selection-previous) + (define-key map (kbd "p") #'biblio--selection-previous) (define-key map (kbd "") #'biblio--selection-next) (define-key map (kbd "C-n") #'biblio--selection-next) + (define-key map (kbd "n") #'biblio--selection-next) (define-key map (kbd "RET") #'biblio--selection-browse) (define-key map (kbd "") #'biblio--selection-browse-direct) (define-key map (kbd "C-RET") #'biblio--selection-browse-direct) @@ -550,10 +565,16 @@ Interactively, query for ACTION from (buffer-name biblio--target-buffer)) ""))) +(defface biblio-highlight-extend-face `((t (:inherit highlight + ,@(and (>= emacs-major-version 27) '(:extend t))))) + "Face used for highlighting lines." + :group 'biblio-faces) + (define-derived-mode biblio-selection-mode fundamental-mode biblio--selection-mode-name-base "Browse bibliographic search results. \\{biblio-selection-mode-map}" - (hl-line-mode) + (setq-local hl-line-face 'biblio-highlight-extend-face) + (hl-line-mode 1) (visual-line-mode) (setq-local truncate-lines nil) (setq-local cursor-type nil) @@ -647,6 +668,15 @@ With non-nil LABEL, use that instead of URL to label the button." 'action #'biblio--browse-url) (buffer-string)))) +(defun biblio--references-redundant-p (references url) + "Check whether REFERENCES are all containted in URL. + +This is commonly the case with DOIs, which don't need to be +displayed if they are already in the `dx.doi.org' url." + (and (stringp url) + (seq-every-p (lambda (ref) (string-match-p (regexp-quote ref) url)) + references))) + (defun biblio-insert-result (item &optional no-sep) "Print a (prepared) bibliographic search result ITEM. With NO-SEP, do not add space after the record. @@ -684,7 +714,13 @@ provide examples of how to build such a result." (biblio--insert-detail " Type: " .type t) (biblio--insert-detail " Category: " .category t) (biblio--insert-detail " Publisher: " .publisher t) - (biblio--insert-detail " References: " .references t) + ;; (-when-let* ((year (and (numberp .year) (number-to-string .year)))) + ;; (if .publisher + ;; (insert (format " (%s)" year)) + ;; (biblio--insert-detail " Publication date: " year t))) + (let ((references (remq nil .references))) + (unless (biblio--references-redundant-p references .url) + (biblio--insert-detail " References: " references t))) (biblio--insert-detail " Open Access: " .open-access-status t) (biblio--insert-detail " URL: " (list (biblio-make-url-button .url) (biblio-make-url-button .direct-url)) -- 2.47.3