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:
Kjartan Óli Ágústsson 2023-04-17 23:13:32 +00:00
parent b0f8f76723
commit c6cb36b0a3
Signed by: kjartanoli
GPG Key ID: D7572FE3605EE6B0
6 changed files with 18 additions and 10 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*~
\#*\#
*.elc

View File

@ -28,6 +28,8 @@
(require 'eieio)
(require 'calibre-util)
(require 'calibre-db)
(require 'calibre)
(defclass calibre-book ()
((id :initarg :id

View File

@ -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."

View File

@ -23,6 +23,7 @@
;; open books in Emacs.
;;; Code:
(require 'dired)
(require 'calibre-book)
(defconst calibre-library-buffer "*Library*")

View File

@ -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"))

View File

@ -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