+(defun org-ref-cite-candidates ()
+ "Generate the list of possible candidates.
+Check for pdf and doi, and add appropriate functions."
+ (interactive)
+ (let* ((results (org-ref-get-bibtex-key-and-file))
+ (key (car results))
+ (pdf-file (format (concat org-ref-pdf-directory "%s.pdf") key))
+ (bibfile (cdr results))
+ (url (save-excursion
+ (with-temp-buffer
+ (insert-file-contents bibfile)
+ (bibtex-search-entry key)
+ (bibtex-autokey-get-field "url"))))
+ (doi (save-excursion
+ (with-temp-buffer
+ (insert-file-contents bibfile)
+ (bibtex-search-entry key)
+ ;; I like this better than bibtex-url which does not always find
+ ;; the urls
+ (bibtex-autokey-get-field "doi"))))
+ (candidates `( ;;the first candidate is a brief summary
+ (,(save-excursion
+ (with-temp-buffer
+ (insert-file-contents bibfile)
+ (bibtex-search-entry key))
+ (org-ref-bib-citation)) . org-ref-citation-at-point)
+ ("Open bibtex entry" . org-ref-open-citation-at-point))))
+
+ (message-box "doi = \"%s\"" doi)
+ (when (file-exists-p pdf-file)
+ (add-to-list
+ 'candidates
+ '("Open pdf" . org-ref-open-pdf-at-point)
+ t
+ ))
+
+ (add-to-list
+ 'candidates
+ '("Open notes" . org-ref-open-notes-at-point)
+ t)
+
+ (when (or url doi)
+ (add-to-list
+ 'candidates
+ '("Open in browser" . org-ref-open-url-at-point)
+ t))
+
+ (when doi
+ (mapc (lambda (x)
+ (add-to-list 'candidates x t))
+ `(("WOS" . org-ref-wos-at-point)
+ ("Related articles in WOS" . org-ref-wos-related-at-point)
+ ("Citing articles in WOS" . org-ref-wos-citing-at-point)
+ ("Google Scholar" . org-ref-google-scholar-at-point)
+ ("Pubmed" . org-ref-pubmed-at-point)
+ ("Crossref" . org-ref-crossref-at-point)
+ )))
+
+ (add-to-list
+ 'candidates
+ '("Copy formatted citation to clipboard" . org-ref-copy-entry-as-summary)
+ t)
+
+ (add-to-list
+ 'candidates
+ '("Copy key to clipboard" . (lambda ()
+ (kill-new
+ (car (org-ref-get-bibtex-key-and-file)))))
+ t)