Fix byte-compiler warnings
* .gitignore: Ignore .elc files * calibre-book.el: Add requires * calibre-db.el: Declare functions that cannot be required. * calibre-library.el: Require dired * calibre-pkg.el ("calibre"): Bump version * calibre.el (calibre-book): Move earlier in the file. (calibre-library--refresh): Declare
This commit is contained in:
parent
b0f8f76723
commit
c6cb36b0a3
|
@ -1,2 +1,3 @@
|
|||
*~
|
||||
\#*\#
|
||||
*.elc
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
(require 'eieio)
|
||||
|
||||
(require 'calibre-util)
|
||||
(require 'calibre-db)
|
||||
(require 'calibre)
|
||||
|
||||
(defclass calibre-book ()
|
||||
((id :initarg :id
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
;; Fetch data from the library database.
|
||||
|
||||
;;; Code:
|
||||
(declare-function calibre--library "calibre.el")
|
||||
(declare-function calibre-make-book "calibre-book.el")
|
||||
|
||||
(defvar calibre--db nil)
|
||||
(defun calibre--db ()
|
||||
"Return the metadata database."
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
;; open books in Emacs.
|
||||
|
||||
;;; Code:
|
||||
(require 'dired)
|
||||
(require 'calibre-book)
|
||||
|
||||
(defconst calibre-library-buffer "*Library*")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(define-package
|
||||
"calibre"
|
||||
"1.0.0"
|
||||
"1.0.1"
|
||||
"Interact with Calibre libraries from Emacs"
|
||||
'((emacs "29.1.0"))
|
||||
:authors '(("Kjartan Oli Agustsson" . "kjartanoli@disroot.org"))
|
||||
|
|
19
calibre.el
19
calibre.el
|
@ -26,9 +26,10 @@
|
|||
;; associated with each book, and read them, all from within Emacs.
|
||||
|
||||
;;; Code:
|
||||
(require 'calibre-book)
|
||||
(require 'calibre-db)
|
||||
|
||||
(declare-function calibre-library--refresh "calibre-library.el")
|
||||
|
||||
(defgroup calibre nil
|
||||
"Interact with a Calibre library."
|
||||
:group 'calibre)
|
||||
|
@ -71,6 +72,14 @@ column should have."
|
|||
(directory :tag "Location")))
|
||||
:package-version '("calibre" . "0.1.0"))
|
||||
|
||||
(defvar calibre--books nil)
|
||||
(defun calibre--books (&optional force)
|
||||
"Return the in memory list of books.
|
||||
If FORCE is non-nil the list is refreshed from the database."
|
||||
(when (or force (not calibre--books))
|
||||
(setf calibre--books (calibre-db--get-books)))
|
||||
calibre--books)
|
||||
|
||||
(defun calibre--library-names ()
|
||||
"Return a list of the names of defined libraries."
|
||||
(mapcar #'car calibre-libraries))
|
||||
|
@ -101,13 +110,5 @@ If no library is active, prompt the user to select one."
|
|||
:type '(repeat symbol :tag "Format")
|
||||
:package-version '("calibre" . "0.1.0"))
|
||||
|
||||
(defvar calibre--books nil)
|
||||
(defun calibre--books (&optional force)
|
||||
"Return the in memory list of books.
|
||||
If FORCE is non-nil the list is refreshed from the database."
|
||||
(when (or force (not calibre--books))
|
||||
(setf calibre--books (calibre-db--get-books)))
|
||||
calibre--books)
|
||||
|
||||
(provide 'calibre)
|
||||
;;; calibre.el ends here
|
||||
|
|
Loading…
Reference in New Issue