]> git.donarmstrong.com Git - org-ref.git/blobdiff - org-ref.org
add eqref to link message
[org-ref.git] / org-ref.org
index 0561f76a7d583075264fdd1d2099a3f18fa679fe..858ab3798d3be5776eedcc66df196022600d94d9 100644 (file)
@@ -2727,6 +2727,10 @@ ref:test citep:test  label:rett
       (message (org-ref-get-label-context
                (org-element-property :path object))))
 
+     ((string= type "eqref")
+      (message (org-ref-get-label-context
+               (org-element-property :path object))))
+
      ;; message the count
      ((string= type "label")
       (let ((count (org-ref-count-labels
@@ -2874,20 +2878,33 @@ Checks for pdf and doi, and add appropriate functions."
                  (bibtex-autokey-get-field "doi"))))
         (candidates `(("Quit" . org-ref-citation-at-point)
                       ("Open bibtex entry" . org-ref-open-citation-at-point))))
+    ;; for some reason, when there is no doi or url, they are returned as "". I
+    ;; prefer nil so we correct this here.
+    (when (string= doi "") (setq doi nil))
+    (when (string= url "") (setq url nil))
 
-
-    (when (file-exists-p pdf-file)
+    ;; Conditional pdf functions
+    (if (file-exists-p pdf-file)
+       (add-to-list
+        'candidates
+        '("Open pdf" . org-ref-open-pdf-at-point)
+        t)
       (add-to-list
        'candidates
-       '("Open pdf" . org-ref-open-pdf-at-point)
-       t
-       ))
+       '("Try to get pdf" . (lambda ()
+                             (save-window-excursion
+                               (org-ref-open-citation-at-point)
+                                (bibtex-beginning-of-entry)
+                               (doi-utils-get-bibtex-entry-pdf))))
+       t))
+
 
     (add-to-list
      'candidates
      '("Open notes" . org-ref-open-notes-at-point)
      t)
 
+    ;; conditional url and doi functions
     (when (or url doi)
       (add-to-list
        'candidates