From: Devon Buchanan Date: Tue, 3 Mar 2015 20:14:58 +0000 (+0000) Subject: Modified the makefile to conforms better to the emacs lisp package X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=commitdiff_plain;h=71e2eb117e7e73d0cd065646407a08b578b2b72d Modified the makefile to conforms better to the emacs lisp package specification. --- diff --git a/.gitignore b/.gitignore index 00e3105..10e1479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ *.el *.elc -!org-ref-init.el \ No newline at end of file +/dist/ diff --git a/Cask b/Cask index 2701a2b..1ff38b4 100644 --- a/Cask +++ b/Cask @@ -1,9 +1,7 @@ (source gnu) (source melpa) -(package-file "org-ref-init.el") - -(files "*.el" "*.info" "*.org") +(package-file "org-ref.el") (development (depends-on "ecukes") diff --git a/Makefile b/Makefile index 6019338..13a1f5a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ EMACS ?= emacs -CASK_EXEC ?= cask exec +CASK ?= cask +CASK_EXEC ?= ${CASK} exec +ORG_SOURCES = doi-utils.org org-ref.org pubmed.org +EL_TANGLED = ${ORG_SOURCES:.org=.el} +EL_SOURCES = arxiv.el jmax-bibtex.el +SOURCES = ${EL_TANGLED} ${EL_SOURCES} all: test @@ -15,4 +20,13 @@ compile: clean-elc: rm -f f.elc -.PHONY: all test +clean-tangled: + rm ${EL_TANGLED} + +package : ${SOURCES} + ${CASK} package + +%.el: %.org + ${EMACS} -Q -batch $< -f org-babel-tangle + +.PHONY: all test package clean-elc clean-tangled diff --git a/org-ref-init.el b/org-ref-init.el deleted file mode 100644 index 8f4733d..0000000 --- a/org-ref-init.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; org-ref-init.el --- cite and cross-reference in org-mode - -;; Copyright(C) 2014 John Kitchin - -;; Author: John Kitchin -;; URL: https://github.com/jkitchin/org-ref -;; Version: 0.1 -;; Keywords: org-mode, cite, ref, label -;; Package-Requires: ((dash) (helm) (helm-bibtex)) - -;; This file is not currently part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program ; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: -;; -;; Lisp code to setup bibliography cite, ref and label org-mode links. -;; also sets up reftex and helm for org-mode citations. The links are -;; clickable and do things that are useful. You should really read -;; org-ref.org for details. -;; - -;;; Code: - -(require 'cl) - -;; org path for loadable org-files -(defvar org-ref-org-load-path - nil - "List of directories to find org-files that `org-babel-load-file' can load code from.") - -;; https://github.com/jkitchin/org-ref -(defun org-ref-org-require (feature) - "Load a FEATURE from an org-file. -FEATURE is a symbol, and it is loaded from an org-file by the name of FEATURE.org, that is in the `org-load-path'. The FEATURE is loaded from `org-babel-load-file'." - (let ((org-file (concat (symbol-name feature) ".org")) - (path)) - - ;; find the org-file - (catch 'result - (loop for dir in org-ref-org-load-path do - (when (file-exists-p - (setq path - (expand-file-name - org-file - dir))) - (throw 'result path)))) - (let ((default-directory (file-name-directory path))) - (org-babel-load-file path)))) - -;; remember this directory -(defconst org-ref-dir (file-name-directory (or load-file-name - (buffer-file-name))) - "Directory where org-ref is installed.") - -;; for loading org-files -(add-to-list 'org-ref-org-load-path org-ref-dir) -;; for loading emacs-lisp files -(add-to-list 'load-path org-ref-dir) - -(org-ref-org-require 'org-ref) -(org-ref-org-require 'doi-utils) -(org-ref-org-require 'pubmed) -(require 'jmax-bibtex) - -(provide 'org-ref-init) - -;;; org-ref-init.el ends here diff --git a/org-ref.org b/org-ref.org index 9665744..6ecfc58 100644 --- a/org-ref.org +++ b/org-ref.org @@ -28,11 +28,16 @@ With helm integration (default) you can: ** Header #+BEGIN_SRC emacs-lisp :tangle org-ref.el -;;; org-ref.el --- setup bibliography, cite, ref and label org-mode links. +;;; org-ref.el --- cite and cross-reference in org-mode ;; Copyright(C) 2014 John Kitchin ;; Author: John Kitchin +;; URL: https://github.com/jkitchin/org-ref +;; Version: 0.1 +;; Keywords: org-mode, cite, ref, label +;; Package-Requires: ((dash) (helm) (helm-bibtex)) + ;; This file is not currently part of GNU Emacs. ;; This program is free software; you can redistribute it and/or @@ -52,11 +57,13 @@ With helm integration (default) you can: ;;; Commentary: ;; -;; Lisp code to setup bibliography cite, ref and label org-mode links. also -;; sets up reftex and helm for org-mode citations. The links are clickable and -;; do things that are useful. You should really read org-ref.org for details. +;; Lisp code to setup bibliography cite, ref and label org-mode links. +;; also sets up reftex and helm for org-mode citations. The links are +;; clickable and do things that are useful. You should really read +;; org-ref.org for details. ;; -;; Package-Requires: ((dash) (helm) (helm-bibtex)) + +;;; Code: #+END_SRC ** requires @@ -3813,6 +3820,8 @@ _o_: Open entry _e_: Email entry and pdf * End of code #+BEGIN_SRC emacs-lisp :tangle org-ref.el (provide 'org-ref) + +;;; org-ref.el ends here #+END_SRC * Build :noexport: