;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'biblio-core) #@41 Create a doi.org url for DOI. (fn DOI) (defalias 'biblio-doi--dx-url #[257 "\300\301\"\207" [format "https://doi.org/%s"] 4 (#$ . 110)]) #@251 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. (fn DOI) (defalias 'biblio-doi--crosscite-url #[257 "\300\301\"\207" [format "https://crosscite.org/citeproc/format?doi=%s&style=bibtex&lang=en-US"] 4 (#$ . 256)]) (defconst biblio-doi--dx-mime-accept "text/bibliography;style=bibtex, application/x-bibtex") #@64 Set `url-mime-accept-string' before contacting the DOI server. (defalias 'biblio-doi--set-mime-accept #[0 "\211\207" [biblio-doi--dx-mime-accept url-mime-accept-string] 2 (#$ . 761)]) #@35 Restore `url-mime-accept-string'. (defalias 'biblio-doi--restore-mime-accept #[0 "\300\301!\210\302\301\303\"\207" [kill-local-variable url-mime-accept-string set-default nil] 3 (#$ . 953)]) #@58 Insert formatted BIBTEX into BUFFER. (fn BIBTEX BUFFER) (defalias 'biblio-doi--insert #[514 "r\211q\210\300\261)\207" ["\n\n"] 4 (#$ . 1150)]) #@112 Helper function for `biblio-doi--generic-url-callback'. ERRORS, FORWARD-TO: see there. (fn ERRORS FORWARD-TO) (defalias 'biblio-doi--generic-url-callback-1 #[514 "\211?\205\300 !\207" [biblio-response-as-utf-8] 4 (#$ . 1303)]) #@304 Make an URL-ready callback. Call CLEANUP-FN in any case, and FORWARD-TO with BibTeX source or nil depending on whether an error occured. If error 406 occurs, forward nil; otherwise, signal the error. This is essentially a thin wrapper around `biblio-generic-url-callback'. (fn CLEANUP-FN FORWARD-TO) (defalias 'biblio-doi--generic-url-callback #[514 "\300\301\302\"\303#\207" [biblio-generic-url-callback make-closure #[256 "\301\300\"\207" [V0 biblio-doi--generic-url-callback-1] 4 "Handle response from BibTeX server.\n\n(fn &optional ERRORS)"] (http . 406)] 6 (#$ . 1541)]) #@138 Generate a handler for response of CrossCite server. FORWARD-TO is the callback to call with the results of the search. (fn FORWARD-TO) (defalias 'biblio-doi--crosscite-callback #[257 "\300\301\"\207" [biblio-doi--generic-url-callback ignore] 4 (#$ . 2131)]) #@81 Forward BibTeX entry for DOI from CrossCite to FORWARD-TO. (fn DOI FORWARD-TO) (defalias 'biblio-doi--forward-bibtex-crosscite #[514 "\300\301!\302!\"\207" [biblio-url-retrieve biblio-doi--crosscite-url biblio-doi--crosscite-callback] 6 (#$ . 2398)]) #@131 Generate a handler for response of DX server. FORWARD-TO is the callback to call with the results of the search. (fn FORWARD-TO) (defalias 'biblio-doi--dx-callback #[257 "\300\301\"\207" [biblio-doi--generic-url-callback biblio-doi--restore-mime-accept] 4 (#$ . 2659)]) #@79 Forward BibTeX entry for DOI from doi.org to FORWARD-TO. (fn DOI FORWARD-TO) (defalias 'biblio-doi--forward-bibtex-dx #[514 "\300 \210\301\302!\303!\"\207" [biblio-doi--set-mime-accept biblio-url-retrieve biblio-doi--dx-url biblio-doi--dx-callback] 6 (#$ . 2937)]) #@63 Pass BibTeX entry for DOI to FORWARD-TO. (fn DOI FORWARD-TO) (defalias 'biblio-doi-forward-bibtex #[514 "\300\301\302#\"\207" [biblio-doi--forward-bibtex-dx make-closure #[257 "\211\203\301!\207\302\300\301\"\207" [V0 V1 biblio-doi--forward-bibtex-crosscite] 4 "\n\n(fn RESULT)"]] 8 (#$ . 3211)]) #@45 Insert BibTeX entry matching DOI. (fn DOI) (defalias 'biblio-doi-insert-bibtex #[257 "p\300\301!\302\303\"\"\207" [biblio-doi-forward-bibtex biblio-cleanup-doi make-closure #[257 "\302\303 \"\300\"\207" [V0 biblio-bibtex-use-autokey biblio-doi--insert biblio-format-bibtex] 5 "\n\n(fn RESULT)"]] 7 (#$ . 3521) "MDOI: "]) (byte-code "\300\301\302\"\210\303\304!\207" [defalias doi-insert-bibtex biblio-doi-insert-bibtex provide biblio-doi] 3)