]> git.donarmstrong.com Git - org-ref.git/blobdiff - org-ref.el
change to be consistent with http://oremacs.com/2015/03/30/elisp-ert-travis/ because...
[org-ref.git] / org-ref.el
index 080fa5e6162d515d2ec44c19475ffb10560e4de4..0356e1f6bb7911c2de3203b1a637b6befd65ba0b 100644 (file)
@@ -507,6 +507,7 @@ Format according to the type in `org-ref-bibliography-entry-format'."
 
     (with-temp-buffer
       (insert-file-contents file)
+      (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
       (bibtex-search-entry key nil 0)
       (setq bibtex-entry (bibtex-parse-entry))
       ;; downcase field names so they work in the format-citation code
@@ -581,6 +582,7 @@ Format according to the type in `org-ref-bibliography-entry-format'."
 
     (with-temp-buffer
       (insert-file-contents file)
+      (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
       (bibtex-search-entry key nil 0)
       (setq entry (bibtex-parse-entry))
       (format "** %s - %s
@@ -972,7 +974,7 @@ ARG does nothing."
                    (org-ref-count-labels label))))
  (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "(<label>%s</label>)" keyword))
+    ((eq format 'html) (format "<div id=\"%s\">" keyword))
     ((eq format 'latex)
      (format "\\label{%s}" keyword)))))
 
@@ -1051,7 +1053,7 @@ ARG does nothing."
  ;formatting
  (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "(<ref>%s</ref>)" keyword))
+    ((eq format 'html) (format "<a href=\"#%s\">%s</a>" keyword keyword))
     ((eq format 'latex)
      (format "\\ref{%s}" keyword)))))
 
@@ -1539,6 +1541,7 @@ falling back to what the user has set in `org-ref-default-bibliography'"
     (save-excursion
       (with-temp-buffer
         (insert-file-contents bibfile)
+        (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
         (bibtex-search-entry key)
         ;; I like this better than bibtex-url which does not always find
         ;; the urls
@@ -1565,6 +1568,7 @@ falling back to what the user has set in `org-ref-default-bibliography'"
     (save-excursion
       (with-temp-buffer
         (insert-file-contents bibfile)
+        (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
         (bibtex-search-entry key)
         (org-ref-open-bibtex-notes)))))
 
@@ -1579,6 +1583,7 @@ falling back to what the user has set in `org-ref-default-bibliography'"
     (message "%s" (progn
                    (with-temp-buffer
                       (insert-file-contents bibfile)
+                      (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
                       (bibtex-search-entry key)
                       (org-ref-bib-citation))))))
 
@@ -1651,6 +1656,7 @@ Prompt for NEW-FILE includes bib files in `org-ref-default-bibliography', and bi
     (save-excursion
       (with-temp-buffer
         (insert-file-contents bibfile)
+        (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
         (bibtex-search-entry key)
        (setq doi (bibtex-autokey-get-field "doi"))
        ;; in case doi is a url, remove the url part.
@@ -1708,11 +1714,13 @@ get a lot of options.  LINK-STRING is used by the link function."
         (url (save-excursion
                (with-temp-buffer
                  (insert-file-contents bibfile)
+                  (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
                  (bibtex-search-entry key)
                  (bibtex-autokey-get-field "url"))))
         (doi (save-excursion
                (with-temp-buffer
                  (insert-file-contents bibfile)
+                  (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
                  (bibtex-search-entry key)
                  ;; I like this better than bibtex-url which does not always find
                  ;; the urls
@@ -1789,6 +1797,7 @@ get a lot of options.  LINK-STRING is used by the link function."
        (save-excursion
          (with-temp-buffer
            (insert-file-contents bibfile)
+            (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
            (bibtex-search-entry key)
            (org-ref-bib-citation))))
       "\n"
@@ -2093,7 +2102,7 @@ arg (ALTERNATIVE-CITE) to get a menu of citation types."
 (defun org-ref-bib-citation ()
   "From a bibtex entry, create and return a simple citation string.
 This assumes you are in an article."
-
+  (bibtex-set-dialect nil t)
   (bibtex-beginning-of-entry)
   (let* ((cb (current-buffer))
         (bibtex-expand-strings t)
@@ -2740,6 +2749,7 @@ Shows bad citations, ref links and labels"
         (bibfile (cdr results)))
     (with-temp-buffer
       (insert-file-contents bibfile)
+      (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
       (bibtex-search-entry key nil 0)
       (prog1 (reftex-get-bib-field "year" (bibtex-parse-entry t))
         ))))
@@ -3227,6 +3237,7 @@ With two prefix args, insert a label link."
        (save-excursion
          (with-temp-buffer
            (insert-file-contents bibfile)
+            (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
            (bibtex-search-entry key)
            (org-ref-bib-citation)))
       "!!! No entry found !!!" )))
@@ -3242,11 +3253,13 @@ Checks for pdf and doi, and add appropriate functions."
         (url (save-excursion
                (with-temp-buffer
                  (insert-file-contents bibfile)
+                  (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
                  (bibtex-search-entry key)
                  (bibtex-autokey-get-field "url"))))
         (doi (save-excursion
                (with-temp-buffer
                  (insert-file-contents bibfile)
+                  (bibtex-set-dialect (parsebib-find-bibtex-dialect) t)
                  (bibtex-search-entry key)
                  ;; I like this better than bibtex-url which does not always find
                  ;; the urls