X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=fd9e3d65fd425b68d15e4cb3b08171f9d3bc00a7;hp=28ea7d8e9a8a13e83da52620a63bf317fca6e22d;hb=951d95f355c40bcfe7a9c4a7c7a64580ac89f6b5;hpb=b7734ac8c13e5ea2d8d6c2df59def28a07dc401e diff --git a/org-ref.org b/org-ref.org index 28ea7d8..fd9e3d6 100644 --- a/org-ref.org +++ b/org-ref.org @@ -1428,7 +1428,9 @@ The function must take no arguments and work on the key at point. Do not modify (with-temp-buffer (insert-file-contents bibfile) (bibtex-search-entry key) - (bibtex-autokey-get-field "doi"))))) + (bibtex-autokey-get-field "doi") + ;; in case doi is a url, remove the url part. + (replace-regexp-in-string "^http://dx.doi.org/" "" doi))))) ;; functions that operate on key at point for click menu @@ -1554,11 +1556,20 @@ Provides a menu of context sensitive actions. If the bibtex entry has a pdf, you ;; construct menu string as a message (message (concat + (let* ((results (org-ref-get-bibtex-key-and-file)) + (key (car results)) + (bibfile (cdr results))) + (save-excursion + (with-temp-buffer + (insert-file-contents bibfile) + (bibtex-search-entry key) + (org-ref-bib-citation)))) + "\n" (mapconcat (lambda (tup) (concat "[" (elt tup 0) "]" (elt tup 1) " ")) - org-ref-cite-menu-funcs "") ": ")) + org-ref-cite-menu-funcs ""))) ;; get the input (let* ((input (read-char-exclusive)) (choice (assoc @@ -1571,6 +1582,9 @@ Provides a menu of context sensitive actions. If the bibtex entry has a pdf, you 2)))))) #+END_SRC +#+RESULTS: +: org-ref-cite-onclick-minibuffer-menu + *** A function to format a cite link Next, we define a formatting function for the cite link. This is done so that the cite link definition is very short, and easy to change. You just need to specify the functions in the definition. This function is deprecated. The formatting is defined later automatically.