branch: externals/calibre
commit c6cb36b0a31c10f4b229964c69eb5925c1c8be33
Author: Kjartan Óli Ágústsson <[email protected]>
Commit: Kjartan Óli Ágústsson <[email protected]>
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
---
.gitignore | 1 +
calibre-book.el | 2 ++
calibre-db.el | 3 +++
calibre-library.el | 1 +
calibre-pkg.el | 2 +-
calibre.el | 19 ++++++++++---------
6 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/.gitignore b/.gitignore
index 74c36c8628..29bf2cf007 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*~
\#*\#
+*.elc
diff --git a/calibre-book.el b/calibre-book.el
index 9ac46483f0..fd973f8856 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -28,6 +28,8 @@
(require 'eieio)
(require 'calibre-util)
+(require 'calibre-db)
+(require 'calibre)
(defclass calibre-book ()
((id :initarg :id
diff --git a/calibre-db.el b/calibre-db.el
index 10a00213da..b772e1e53a 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -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."
diff --git a/calibre-library.el b/calibre-library.el
index 6242c21d92..66fbba24e5 100644
--- a/calibre-library.el
+++ b/calibre-library.el
@@ -23,6 +23,7 @@
;; open books in Emacs.
;;; Code:
+(require 'dired)
(require 'calibre-book)
(defconst calibre-library-buffer "*Library*")
diff --git a/calibre-pkg.el b/calibre-pkg.el
index ab31af36b2..3b47ff4a38 100644
--- a/calibre-pkg.el
+++ b/calibre-pkg.el
@@ -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" . "[email protected]"))
diff --git a/calibre.el b/calibre.el
index b1f5b1549a..381f60738f 100644
--- a/calibre.el
+++ b/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