From efbc457ce5d9971f440ff5d5c83226e0a2c62f22 Mon Sep 17 00:00:00 2001 From: Justin Silverman Date: Fri, 10 Jun 2022 14:05:15 -0400 Subject: [PATCH 1/2] Fix for invalid author year error --- org-bib.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-bib.el b/org-bib.el index fd0e187..806197d 100644 --- a/org-bib.el +++ b/org-bib.el @@ -37,6 +37,7 @@ ;;; Code: (require 'org) (require 'bibtex) +(require 'url) ;; Configuration From 9ba845bb81a7ab4503cee738a66c1b35342b6f62 Mon Sep 17 00:00:00 2001 From: Justin Silverman Date: Fri, 10 Jun 2022 14:05:30 -0400 Subject: [PATCH 2/2] Making header icons customizable --- org-bib.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org-bib.el b/org-bib.el index 806197d..4cb41a5 100644 --- a/org-bib.el +++ b/org-bib.el @@ -330,6 +330,10 @@ bibitem and there are also a :key and :type fields." (:month . ,(org-bib--bibitem-get "month")) (:publisher . ,(org-bib--bibitem-get "publisher")))))) +(defvar org-bib-url-icon "") +(defvar org-bib-doi-icon "") +(defvar org-bib-filename-icon "") + (defun org-bib--format-header (&optional key) "Formatted org Header org for entry KEY. This should be configurable." @@ -339,9 +343,9 @@ bibitem and there are also a :key and :type fields." (filename (org-bib--get-file key)) (url (org-bib--get-url key)) (doi (org-bib--get-doi key)) - (prefix (cond (filename (format "[[%s][]]" filename)) - (url (format "[[%s][]]" url)) - (doi (format "[[%s][]]" (concat "http://dx.doi.org/" doi))) + (prefix (cond (filename (format "[[%s][%s]]" filename org-bib-filename-icon)) + (url (format "[[%s][%s]]" url org-bib-url-icon)) + (doi (format "[[%s][%s]]" (concat "http://dx.doi.org/" doi) org-bib-doi-icon)) (t " ")))) (format "** %s %s (%s)" prefix title year)))