[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre 521fc7471b 66/76: Add faces to make library buf
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/calibre 521fc7471b 66/76: Add faces to make library buffer easier to parse |
|
Date: |
Thu, 18 May 2023 09:57:46 -0400 (EDT) |
branch: externals/calibre
commit 521fc7471b61d943b96661c8541feb8654c9cdba
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Add faces to make library buffer easier to parse
* calibre-library.el (calibre-library-mode): Set font lock keywords
for library buffer.
* calibre.el (calibre-faces): Create group.
(calibre-modified, calibre-modified-face, calibre-flagged,
calibre-flagged-face): Create faces.
(calibre-font-lock-keywords): Create font lock keywords.
---
calibre-library.el | 2 ++
calibre.el | 33 +++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/calibre-library.el b/calibre-library.el
index 7d7558348a..ade73112f8 100644
--- a/calibre-library.el
+++ b/calibre-library.el
@@ -123,6 +123,8 @@
(define-derived-mode calibre-library-mode tabulated-list-mode
(setf tabulated-list-padding 2)
(setq-local revert-buffer-function #'calibre-library-revert)
+ (setq-local font-lock-defaults
+ '(calibre-font-lock-keywords t nil nil beginning-of-line))
(calibre-library--set-header))
;;;###autoload
diff --git a/calibre.el b/calibre.el
index 634bfb9c25..562c72a134 100644
--- a/calibre.el
+++ b/calibre.el
@@ -55,5 +55,38 @@
(defconst calibre-mod-marker ?M
"Character used to flag books that have been modified.")
+
+;;; Faces
+
+(defgroup calibre-faces nil
+ "Faces used by Calibre."
+ :group 'calibre
+ :group 'faces)
+
+(defface calibre-modified
+ '((t (:inherit warning)))
+ "Face used for marked as modified."
+ :group 'calibre-faces
+ :package-version '("calibre" . "1.2.0"))
+
+(defvar calibre-modified-face 'calibre-modified
+ "Face used for marked as modified.")
+
+(defface calibre-flagged
+ '((t (:inherit error)))
+ "Face used for books flagged for deletion."
+ :group 'calibre-faces
+ :package-version '("calibre" . "1.2.0"))
+
+(defvar calibre-flagged-face 'calibre-flagged
+ "Face used for books flagged for deletion.")
+
+(defvar calibre-font-lock-keywords
+ (list
+ (list (concat "^[" (char-to-string calibre-del-marker) "]")
+ '(".+" (beginning-of-line) nil (0 calibre-flagged-face)))
+ (list (concat "^[" (char-to-string calibre-mod-marker) "]")
+ '(".+" (beginning-of-line) nil (0 calibre-modified-face)))))
+
(provide 'calibre)
;;; calibre.el ends here
- [elpa] externals/calibre 2b64cb76ad 49/76: Add support for displaying publication date, (continued)
- [elpa] externals/calibre 2b64cb76ad 49/76: Add support for displaying publication date, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre ca0ae8a1d3 74/76: Pick some format if no preferred format is available, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre c6cb36b0a3 17/76: Fix byte-compiler warnings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 8c791fb915 05/76: Add missing sort by series function, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 360fbf15cb 02/76: Fix defcustom version strings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 76427bf5be 07/76: Allow customisation of the columns of the library buffer, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre d8682121d8 23/76: Reorder variable declarations, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre a750735b89 33/76: Add ability to revert Library buffer, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre b2c34a58d4 44/76: Use the right column name in query, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 7a8ed52e86 51/76: Set revert-buffer-function instead of using revert hooks, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 521fc7471b 66/76: Add faces to make library buffer easier to parse,
ELPA Syncer <=
- [elpa] externals/calibre 8ae08bd7fb 68/76: Update README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 5e81e98079 18/76: Add README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre bdb11248c9 20/76: Move metadata into calibre.el, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 1c0bf191d5 35/76: Refresh Library buffer when calibre-library-columns is changed, ELPA Syncer, 2023/05/18
- [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