chenyanming / calibredb.el

Emacs calibre client - An Ebook Management Solution in Emacs.
GNU General Public License v3.0
323 stars 17 forks source link

Declare faces used by `calibredb-search-header` #60

Closed ipvych closed 2 years ago

ipvych commented 2 years ago

This PR adds 5 new faces that calibredb-search-header function will use instead of hardcoding them.

I also fixed a typo and a missing period in docstrings of two faces that I noticed.

protesilaos commented 2 years ago

Hello! There is a mismatch between the face symbols which include -header- and those applied which have -title- instead.

protesilaos commented 2 years ago

I mean this:

 calibredb-search.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/calibredb-search.el b/calibredb-search.el
index 3c79ef2..a80b6ab 100644
--- a/calibredb-search.el
+++ b/calibredb-search.el
@@ -344,13 +344,13 @@ (defun calibredb-search-header ()
   "TODO: Return the string to be used as the Calibredb header.
 Indicating the library you use."
   (format "%s: %s   %s"
-          (propertize calibredb-virtual-library-name 'face 'calibredb-search-title-library-name-face)
-          (propertize calibredb-root-dir 'face 'calibredb-search-title-library-path-face)
+          (propertize calibredb-virtual-library-name 'face 'calibredb-search-header-library-name-face)
+          (propertize calibredb-root-dir 'face 'calibredb-search-header-library-path-face)
           (concat
            (propertize (format "Total: %s"
                                (if (equal calibredb-search-entries '(""))
                                    "0   "
-                                 (concat (number-to-string (length calibredb-search-entries)) "  "))) 'face 'calibredb-search-title-total-face)
+                                 (concat (number-to-string (length calibredb-search-entries)) "  "))) 'face 'calibredb-search-header-total-face)
            (cond ((eq calibredb-sort-by 'id)
                   "Sort: id ")
                  ((eq calibredb-sort-by 'title)
@@ -386,10 +386,10 @@ (defun calibredb-search-header ()
                                 (t ""))
                                (if (equal calibredb-search-filter "")
                                    ""
-                                 (concat calibredb-search-filter "   "))) 'face 'calibredb-search-title-sort-face)
+                                 (concat calibredb-search-filter "   "))) 'face 'calibredb-search-header-sort-face)
            (propertize (let ((len (length (calibredb-find-marked-candidates))))
                          (if (> len 0)
-                             (concat "Marked: " (number-to-string len)) "")) 'face 'calibredb-search-title-filter-face))))
+                             (concat "Marked: " (number-to-string len)) "")) 'face 'calibredb-search-header-filter-face))))

 (define-derived-mode calibredb-search-mode fundamental-mode "calibredb-search"
   "Major mode for listing calibre entries.
chenyanming commented 2 years ago

I will check, let me revert.

protesilaos commented 2 years ago

I will check, let me revert.

On my end, the patch from @ivan-pop was working after I changed it with the diff above.

chenyanming commented 2 years ago

Yes, you are right, fixed.

protesilaos commented 2 years ago

Thank you!