From b5cfd3afc09c25d4ea7f7c1ebbaf51c816624d45 Mon Sep 17 00:00:00 2001 From: Patrick Elliott Date: Fri, 22 Jun 2018 12:07:35 +0200 Subject: [PATCH] minor refactor of bibtex module --- modules/lang/latex/config.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 265529304..d4f85fe0b 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -171,10 +171,7 @@ (setq bibtex-completion-bibliography (list (expand-file-name +latex-bibtex-file)))) (unless (string-empty-p +latex-bibtex-dir) (setq bibtex-completion-library-path (list +latex-bibtex-dir) - bibtex-completion-pdf-field "file" - bibtex-completion-notes-path (expand-file-name "notes.org" +latex-bibtex-dir) - bibtex-completion-pdf-open-function - (lambda (fpath) (async-start-process "open-pdf" "/usr/bin/xdg-open" nil fpath)))) + bibtex-completion-notes-path (expand-file-name "notes.org" +latex-bibtex-dir))) (define-key bibtex-mode-map (kbd "C-c \\") #'bibtex-fill-entry)) @@ -194,12 +191,24 @@ (def-package! ivy-bibtex :when (featurep! :completion ivy) :commands ivy-bibtex - :config (setq ivy-bibtex-default-action 'ivy-bibtex-insert-key)) + :config + (setq ivy-bibtex-default-action 'ivy-bibtex-insert-key) + (unless (string-empty-p +latex-bibtex-file) + (setq bibtex-completion-bibliography (list (expand-file-name +latex-bibtex-file)))) + (unless (string-empty-p +latex-bibtex-dir) + (setq bibtex-completion-library-path (list +latex-bibtex-dir) + bibtex-completion-notes-path (expand-file-name "notes.org" +latex-bibtex-dir)))) (def-package! helm-bibtex :when (featurep! :completion helm) - :commands helm-bibtex) + :commands helm-bibtex + :config + (unless (string-empty-p +latex-bibtex-file) + (setq bibtex-completion-bibliography (list (expand-file-name +latex-bibtex-file)))) + (unless (string-empty-p +latex-bibtex-dir) + (setq bibtex-completion-library-path (list +latex-bibtex-dir) + bibtex-completion-notes-path (expand-file-name "notes.org" +latex-bibtex-dir)))) (def-package! company-auctex