;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\312\313\314\315\316\317%\210\320\321\314\322\316\313\323\324&\210\320\325\314\326\316\313\323\327&\210\320\330\331\332\316\313\323\333&\210\320\334\335\336\316\313\323\337&\210\320\340\314\341\316\313\323\342&\210\320\343\344\345\316\313\323\337&\210\320\346\347\350\316\313\323\351&\210\320\352\314\353\316\313\323\354&\210\320\355\356\357\316\313\323\337&\210\320\360\361\362\316\313\323\337&\210\320\363\364\365\316\313\323\337&\210\320\366\367\370\316\313\323\337&\210\320\371\372\373\316\313\323\337&\210\320\374\375\376\316\313\323\377&\210\320\201@\314\201A\316\313\323\201B&\210\320\201C\314\201D\316\313\323\201E&\210\320\201F\314\201G\316\313\323\201H&\210\320\201I\201J\201K\316\313\323\201L&\210\320\201M\201N\201O\316\313\323\337&\210\320\201P\201Q\201R\316\313\323\342&\210\320\201S\314\201T\316\313\323\342&\210\320\201U\314\201V\316\313\323\337&\210\320\201W\201X\201Y\316\313\323\201Z&\207" [require browse-url parsebib cl-lib dash s f biblio filenotify org-capture custom-declare-group bibtex-completion nil "Helm plugin for searching entries in a BibTeX bibliography." :group completion custom-declare-variable bibtex-completion-bibliography "The BibTeX file or list of BibTeX files.\nOrg-bibtex users can also specify org mode bibliography files, in\nwhich case it will be assumed that a BibTeX file exists with the\nsame name and extension bib instead of org. If the bib file has a\ndifferent name, use a cons cell `(\"orgfile.org\" . \"bibfile.bib\")' instead." :type (choice file (repeat file)) bibtex-completion-library-path "A directory or list of directories in which PDFs are stored.\nBibtex-completion assumes that the names of these PDFs are\ncomposed of the BibTeX-key plus a \".pdf\" suffix." (choice directory (repeat directory)) bibtex-completion-pdf-open-function 'find-file "The function used for opening PDF files.\nThis can be an arbitrary function that takes one argument: the\npath to the PDF file. The default is `find-file' which opens the\nPDF in Emacs (either with docview or, if installed, the much\nsuperior pdf-tools. When set to\n`helm-open-file-with-default-tool', the systems default viewer\nfor PDFs is used." function bibtex-completion-pdf-extension ".pdf" "The extension of a BibTeX entry's \"PDF\" file.\nThis makes it possible to use another file type. It can also be a\nlist of file types, which are then tried sequentially until a\nfile is found. Beware that adding file types can reduce\nperformance for large bibliographies. This variable has no\neffect if PDFs are referenced via the file field." string bibtex-completion-find-additional-pdfs "If non-nil, all files whose base name starts with the BibTeX key and ends with `bibtex-completion-pdf-extension' are considered as PDFs, not only \".\".\nNote that for performance reasons, an entry is only marked as\nhaving a PDF if \".\fB, A\211\202*,\203{\324,!\203{\325\326!\210\314\315\316\"-r-q\210\327\216\330 \210\320,!\210\331\332!.\333.\332\334#)/+\203\360\n0\3130:\203\3540@\314\315\316\"1r1q\210\335\216\320\f!\210\321\322p\"*\f\235\204\271\336 \323\f2\"AA\"\210\202\342\337\340\f\"\210\341\fC!\210\342\f*\343 !#2B2\344\fC!\210\342\f*\345 !#+B+,0A\2110\202\206* 3\203\375\337\346!\210\347\n\"\210\337\350!\210\n4\313\21154:\203*4@\351\323\f+\"AA!5\24454A\2114\202 5\237+\237+\207" [reparsed-files ht-strings files #1=#:--cl-var-- file #2=#:temp-buffer bibtex-completion-normalize-bibliography bibtex make-hash-table :test equal nil generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#2# buffer-name kill-buffer] 2] insert-file-contents secure-hash sha256 assoc f-file\? require org-element #[nil "\301!\205 \302!\207" [#3=#:temp-buffer buffer-name kill-buffer] 2] org-mode org-element-parse-buffer headline org-element-map #[(key) "\301\302\"\207" [key org-element-property :CUSTOM_ID] 3] #[nil "\301!\205 \302!\207" [#4=#:temp-buffer buffer-name kill-buffer] 2] bibtex-completion-update-strings-ht message "Parsing bibliography file %s ..." bibtex-completion-clear-string-cache -cons* bibtex-completion-parse-strings bibtex-completion-clear-cache bibtex-completion-parse-bibliography "Resolving cross-references ..." bibtex-completion-resolve-crossrefs "Done (re)loading bibliography." reverse bibliography-hash bibtex-completion-cache bibtex-completion-notes-path #3# tree bibtex-completion-cached-notes-keys #5=#:--cl-var-- #4# bibtex-completion-string-cache bibtex-completion-string-hash-table #6=#:--cl-var-- #7=#:--cl-var--] 6 (#$ . 19576)]) #@185 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. (defalias 'bibtex-completion-resolve-crossrefs #[(files reparsed-files) "\306 \"\307\211\310 :\203T @\311\f\"AA\f \235\211\203\214\311\f\"\211A \307\211\307\310:\203\202@\312\313\"\314\203o\315\316\317\211\320\227\n\"BB\266\203\"!\202q!BA\307\202?\237-\241\210)\202J\311\f\"\211A \307\211\307\211\310:\203B@\211A\312\313\"\211\2030\314\315\316\307 \321\307\211\211!\"#$\210!\210$\203$\211A$\242\211\"#\211!\203@G\321V\203\"#!#T# B \202\335- \237)\317\211\320\227\n\"BB\266\203\"!!\2022BA\307\202\247\237.\241\210)) A\307\202-\307\207" [files reparsed-files entry-hash #1=#:--cl-var-- file entries bibtex-completion-make-entry-hash nil t assoc bibtex-completion-get-value "crossref" bibtex-completion-make-candidate bibtex-completion-remove-duplicated-fields append "" gethash 0 #2=#:--cl-var-- bibtex-completion-cache it #3=#:v #4=#:--cl-var-- entry crossref #5=#:--cl-var-- #6=#:--cl-var-- #7=#:v #8=#:--cl-var-- entry-alist #9=#:--cl-var-- #10=#:--cl-var-- #11=#:result it-index #12=#:elt #13=#:i #14=#:list] 11 (#$ . 21762)]) #@317 Return a hash table of all potentially cross-referenced bibliography entries in FILES, assuming that only those files in REPARSED-FILES were reparsed whereas the other files in FILES were up-to-date. Only entries whose type belongs to `bibtex-completion-cross-referenced-entry-types' are included in the hash table. (defalias 'bibtex-completion-make-entry-hash #[(files reparsed-files) "\306\211\306\307 :\203; @\310\n\"AA\n\235\203*\311 !\f\244\2023\311\312\313 \"!\f\244 A\306\202\n\f\237-\314\315\316\317 G$ \306\211\307:\203\207@\320\321\"\320\322\"\227\235\203|\323\227#\210A\306\202T.\207" [files #1=#:--cl-var-- file entries #2=#:--cl-var-- #3=#:--cl-var-- nil t assoc reverse mapcar cdr make-hash-table :test equal :size bibtex-completion-get-value "=key=" "=type=" puthash bibtex-completion-cache reparsed-files ht #4=#:--cl-var-- entry key #5=#:--cl-var-- bibtex-completion-cross-referenced-entry-types] 6 (#$ . 23148)]) #@31 Return a candidate for ENTRY. (defalias 'bibtex-completion-make-candidate #[(entry) "\302\303\304\305\306\"\"!\211\304\307\310\"@Q\211\304\307\311\"@Q\211+B\207" [entry candidate bibtex-completion-clean-string s-join " " -map cdr assoc "=has-pdf=" "=has-note="] 7 (#$ . 24148)]) #@244 Parse the BibTeX entries listed in the current buffer and return a list of entries in the order in which they appeared in the BibTeX file. Also do some preprocessing of the entries. If HT-STRINGS is provided it is assumed to be a hash table. (defalias 'bibtex-completion-parse-bibliography #[(&optional ht-strings) "eb\210\306\307\310\311\"\"\312\211\313\314 \211\203\\\315\n\316\"\211\204V\317\n`#\306\320\321\322#\2037\321\2028\323\320\324\322#\203E\324\202F\325D \"\310\326\327 \"\"* B)\312\202 \237,\207" [bibtex-completion-additional-search-fields fields entry-type #1=#:--cl-var-- #2=#:--cl-var-- it append ("title" "crossref") -map #[(it) "9\203 \301!\207\207" [it symbol-name] 2] nil t parsebib-find-next-item member-ignore-case ("preamble" "string" "comment") parsebib-read-entry assoc-string "author" case-fold "editor" "date" "year" #[(it) "@\227AB\207" [it] 2] bibtex-completion-prepare-entry ht-strings entry] 7 (#$ . 24441)]) #@225 Given a BibTeX key this function scans all bibliographies listed in `bibtex-completion-bibliography' and returns an alist of the record with that key. Fields from crossreferenced entries are appended to the requested entry. (defalias 'bibtex-completion-get-entry #[(entry-key) "\303!\304\305 \"\211\205\303\n!\306\307 \n\"!+\207" [entry-key entry crossref bibtex-completion-get-entry1 bibtex-completion-get-value "crossref" bibtex-completion-remove-duplicated-fields append] 5 (#$ . 25423)]) (defalias 'bibtex-completion-get-entry1 #[(entry-key &optional do-not-find-pdf) "\306\307!\310\311\312\"r q\210\313\216\314\315\"\210eb\210\316\317\n\320\321 !\322\260\323\312#\203;\324\325!\326\327\330\f` #\323#!)\202D\331\332\333 \334Q\"\210\323,\207" [bib #1=#:temp-buffer parsebib--bibtex-identifier entry-key entry-type bibtex-completion-string-hash-table bibtex-completion-normalize-bibliography bibtex generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mapc insert-file-contents re-search-forward "^[ ]*@\\(" "\\)[[:space:]]*[({][[:space:]]*" regexp-quote "[[:space:]]*," nil match-string 1 reverse bibtex-completion-prepare-entry parsebib-read-entry display-warning :warning "Bibtex-completion couldn't find entry with key \"" "\"." do-not-find-pdf] 6]) #@224 Return the path of the PDF specified in the field `bibtex-completion-pdf-field' if that file exists. Returns nil if no file is specified, or if the specified file does not exist, or if `bibtex-completion-pdf-field' is nil. (defalias 'bibtex-completion-find-pdf-in-field #[(key-or-entry) "\205\353 ;\203\306 \307\"\202 \310\n\"\211\204\311\202\352\312 !\203* C\202\352\313\312\314\315\316\f!\"\"\203B\317\312\314\320\316\f!\"\"\202\352\321\322\323 #\324\325 \"\311\211%%\311\211%%\311\211&'\311\211()\311*\307+ :\203\345 @%\321\326\327%#%\321\330\331%#%\324\332%\"\211%@&%A@\206\227\333'\334\335'\"\203\247'C\202\310\336'&\337\340 '\"\337\340 '&#F\314\341\316\f!\"\314\342\316\f!\"#(\343\344(\"\211)\203\334)*B* A\311+\202k*\237.\f*\207" [bibtex-completion-pdf-field key-or-entry entry value bibtex-completion-library-path #1=#:--cl-var-- bibtex-completion-get-entry1 t bibtex-completion-get-value nil f-file\? -any mapcar #[#2=(it) "\210\302\303 !\"\207" [it value f-join f-filename] 4] -flatten -filter #[#2# "\210\302\303 !\"\207" [it value f-join f-filename] 4] replace-regexp-in-string "\\([^\\]\\)[;,]" "\\1" s-split "" "\\([^\\]\\|^\\):" "\\1" "\\\\\\(.\\)" "\\1" "" "" s-match "^[A-Z]:" append f-join f-root #[#2# "\210\302 \"\207" [it path f-join] 3] #[#2# "\210\303 \n#\207" [it path file-name f-join] 4] -first #[(path) "\301!?\205\302!\205\207" [path s-blank-str\? f-exists\?] 2] record file-name path paths result #3=#:--cl-var-- #4=#:--cl-var--] 9 (#$ . 26745)]) #@363 Searches the directories in `bibtex-completion-library-path' for a PDF whose name is composed of the BibTeX key plus `bibtex-completion-pdf-extension'. The path of the first matching PDF is returned. If FIND-ADDITIONAL is non-nil, the paths of all PDFs whose name starts with the BibTeX key and ends with `bibtex-completion-pdf-extension' are returned instead. (defalias 'bibtex-completion-find-pdf-in-library #[(key-or-entry &optional find-additional) ";\203 \202 \306\307\"\310\n!\311\211 :\203[ @\312\310!\311\211:\203L@\313\f\314 \"\"BA\211\202-\237+! \244 A\211\202 \237+\203\247\315\310\n!\311\211 :\203\236@\312\316\f\317\314\320\321 !\322\323\321\310!\324#\325%#! \244 A\211\202r \237+\326\"\202\256\310\327\330\"!*\207" [key-or-entry key bibtex-completion-library-path #1=#:--cl-var-- dir #2=#:--cl-var-- bibtex-completion-get-value "=key=" -flatten nil reverse f-join s-concat sort directory-files t "^" regexp-quote ".*\\(" mapconcat "\\|" "\\)$" #[(x y) " \235\205\n\n \235?\207" [x main-pdf y] 2] -first f-file\? bibtex-completion-pdf-extension #3=#:--cl-var-- ext #4=#:--cl-var-- main-pdf find-additional #5=#:--cl-var-- #6=#:--cl-var--] 14 (#$ . 28307)]) #@546 Return the path of the PDF associated with the specified entry KEY-OR-ENTRY. This is either the path(s) specified in the field `bibtex-completion-pdf-field' or, if that does not exist, the first PDF in any of the directories in `bibtex-completion-library-path' whose name is composed of the the BibTeX key plus `bibtex-completion-pdf-extension' (or if FIND-ADDITIONAL is non-nil, all PDFs in `bibtex-completion-library-path' whose name starts with the BibTeX key and ends with `bibtex-completion-pdf-extension'). Returns nil if no PDF is found. (defalias 'bibtex-completion-find-pdf #[(key-or-entry &optional find-additional) "\302!\206\n\303 \"\207" [key-or-entry find-additional bibtex-completion-find-pdf-in-field bibtex-completion-find-pdf-in-library] 3 (#$ . 29558)]) #@178 Find note file associated with entry ENTRY-KEY in the default directory. The default directory is `bibtex-completion-notes-path'. If the note file doesn’t exist, return nil. (defalias 'bibtex-completion-find-note-multiple-files #[(entry-key) "\205\303!\205\304\305\306 \n\"\"!\207" [bibtex-completion-notes-path entry-key bibtex-completion-notes-extension f-directory\? f-file\? f-join s-concat] 6 (#$ . 30341)]) #@180 Find notes associated with entry ENTRY-KEY in the single notes file. The single notes file is the one specified in `bibtex-completion-notes-path'. If no note exists, return nil. (defalias 'bibtex-completion-find-note-one-file #[(entry-key) "\205 \303!\205 \n\235\207" [bibtex-completion-notes-path entry-key bibtex-completion-cached-notes-keys f-file\?] 2 (#$ . 30771)]) #@166 List of functions to use to find note files. The functions should accept one argument: the key of the BibTeX entry and return non-nil if notes exist for that entry. (defvar bibtex-completion-find-note-functions (list 'bibtex-completion-find-note-multiple-files 'bibtex-completion-find-note-one-file) (#$ . 31155)) #@412 Prepare ENTRY for display. ENTRY is an alist representing an entry as returned by `parsebib-read-entry'. All the fields not in FIELDS are removed from ENTRY, with the exception of the "=type=" and "=key=" fields. If FIELDS is empty, all fields are kept. Also add a =has-pdf= and/or =has-note= field, if they exist for ENTRY. If DO-NOT-FIND-PDF is non-nil, this function does not attempt to find a PDF file. (defalias 'bibtex-completion-prepare-entry #[(entry &optional fields do-not-find-pdf) "\205\235 \205\306 \307\310\311\312F\"\n\204#\313!\203#\311 BB\202$\314\310\"A\315\316\317\320 \"\"\203>\312BB\202? \203\213\321\322\321\211\210\210\203\203\211A\242T\323@ \"\203YB\202Y,\237)\202\214\314\307\"\314\307\"A\227\241\210\324!-\207" [entry fields do-not-find-pdf bibtex-completion-pdf-symbol entry-key bibtex-completion-find-note-functions append "=type=" "=key=" "=has-pdf=" "=has-note=" bibtex-completion-find-pdf assoc cl-some identity mapcar #[(fn) " !\207" [fn entry-key] 2] nil 0 member-ignore-case bibtex-completion-remove-duplicated-fields bibtex-completion-notes-symbol #1=#:result it-index it #2=#:i #3=#:list] 6 (#$ . 31476)]) #@38 Remove duplicated fields from ENTRY. (defalias 'bibtex-completion-remove-duplicated-fields #[(entry) "\301\302\303\304\305\306\307&\207" [entry cl-remove-duplicates :test #[(x y) "\302!\302 !\230\207" [x y s-downcase] 3] :key car :from-end t] 8 (#$ . 32701)]) #@178 Formats a BibTeX ENTRY for display in results list. WIDTH is the width of the results list. The display format is governed by the variable `bibtex-completion-display-formats'. (defalias 'bibtex-completion-format-entry #[(entry width) "\304\305\306\" \307#\206\310 \236\211A@\311 \312\"*\207" [entry bibtex-completion-display-formats-internal format format-string assoc-string bibtex-completion-get-value "=type=" case-fold t s-format #[(field) "\306\307\"\211@A@\310 \" \311\230\203 \f\204 \310\312 \" \313\230\2034\f\2044\306\310\314 \315#\316\"@\317\f\206:\320! \321\235\203F\322\f!\n\204N\f\202g\323\n!\324\f\n\325V\203^\n\202d AAZ\325\326$,\207" [field field-name field-width entry field-value width split-string ":" bibtex-completion-get-value "author" "editor" "year" "date" "" "-" bibtex-completion-clean-string " " ("author" "editor") bibtex-completion-shorten-authors string-to-number truncate-string-to-width 0 32 format] 6]] 5 (#$ . 32971)]) #@74 Remove quoting and superfluous white space from BibTeX field value in S. (defalias 'bibtex-completion-clean-string #[(s) "\205 \301\302\303\301\304\305##\207" [s replace-regexp-in-string "[\n ]+" " " "[\"{}]+" ""] 7 (#$ . 33960)]) #@59 Return a comma-separated list of the surnames in AUTHORS. (defalias 'bibtex-completion-shorten-authors #[(authors) "\205W\306\307\"\310\211\310\311\312 :\203T @\306\313\n\312#\203+\311\202,\314 \fP G\315=\203F \316\306\317 @\312#!P\202K @P A\310\202 .\207" [authors #1=#:--cl-var-- a p sep #2=#:--cl-var-- s-split " and " nil "" t "," ", " 1 -last-item " +" #3=#:--cl-var--] 7 (#$ . 34201)]) #@281 Open the PDFs associated with the marked entries using the function specified in `bibtex-completion-pdf-open-function'. If multiple PDFs are found for an entry, ask for the one to open using `completion-read'. If FALLBACK-ACTION is non-nil, it is called in case no PDF is found. (defalias 'bibtex-completion-open-pdf #[(keys &optional fallback-action) "\306\211\205_\n@\307 \"\211G\310V\2036\311\f!\312\313\314\315\f\"\306\316$\317 \f\"@!\210+\202V\f\203C\f@!\210\202V\203Q C!\210\202V\320\321 \"\210)\nA\211\204\306*\207" [keys key --dolist-tail-- bibtex-completion-find-additional-pdfs pdf choice nil bibtex-completion-find-pdf 1 f-uniquify-alist completing-read "File to open: " mapcar cdr t rassoc message "No PDF(s) found for this entry: %s" file bibtex-completion-pdf-open-function fallback-action] 6 (#$ . 34630)]) #@67 Open the URL or DOI associated with entries in KEYS in a browser. (defalias 'bibtex-completion-open-url-or-doi #[(keys) "\306\211\205I\n@\307 !\310\311 \"\310\312 \"\206 \f\203-\313\f!\210\202@ \203;\313\314\315 \"!\210\202@\316\317 \"\210,\nA\211\204\306*\207" [keys key --dolist-tail-- entry url doi nil bibtex-completion-get-entry bibtex-completion-get-value "url" "doi" browse-url s-concat "http://dx.doi.org/" message "No URL or DOI found for this entry: %s" bibtex-completion-browser-function browse-url-browser-function] 5 (#$ . 35489)]) #@281 Open the PDFs associated with the marked entries using the function specified in `bibtex-completion-pdf-open-function'. If multiple PDFs are found for an entry, ask for the one to open using `completion-read'. If no PDF is found, try to open a URL or DOI in the browser instead. (defalias 'bibtex-completion-open-any #[(keys) "\301\302\"\207" [keys bibtex-completion-open-pdf bibtex-completion-open-url-or-doi] 3 (#$ . 36063)]) #@74 Default formatter for keys, separates multiple keys in KEYS with commas. (defalias 'bibtex-completion-format-citation-default #[(keys) "\301\302\"\207" [keys s-join ", "] 3 (#$ . 36499)]) #@43 History list for LaTeX citation commands. (defvar bibtex-completion-cite-command-history nil (#$ . 36694)) #@188 Formatter for LaTeX citation commands. Prompts for the command and for arguments if the commands can take any. If point is inside or just after a citation command, only adds KEYS to it. (defalias 'bibtex-completion-format-citation-cite #[(keys) "\306\307\310\306\311#\203H\312\313!\211\203H@;\203H\314\315@\"\203H\316 \210h\211\317\267\2023\320\2024\321\2024\322)\323\322\n\"g\324>\203C\320\202D\322Q\202*h\325=\203\224\307\310\306\311#\203\224\212\326u\210\312\313!\211)\203\224@;\203\224\314\315@\"\203\224\327\326!\210\316\311!\210h\211\330\267\202\211\320\202\212\321\202\212\322)\323\322\n\"\331Q\202*\f\205\231 &\f?\205\241 \211'\203\257\332\333'\"\202\260\320(\334\332\335(\")\306\211&\336'\306&\211*\337\235\203\330\332\340*\323\322\n\"#\202)+\203\343\341\342!\202\344\320+\203\357\341\343!\202\360\320,\211-\320\230\204\n\332\344*-,\323\322\n\"%\202(,\320\230\204\332\345*,\323\322\n\"$\202(\332\340*\323\322\n\"#*,)\207" [macro #1=#:val keys #2=#:val bibtex-completion-cite-default-as-initial-input bibtex-completion-cite-default-command nil require reftex-parse t reftex-what-macro 1 string-match "\\`\\\\cite\\|cite\\'" delete-horizontal-space #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (123 43 44 47)) "" " " ", " s-join (125 44) 125 -1 delete-char #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (123 129 44 133)) "}" format " (default \"%s\")" completing-read "Cite command%s: " bibtex-completion-cite-command-history ("nocite" "supercite") "\\%s{%s}" read-from-minibuffer "Prenote: " "Postnote: " "\\%s[%s][%s]{%s}" "\\%s[%s]{%s}" initial default default-info bibtex-completion-cite-commands cite-command bibtex-completion-cite-prompt-for-optional-arguments postnote prenote] 10 (#$ . 36808)]) #@59 Format pandoc-citeproc citations for the entries in KEYS. (defalias 'bibtex-completion-format-citation-pandoc-citeproc #[(keys) "\203\n\304\305!\202 \306\203\304\307!\202\306 \306\230\203\"\306\202% \310P\n\306\230\2030\306\2023\311\nP\312\313 \314\315\316\317 \"\"\n$,\207" [bibtex-completion-cite-prompt-for-optional-arguments prenote postnote keys read-from-minibuffer "Prenote: " "" "Postnote: " " " ", " format "[%s%s%s]" s-join "; " mapcar #[(it) "\210\301P\207" [it "@"] 2]] 8 (#$ . 38669)]) #@42 Format ebib references for keys in KEYS. (defalias 'bibtex-completion-format-citation-ebib #[(keys) "\301\302\303\304\"\"\207" [keys s-join ", " mapcar #[(it) "\210\301\302\"\207" [it format "ebib:%s"] 3]] 5 (#$ . 39192)]) #@58 Format sphinxcontrib-bibtex references for keys in KEYS. (defalias 'bibtex-completion-format-citation-sphinxcontrib-bibtex #[(keys) "\301\302\303\304\"\"\207" [keys format ":cite:`%s`" s-join ","] 5 (#$ . 39424)]) #@161 Format org-links to PDFs associated with entries in KEYS. Uses first matching PDF if several are available. Entries for which no PDF is available are omitted. (defalias 'bibtex-completion-format-citation-org-link-to-PDF #[(keys) "\306\307\310\211\310\311 :\203+ @\312\n\"\313\314\315 \"!\f\244 A\310\202\f\f\237-\"\207" [keys #1=#:--cl-var-- key pdfs #2=#:--cl-var-- #3=#:--cl-var-- s-join ", " nil t bibtex-completion-find-pdf reverse mapcar #[(it) "\210\302 \"\207" [it key org-make-link-string] 3] bibtex-completion-find-additional-pdfs] 7 (#$ . 39646)]) #@135 Format org-links to PDF for entries in KEYS. Link text loosely follows APA format. Uses first matching PDF if several are available. (defalias 'bibtex-completion-format-citation-org-apa-link-to-PDF #[(keys) "\306\307\310\211\310\211\310\211\311 :\203n @\312\n!\313\314\315 \"\206-\314\316 \"!\314\317 \"\206?\320\314\321 \322#\323\"@\324\n!@\211\203[\325\326\327\f #\"B\202e\326\327\f #B A\310\202\237.\"\207" [keys #1=#:--cl-var-- key entry author year s-join ", " nil t bibtex-completion-get-entry bibtex-completion-shorten-authors bibtex-completion-get-value "author" "editor" "year" split-string "date" "" "-" bibtex-completion-find-pdf org-make-link-string format "%s (%s)" pdf #2=#:--cl-var-- #3=#:--cl-var--] 9 (#$ . 40229)]) #@150 Formatter org-links to PDFs associated with entries in KEYS. Link text follows file title format. Uses first matching PDF if several are available. (defalias 'bibtex-completion-format-citation-org-title-link-to-PDF #[(keys) "\306\307\310\211\310\211\310\311 :\203Q @\312\n!\313\314 \"\315\n!@\206.\316\317 \"\211\203?\320 \f\"B\202H\321\322\f\"B A\310\202\237.\"\207" [keys #1=#:--cl-var-- key entry title pdf s-join ", " nil t bibtex-completion-get-entry bibtex-completion-apa-get-value "title" bibtex-completion-find-pdf bibtex-completion-get-value "url" org-make-link-string format "%s" #2=#:--cl-var-- #3=#:--cl-var--] 6 (#$ . 41011)]) #@117 Insert citations for entries in KEYS at point. The format depends on `bibtex-completion-format-citation-functions'. (defalias 'bibtex-completion-insert-citation #[(keys) "\304 \"\206\n\305 \236A\211 !c)\207" [major-mode bibtex-completion-format-citation-functions format-function keys assoc default] 4 (#$ . 41693)]) #@40 Insert references for entries in KEYS. (defalias 'bibtex-completion-insert-reference #[(keys) "\302\303\"\304\305\304 \"\304\261)\207" [keys refs mapcar #[(it) "\210\302 \303\304!P\"\207" [it fill-column s-word-wrap "\n- " bibtex-completion-apa-format-reference] 5] "\n" s-join] 4 (#$ . 42019)]) #@83 Return a plain text reference in APA format for the publication specified by KEY. (defalias 'bibtex-completion-apa-format-reference #[(key) "\304!\305\306 \"\227\211\307\267\202P\310\311\312 #\202U\310\313\312 #\202U\310\314\312 #\202U\310\315\312 #\202U\310\316\312 #\202U\310\316\312 #\202U\310\317\312 #\202U\310\320\312 #\202U\310\321\312 #)\322\323\324 #*\207" [key entry #1=#:val ref bibtex-completion-get-entry bibtex-completion-get-value "=type=" #s(hash-table size 8 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("article" 16 "inproceedings" 24 "book" 32 "phdthesis" 40 "inbook" 48 "incollection" 56 "proceedings" 64 "unpublished" 72)) s-format "${author} (${year}). ${title}. ${journal}, ${volume}(${number}), ${pages}.${doi}" bibtex-completion-apa-get-value "${author} (${year}). ${title}. In ${editor}, ${booktitle} (pp. ${pages}). ${address}: ${publisher}." "${author} (${year}). ${title}. ${address}: ${publisher}." "${author} (${year}). ${title} (Doctoral dissertation). ${school}, ${address}." "${author} (${year}). ${title}. In ${editor} (Eds.), ${booktitle} (pp. ${pages}). ${address}: ${publisher}." "${editor} (Eds.). (${year}). ${booktitle}. ${address}: ${publisher}." "${author} (${year}). ${title}. Unpublished manuscript." "${author} (${year}). ${title}." replace-regexp-in-string "\\([.?!]\\)\\." "\\1"] 5 (#$ . 42326)]) #@112 Return FIELD or ENTRY formatted following the APA guidelines. Return DEFAULT if FIELD is not present in ENTRY. (defalias 'bibtex-completion-apa-get-value #[(field entry &optional default) "\304\267\202P\305\306 \"\211\203\307\n!\202\310\305\311 \"!)\207\305\306 \"\211\203,\312\n!\2022\313\305\311 \"!)\207\305\306 \"\211\205@\312\n!)\207\305\311 \"\211\205N\313\n!)\207\305 \"\211\203\251\314\267\202\245\307\n!\202\256\310\n!\202\256\315\316\317\315\320\317\315\321\322\315\323\324\n####\202\256\n\202\256\325\326\327\330\n\331#\"\202\256\332\333\n\"\202\256\n\206\256\334\305\335 \317#\336\"@\202\256\n\202\256 \206\256\317)\207" [field entry value default #s(hash-table size 4 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("author-or-editor" 6 "author-or-editor-abbrev" 29 "author-abbrev" 52 "editor-abbrev" 66)) bibtex-completion-get-value "author" bibtex-completion-apa-format-authors bibtex-completion-apa-format-editors "editor" bibtex-completion-apa-format-authors-abbrev bibtex-completion-apa-format-editors-abbrev #s(hash-table size 7 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("author" 95 "editor" 101 "title" 107 "booktitle" 127 "pages" 131 "doi" 142 "year" 149)) replace-regexp-in-string "[{}]" "" "\\\\[[:alpha:]]+{" "^[[:alpha:]]" upcase "\\(^[^{]*{\\)\\|\\(}[^{]*{\\)\\|\\(}.*$\\)\\|\\(^[^{}]*$\\)" #[(x) "\301\302\303#\227\207" [x s-replace "\\" "\\\\"] 4] s-join "–" s-split "[^0-9]+" t s-concat " http://dx.doi.org/" split-string "date" "-"] 14 (#$ . 43714)]) #@108 Format author list in VALUE in APA style. When ABBREV is non-nil, format in abbreviated APA style instead. (defalias 'bibtex-completion-apa-format-authors #[(value &optional abbrev) "\306\307\310#\311\211 :\203p @\312\313\n\"\211\203' \314\315\316\n#C\244\202h\312\317\n\"\211\203N \306\320\n\310#\211@\321\322\323\324\325\306\323 A@\"\"\"Q)C\244\202g \306\323\n\310#\326 !\321\322\323\324\327\330 !\"\"Q)C\244)) A\211\202 G\211$\331U\203 @\202\300%\203\224$\332U\203\224\322\333 \"\260\202\300%\203\241\334\335 @\"\202\300$\336W\203\266\322\321\330 !\"\337\326 !Q\202\300\322\321\340 \341\342#\"\343P,\207" [value #1=#:--cl-var-- a authors it p s-split " and " t nil s-index-of "{" replace-regexp-in-string "[{}]" "" "," " *, *" ", " s-join " " -map #[(it) "\301\302\"\303P\207" [it s-left 1 "."] 3] -last-item #[(it) "\301\302\"\303P\207" [it s-left 1 "."] 3] -butlast 1 2 " & " format "%s et al." 8 ", & " -slice 0 7 ", …" l abbrev] 11 (#$ . 45280)]) #@55 Format author list in VALUE in abbreviated APA style. (defalias 'bibtex-completion-apa-format-authors-abbrev #[(value) "\301\302\"\207" [value bibtex-completion-apa-format-authors t] 3 (#$ . 46280)]) #@104 Format editors in VALUE in APA style. When ABBREV is non-nil, format in abbreviated APA style instead. (defalias 'bibtex-completion-apa-format-editors #[(value &optional abbrev) "\306\307\310#\311\211 :\203Z @\312\313\n\"\211\2039 \306\314\n\310#\315\316\317\320\306\316 A@\"\"\"\316 @Q)C\244\202R \306\316\n\310#\315\316\317\321\322 !\"\"\316\323 !Q)C\244) A\211\202 G\211 \324U\203i @\202\252!\203~ \325U\203~\315\326 \"\260\202\252!\203\213\327\330 @\"\202\252 \331W\203\240\315\332\322 !\"\333\323 !Q\202\252\315\332\334 \335\336#\"\337P,\207" [value #1=#:--cl-var-- a editors it p s-split " and " t nil s-index-of "," " *, *" s-join " " -map #[(it) "\301\302\"\303P\207" [it s-left 1 "."] 3] #[(it) "\301\302\"\303P\207" [it s-left 1 "."] 3] -butlast -last-item 1 2 " & " format "%s et al." 8 ", " ", & " -slice 0 7 ", …" l abbrev] 9 (#$ . 46488)]) #@55 Format editor list in VALUE in abbreviated APA style. (defalias 'bibtex-completion-apa-format-editors-abbrev #[(value) "\301\302\"\207" [value bibtex-completion-apa-format-editors t] 3 (#$ . 47383)]) #@116 Return the value for FIELD in ENTRY or DEFAULT if the value is not defined. Surrounding curly braces are stripped. (defalias 'bibtex-completion-get-value #[(field entry &optional default) "\305 \306#A\211\203\307\310\311 \232\203\n\202\312\n!#\202 \f)\207" [field entry value bibtex-completion-pdf-field default assoc-string case-fold replace-regexp-in-string "\\(^[[:space:]]*[\"{][[:space:]]*\\)\\|\\([[:space:]]*[\"}][[:space:]]*$\\)" "" s-collapse-whitespace] 6 (#$ . 47591)]) #@30 Insert BibTeX KEYS at point. (defalias 'bibtex-completion-insert-key #[(keys) "\301!c\207" [keys bibtex-completion-format-citation-default] 2 (#$ . 48088)]) #@53 Insert BibTeX entries for entries in KEYS at point. (defalias 'bibtex-completion-insert-bibtex #[(keys) "\301\302\303\304\"\"c\207" [keys s-join "\n" mapcar #[(it) "\210\301!\207" [it bibtex-completion-make-bibtex] 2]] 5 (#$ . 48252)]) #@106 Create a self-contained BibTeX entry KEY. Self-contained means that cross-referenced entries are merged. (defalias 'bibtex-completion-make-bibtex #[(key) "\306!\307\310 \"\311\312\n \313\211\313\314\315 :\203L @\211@\fA \316\317\320\"\321\"\235\204C\311\322 #P A\313\202.$*\207" [key entry entry-type #1=#:--cl-var-- field name bibtex-completion-get-entry bibtex-completion-get-value "=type=" format "@%s{%s,\n%s}\n" nil "" t append -map #[(it) "9\203 \301!\207\207" [it symbol-name] 2] ("=type=" "=key=" "=has-pdf=" "=has-note=" "crossref") " %s = {%s},\n" value #2=#:--cl-var-- #3=#:--cl-var-- bibtex-completion-no-export-fields] 10 (#$ . 48498)]) #@69 Attach the PDFs of the entries with the given KEYS where available. (defalias 'bibtex-completion-add-PDF-attachment #[(keys) "\305\211\205*\n@\306 \"\211\203\307\310\f\"\210\202!\311\312 \"\210)\nA\211\204\305*\207" [keys key --dolist-tail-- bibtex-completion-find-additional-pdfs pdf nil bibtex-completion-find-pdf mapc mml-attach-file message "No PDF(s) found for this entry: %s"] 4 (#$ . 49194)]) #@125 Non-nil if Bibtex-Completion-Notes mode is enabled. Use the command `bibtex-completion-notes-mode' to change this variable. (defvar bibtex-completion-notes-mode nil (#$ . 49614)) (make-variable-buffer-local 'bibtex-completion-notes-mode) #@592 Minor mode for managing notes. This is a minor mode. If called interactively, toggle the `Bibtex-Completion-Notes mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `bibtex-completion-notes-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'bibtex-completion-notes-mode #[(&optional arg) "\306  \307=\203\n?\202 \247\203 \310W\203\311\202\312\313\303!\2032\314\302 \"\n\2032\302 B\315\304!\210\316\317!\320\321\n\203D\322\202E\323\"\210\324\325!\203j\306 \203Y\306 \232\203j\326\327\330\n\203e\331\202f\332 #\210))\333 \210\n\207" [#1=#:last-message arg bibtex-completion-notes-mode local-minor-modes header-line-format local current-message toggle 1 nil t boundp delq make-local-variable substitute-command-keys " Finish \\[bibtex-completion-exit-notes-buffer], refile \\[org-refile]" run-hooks bibtex-completion-notes-mode-hook bibtex-completion-notes-mode-on-hook bibtex-completion-notes-mode-off-hook called-interactively-p any " in current buffer" message "Bibtex-Completion-Notes mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 49859) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar bibtex-completion-notes-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\302\300\304\305#\210\302\300\306\307C#\207" [bibtex-completion-notes-mode-hook variable-documentation put "Hook run after entering or leaving `bibtex-completion-notes-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil] 4) #@44 Keymap for `bibtex-completion-notes-mode'. (defvar bibtex-completion-notes-mode-map (byte-code "\302 \303\304\305#\210\303\306\307#\210)\310 !\203 \202+ <\203'\311 !\202+\312\313 \")\207" [map m make-sparse-keymap define-key "" bibtex-completion-exit-notes-buffer "" org-refile keymapp easy-mmode-define-keymap error "Invalid keymap %S"] 4) (#$ . 51826)) (byte-code "\301\302\303\303\211%\210\304\305\306\307#\207" [bibtex-completion-notes-mode-map add-minor-mode bibtex-completion-notes-mode nil put bibtex-completion-notes-global-mode globalized-minor-mode t] 6) (defvar bibtex-completion-notes-mode-major-mode nil nil) (byte-code "\300\301!\210\302\303\304\305\306\307\310\311\312\313& \207" [make-variable-buffer-local bibtex-completion-notes-mode-major-mode custom-declare-variable bibtex-completion-notes-global-mode nil "Non-nil if Bibtex-Completion-Notes-Global mode is enabled.\nSee the `bibtex-completion-notes-global-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `bibtex-completion-notes-global-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean] 10) #@416 Toggle Bibtex-Completion-Notes mode in all buffers. With prefix ARG, enable Bibtex-Completion-Notes-Global mode if ARG is positive; otherwise, disable it. If called from Lisp, enable the mode if ARG is omitted or nil. Bibtex-Completion-Notes mode is enabled in all buffers where `bibtex-completion-notes-mode' would do it. See `bibtex-completion-notes-mode' for more information on Bibtex-Completion-Notes mode. (defalias 'bibtex-completion-notes-global-mode #[(&optional arg) "\306 \307\303 \310=\203\311\303!?\202\" \247\203! \312W\203!\313\202\"\314\"\210\315\302!\2039\316\303\n\"\311\303!\2039\303\nB \203O\317\320\321\"\210\317\322\323\"\210\317\324\325\"\210\202^\326\320\321\"\210\326\322\323\"\210\326\324\325\"\210\327 \313\211\203\211 @r\fq\210 \203x\330 \210\202\201\203\201\330\331!\210) A\211\204g*\332\333\311\303!\203\226\334\202\227\335\"\210\336\337!\203\304\340\303!\210\306 \203\257\306 \232\203\304\341'\342\343\311\303!\203\276\344\202\277\345'#\210))\346 \210\311\303!\207" [#1=#:last-message arg global-minor-modes bibtex-completion-notes-global-mode buf --dolist-tail-- current-message set-default toggle default-value 1 nil t boundp delq add-hook after-change-major-mode-hook bibtex-completion-notes-global-mode-enable-in-buffers find-file-hook bibtex-completion-notes-global-mode-check-buffers change-major-mode-hook bibtex-completion-notes-global-mode-cmhh remove-hook buffer-list bibtex-completion-notes-mode -1 run-hooks bibtex-completion-notes-global-mode-hook bibtex-completion-notes-global-mode-on-hook bibtex-completion-notes-global-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Bibtex-Completion-Notes-Global mode %sabled%s" "en" "dis" force-mode-line-update local] 5 (#$ . 53091) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar bibtex-completion-notes-global-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\207" [bibtex-completion-notes-global-mode-map bibtex-completion-notes-global-mode-hook variable-documentation put "Hook run after entering or leaving `bibtex-completion-notes-global-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode bibtex-completion-notes-global-mode boundp] 6) (defvar bibtex-completion-notes-mode-set-explicitly nil nil) (make-variable-buffer-local 'bibtex-completion-notes-mode-set-explicitly) (defalias 'bibtex-completion-notes-mode-set-explicitly #[nil "\301\211\207" [bibtex-completion-notes-mode-set-explicitly t] 2]) (byte-code "\300\301\302\303#\210\304\305\301\"\207" [put bibtex-completion-notes-mode-set-explicitly definition-name bibtex-completion-notes-global-mode add-hook bibtex-completion-notes-mode-hook] 4) (defvar bibtex-completion-notes-global-mode-buffers nil) (defalias 'bibtex-completion-notes-global-mode-enable-in-buffers #[nil "\306 \306\211\205B @\307\n!\203:r\nq\210\f\2046 \n=\2046\2033\310\311!\210\310 \210\2026\310 \210\n) A\211\204\f\306+\207" [bibtex-completion-notes-global-mode-buffers buffers buf --dolist-tail-- bibtex-completion-notes-mode-set-explicitly bibtex-completion-notes-mode-major-mode nil buffer-live-p bibtex-completion-notes-mode -1 major-mode] 3]) (put 'bibtex-completion-notes-global-mode-enable-in-buffers 'definition-name 'bibtex-completion-notes-global-mode) (defalias 'bibtex-completion-notes-global-mode-check-buffers #[nil "\300 \210\301\302\303\"\207" [bibtex-completion-notes-global-mode-enable-in-buffers remove-hook post-command-hook bibtex-completion-notes-global-mode-check-buffers] 3]) (put 'bibtex-completion-notes-global-mode-check-buffers 'definition-name 'bibtex-completion-notes-global-mode) (defalias 'bibtex-completion-notes-global-mode-cmhh #[nil "p\211 \235\203 \210\202 B)\302\303\304\"\207" [#1=#:x bibtex-completion-notes-global-mode-buffers add-hook post-command-hook bibtex-completion-notes-global-mode-check-buffers] 4]) (put 'bibtex-completion-notes-global-mode-cmhh 'definition-name 'bibtex-completion-notes-global-mode) #@124 Exit notes buffer and delete its window. This will also disable `bibtex-completion-notes-mode' and remove the header line. (defalias 'bibtex-completion-exit-notes-buffer #[nil "~\210\303\304!\210\305\300!\210\306\307 \210\310\311 !!\211\203%\312\n!\204%\313\n!\202)\314\315 !)\207" [header-line-format bibtex-completion-notes-path window bibtex-completion-notes-global-mode -1 make-local-variable nil save-buffer get-buffer-window get-file-buffer one-window-p delete-window switch-to-buffer other-buffer] 4 (#$ . 57332) nil]) #@209 Fill TEMPLATE according to info from ENTRY. First, the BibTeX fields are expanded (e.g. ${field-name}). Then, the `org-capture' %-escapes are replaced with their values according to `org-capture-templates'. (defalias 'bibtex-completion-fill-template #[(entry template) "\303\304 #\305\306\307\310\305\307\306\n#!#\311\312O)\207" [template entry bibtex-exp s-format bibtex-completion-apa-get-value replace-regexp-in-string "\\\\n" "\n" org-capture-fill-template 0 -1] 8 (#$ . 57870)]) #@94 Function used to edit notes. The function should accept one argument, a list of BibTeX keys. (defvar bibtex-completion-edit-notes-function 'bibtex-completion-edit-notes-default (#$ . 58363)) #@93 Open the notes associated with the entries in KEYS. Creates new notes where none exist yet. (defalias 'bibtex-completion-edit-notes-default #[(keys) "\306\211\205\352\n@\307 !\310\311 \"\206\312\310\313 \314#\315\"@\311\fB B\211 \203S\316 !\203S\317 \320 $\"\"%\321%!\210\322%!\204O\323 &\"c\210)\202\341'\203`\324 '\"\204d\325 !\210~\210\326 \210eb\210\327\330(\331 !\"\306\332#\203\225)\333=\203\247\334 \210\335\336\306\332#\210\337\306!\210\340\341!\210\202\247db\210\212\323 *\"c\210)\327\336\306\332#\210)\333=\203\302\334 \210\335\336\306\332#\210\337\306!\210db\210\340\341!\210\212eb\210\327\342\306\332#)\203\341\343\224\343\225+\211,+|\210,b\210*+\nA\211\204\306*\207" [keys key --dolist-tail-- entry year bibtex-completion-notes-path nil bibtex-completion-get-entry bibtex-completion-get-value "year" split-string "date" "" "-" f-directory\? f-join s-concat find-file f-exists\? bibtex-completion-fill-template f-same\? find-file-other-window outline-show-all re-search-forward format regexp-quote t org-mode org-narrow-to-subtree re-search-backward "^*+ " org-cycle-hide-drawers bibtex-completion-notes-mode 1 "%\\?" 0 bibtex-completion-notes-extension path bibtex-completion-notes-template-multiple-files buffer-file-name bibtex-completion-notes-key-pattern major-mode bibtex-completion-notes-template-one-file end beginning] 6 (#$ . 58560)]) #@84 Open the notes associated with KEYS using `bibtex-completion-edit-notes-function'. (defalias 'bibtex-completion-edit-notes #[(keys) " !\207" [bibtex-completion-edit-notes-function keys] 2 (#$ . 59963)]) #@59 Show the first entry in KEYS in the relevant BibTeX file. (defalias 'bibtex-completion-show-entry #[(keys) "\3062~\307\310!\311\211\205| @\n@\312!\206\313!\314!\210~\210 \315=\203S\316\317!\2035\2026\320\321\f\"\211\203Ob\210\322 \210\323\306\324\"\210*\202leb\210\325\326\327\330\f!\331\260\311\324#\203l\323\306\324\"\210 \204s\332 \210* A\211\204\311*0\207" [bib-file --dolist-tail-- keys buf key major-mode break bibtex-completion-normalize-bibliography main nil get-file-buffer find-buffer-visiting find-file org-mode boundp org-bibtex-key-property "CUSTOM_ID" org-find-property org-show-entry throw t re-search-forward "^@\\(" "\\)[[:space:]]*[({][[:space:]]*" regexp-quote "[[:space:]]*," kill-buffer prop match parsebib--bibtex-identifier] 7 (#$ . 60173)]) #@122 Add a PDF to the library for the first entry in KEYS. The PDF can be added either from an open buffer, a file, or a URL. (defalias 'bibtex-completion-add-pdf-to-library #[(keys) "@\306\307\310\311\"!\211\312\230\205\313\314!\n\315\230\205\"\316\317\320\321\211\322$!\n\323\230\205,\324\325!\326 C!\211!A\203C\327\330!\321\322$\202F!@!\316\327\331\332\333\326\"!\"\321\211 %!\"# \203lr q\210\334#\322\")\202\203\f\203y\335\f#\336#\202\203 \205\203\337 #\336#.\207" [keys key source buffer file url char-to-string read-char-choice "Add pdf from [b]uffer, [f]ile, or [u]rl? " (98 102 117) "b" read-buffer-to-switch "Add pdf buffer: " "f" expand-file-name read-file-name "Add pdf file: " nil t "u" read-string "Add pdf URL: " -flatten completing-read "Add pdf to: " "Rename pdf to: " mapcar #[(it) "\210\302 \"\207" [it key s-concat] 3] write-file copy-file 1 url-copy-file bibtex-completion-library-path path bibtex-completion-pdf-extension pdf] 8 (#$ . 60980)]) #@277 Execute fallback option. Could consist of opening an URL or executing a function, depending of type of URL-OR-FUNCTION (`stringp' or `function'). If string, SEARCH-EXPRESSION will be inserted at %s in string. If function, it will be called with SEARCH-EXPRESSION as argument. (defalias 'bibtex-completion-fallback-action #[(url-or-function search-expression) "\206 \n;\203\304\305\n\306 !\"!\202&\307\n!\203\"\n !\202&\310\311\n\")\207" [bibtex-completion-browser-function browse-url-browser-function url-or-function search-expression browse-url format url-hexify-string functionp error "Don't know how to interpret this: %s"] 5 (#$ . 61978)]) #@201 Compile list of fallback options. These consist of the online resources defined in `bibtex-completion-fallback-options' plus one entry for each bibliography file that will open that file for editing. (defalias 'bibtex-completion-fallback-candidates #[nil "\302\303!\304\305\306\" \")\207" [bib-files bibtex-completion-fallback-options bibtex-completion-normalize-bibliography main -concat mapcar #[(it) "\210\301\302\303!\"\304\305\306D\307BBBB\207" [it s-concat "Create new entry in " f-filename lambda (_search-expression) find-file ((goto-char (point-max)) (newline))] 5]] 4 (#$ . 62638)]) #@218 Return a list of BibTeX files associated with the current file. If the current file is a BibTeX file, return this file. Otherwise, try to use `reftex' to find the associated BibTeX files. If this fails, return nil. (defalias 'bibtex-completion-find-local-bibliography #[nil "\300 \203\301\300 !\206 \302\303\230\203\300 C\206/\300 \205/\304\305\306\307#\205/\3101-\311 0\207\210\306\207" [buffer-file-name f-ext "" "bib" require reftex-cite nil t (error) reftex-get-bibfile-list] 4 (#$ . 63243)]) #@193 Return the key of the BibTeX entry at point, nil otherwise. This function can be used by `bibtex-completion-key-at-point' to find the key of the BibTeX entry at point in a BibTeX-mode buffer. (defalias 'bibtex-completion-get-key-bibtex #[nil "\303=\205\212\304 \210\305 !\205\306\307\n!\206\211\262)\207" [major-mode bibtex-entry-maybe-empty-head bibtex-key-in-head bibtex-mode bibtex-beginning-of-entry looking-at nil match-string-no-properties] 3 (#$ . 63758)]) #@187 Return the key of the BibTeX entry at point, nil otherwise. This function can be used by `bibtex-completion-key-at-point' to find the key of the BibTeX entry at point in a LaTeX buffer. (defalias 'bibtex-completion-get-key-latex #[nil "\304\305!\205>\306\307\310\311#\205>\212\312\310x\210\313\314!\211@;\205=\315\316@\"\205=\317 \320\321\322 #\210\323 p\324\216\325 !\210\326\327!,*\207" [macro temp-syn-table #1=#:buffer #2=#:table derived-mode-p latex-mode require reftex-parse nil t "[:space:],;}" reftex-what-macro 1 string-match "\\`\\\\cite\\|cite\\'" make-syntax-table modify-syntax-entry 95 "_" syntax-table #[nil "rq\210\302 !)\207" [#1# #2# set-syntax-table] 2] set-syntax-table thing-at-point symbol] 5 (#$ . 64237)]) #@191 Return the key of the BibTeX entry at point, nil otherwise. This function can be used by `bibtex-completion-key-at-point' to find the key of the BibTeX entry at point in an Org-mode buffer. (defalias 'bibtex-completion-get-key-org-bibtex #[nil "\303=\205%\304\305\304\306\302!\203\n\202\307\310#\211\205$ G\311V\205$ )\207" [major-mode key org-bibtex-key-property org-mode nil org-entry-get boundp "CUSTOM_ID" t 0] 4 (#$ . 64984)]) #@213 List of functions to use to find the BibTeX key. The functions should take no argument and return the BibTeX key. Stops as soon as a function returns something. See `bibtex-completion-key-at-point' for details. (defvar bibtex-completion-key-at-point-functions (list 'bibtex-completion-get-key-bibtex 'bibtex-completion-get-key-latex 'bibtex-completion-get-key-org-bibtex) (#$ . 65433)) #@142 Return the key of the BibTeX entry at point. The functions used to match the keys are defined in `bibtex-completion-key-at-point-functions'. (defalias 'bibtex-completion-key-at-point #[nil "\301\302\303\304\"\"\207" [bibtex-completion-key-at-point-functions cl-some identity mapcar funcall] 5 (#$ . 65827)]) (provide 'bibtex-completion)