From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: ox-bibtex: Allow for missing bibtex style Date: Sat, 21 Dec 2013 16:15:53 +0100 Message-ID: <87d2kqjkuu.fsf@gmail.com> References: <52B2E086.3060108@gmail.com> <87ob4bjgut.fsf@gmail.com> <52B5551A.6040508@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuOHG-0004lb-NO for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 10:15:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuOH8-0006fR-9a for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 10:15:42 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:59226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuOH8-0006fK-0b for emacs-orgmode@gnu.org; Sat, 21 Dec 2013 10:15:34 -0500 Received: by mail-we0-f175.google.com with SMTP id t60so3599901wes.34 for ; Sat, 21 Dec 2013 07:15:33 -0800 (PST) In-Reply-To: <52B5551A.6040508@gmail.com> (Julian Gehring's message of "Sat, 21 Dec 2013 09:45:14 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julian Gehring Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Julian Gehring writes: > I would like to add this feature, if I knew how to program in lisp... > Would you like to work on this together? I could contribute on the > side of documenting and testing, if this helps. Fair enough. Here is a patch for you to test. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-bibtex-Allow-nil-style.patch >From 7f1ce8e8ba52152371e3aaf9af9a736fe443fde4 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 21 Dec 2013 16:13:56 +0100 Subject: [PATCH] ox-bibtex: Allow nil style * contrib/lisp/ox-bibtex.el (org-bibtex-process-bib-files, org-latex-keyword): Allow nil style. --- contrib/lisp/ox-bibtex.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 629695e..894d413 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -42,6 +42,8 @@ ;; ;; #+BIBLIOGRAPHY: foo plain option:-d ;; +;; "stylename" can also be "nil", in which case no style will be used. +;; ;; Optional options are of the form: ;; ;; option:-foobar pass '-foobar' to bibtex2html @@ -184,13 +186,16 @@ Return new parse tree." (append (plist-get arguments :options) (list "-citefile" temp-file)))))) ;; Call "bibtex2html" on specified file. - (unless (eq 0 (apply 'call-process - (append '("bibtex2html" nil nil nil) - '("-a" "-nodoc" "-noheader" "-nofooter") - (list "--style" - (org-bibtex-get-style keyword)) - (plist-get arguments :options) - (list (concat file ".bib"))))) + (unless (eq 0 (apply + 'call-process + (append '("bibtex2html" nil nil nil) + '("-a" "-nodoc" "-noheader" "-nofooter") + (let ((style + (org-not-nil + (org-bibtex-get-style keyword)))) + (and style (list "--style" style))) + (plist-get arguments :options) + (list (concat file ".bib"))))) (error "Executing bibtex2html failed")) (and temp-file (delete-file temp-file)) ;; Open produced HTML file, and collect Bibtex key names @@ -291,7 +296,7 @@ Fallback to `latex' back-end for other keywords." (if (not (equal (org-element-property :key keyword) "BIBLIOGRAPHY")) ad-do-it (let ((file (org-bibtex-get-file keyword)) - (style (org-bibtex-get-style keyword))) + (style (org-not-nil (org-bibtex-get-style keyword)))) (setq ad-return-value (when file (concat (and style (format "\\bibliographystyle{%s}\n" style)) -- 1.8.5.2 --=-=-=--