[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre 533c68f55f 27/76: Do right alignment correctly
From: |
ELPA Syncer |
Subject: |
[elpa] externals/calibre 533c68f55f 27/76: Do right alignment correctly |
Date: |
Thu, 18 May 2023 09:57:43 -0400 (EDT) |
branch: externals/calibre
commit 533c68f55f170b8b7aa0ba1fe22b4cc50f0d72bf
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Do right alignment correctly
* calibre-db.el (calibre-book--print-info): Simply call int-to-string
instead of using format.
Don't get the now useless width attribute of a column.
* calibre-library.el (calibre-library--header-format): Add docstring.
Set right-align property on id and series-index.
Allow sorting by series-index.
---
calibre-db.el | 5 ++---
calibre-library.el | 16 +++++++++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/calibre-db.el b/calibre-db.el
index aa2fede8c3..848ecb02dc 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -158,10 +158,9 @@ BOOK is a `calibre-book'."
(list book
(with-slots (id title authors publishers series series-index tags
formats) book
(vconcat (mapcar (lambda (x)
- (let ((column (car x))
- (width (cdr x)))
+ (let ((column (car x)))
(cl-case column
- (id (format (format "%%%ds" width) id))
+ (id (int-to-string id))
(title title)
(authors (string-join authors ", "))
(publishers (string-join publishers ", "))
diff --git a/calibre-library.el b/calibre-library.el
index 5c4e9f4077..71da2f5f2c 100644
--- a/calibre-library.el
+++ b/calibre-library.el
@@ -99,6 +99,9 @@ ARGS should be a list of strings. SENTINEL is a process
sentinel to install."
(find-file (calibre-book--file book (calibre-book--pick-format book))))
(defun calibre-library--header-format ()
+ "Create the header for the Library buffer.
+Return a vector suitable as the value of `tabulated-list-format'
+with values determined by `calibre-library-columns'."
(vconcat
(mapcar (lambda (x)
(let ((column (car x))
@@ -106,13 +109,16 @@ ARGS should be a list of strings. SENTINEL is a process
sentinel to install."
(cl-case column
(id `("ID" ,width (lambda (a b)
(< (calibre-book-id (car a))
- (calibre-book-id (car b))))))
- (title `("Title" ,width))
- (authors `("Author(s)" ,width))
- (publishers `("Publisher(s)" ,width))
+ (calibre-book-id (car b))))
+ :right-align t))
+ (title `("Title" ,width t))
+ (authors `("Author(s)" ,width t))
+ (publishers `("Publisher(s)" ,width t))
(series `("Series" ,width (lambda (a b)
(calibre-book-sort-by-series (car
a) (car b)))))
- (series-index `("#" ,width))
+ (series-index `("#" ,width (lambda (a b)
+ (calibre-book-sort-by-series
(car a) (car b)))
+ :right-align t))
(tags `("Tags" ,width))
(formats `("Formats" ,width)))))
calibre-library-columns)))
- [elpa] externals/calibre c644d0761d 40/76: Slight improvement to README, (continued)
- [elpa] externals/calibre c644d0761d 40/76: Slight improvement to README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre be94be6962 46/76: Add ability to filter by series and format, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 89e52d61c0 50/76: Only allow single publisher per book, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre c6a5772da0 29/76: Fix docstring, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 7396636341 30/76: Only refresh Library buffer if it exists, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 6d7ed97ab6 31/76: Use the value of calibre-calibredb-executable, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 4a0d5b9606 32/76: Factor the setting of the Library header into a function, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 85e3ac6337 48/76: Add missing space in completing-read prompt, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 6366966c9b 60/76: Add abstraction layer on top of calibre-db, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 9a54c7a6b4 09/76: Add function to add books from dired, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 533c68f55f 27/76: Do right alignment correctly,
ELPA Syncer <=
- [elpa] externals/calibre 3e6ce3abc2 39/76: Bump package version, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 569c096746 45/76: Use macros to avoid repeating similar function definitions, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 04c484a2ef 55/76: Preserve marks when refreshing library, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre d51ac1d3e6 54/76: Don't use message to format string, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 30ec9ca2da 56/76: Use queuing to avoid multiple concurrent calls to calibredb, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 48fc9eb57b 61/76: Don't create buffer for processes, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 4069bbfd10 71/76: Bump package version, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 3e9b74bfd4 65/76: Use constants instead of magic literals for marks, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre e283a2c928 76/76: Use correct separator when setting multiple authors, ELPA Syncer, 2023/05/18