[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 78318a2 114/134: Support face-remapping-alist. (#1
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 78318a2 114/134: Support face-remapping-alist. (#13) |
Date: |
Sat, 7 Aug 2021 09:17:18 -0400 (EDT) |
branch: elpa/htmlize
commit 78318a20126548ac7f9a41ad79c09a556751d8a7
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>
Support face-remapping-alist. (#13)
---
htmlize.el | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index 683c06a..f06dfe0 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -1122,8 +1122,8 @@ If no rgb.txt file is found, return nil."
;; Apply the prefix.
(concat htmlize-css-name-prefix name)))
-(defun htmlize-face-to-fstruct (face)
- "Convert Emacs face FACE to fstruct."
+(defun htmlize-face-to-fstruct-1 (face)
+ "Convert Emacs face FACE to fstruct, internal."
(let ((fstruct (make-htmlize-fstruct
:foreground (htmlize-color-to-rgb
(htmlize-face-foreground face))
@@ -1154,6 +1154,21 @@ If no rgb.txt file is found, return nil."
(setf (htmlize-fstruct-css-name fstruct) (htmlize-face-css-name face))
fstruct))
+(defun htmlize-face-to-fstruct (face)
+ (let* ((face-list (or (and (symbolp face)
+ (alist-get face face-remapping-alist))
+ (list face)))
+ (fstruct (htmlize-merge-faces
+ (mapcar (lambda (face)
+ (if (symbolp face)
+ (or (htmlize-get-override-fstruct face)
+ (htmlize-face-to-fstruct-1 face))
+ (htmlize-attrlist-to-fstruct face)))
+ (nreverse face-list)))))
+ (when (symbolp face)
+ (setf (htmlize-fstruct-css-name fstruct) (htmlize-face-css-name face)))
+ fstruct))
+
(defmacro htmlize-copy-attr-if-set (attr-list dest source)
;; Generate code with the following pattern:
;; (progn
@@ -1280,10 +1295,7 @@ If no rgb.txt file is found, return nil."
(unless (gethash face face-map)
;; Haven't seen FACE yet; convert it to an fstruct and cache
;; it.
- (let ((fstruct (if (symbolp face)
- (or (htmlize-get-override-fstruct face)
- (htmlize-face-to-fstruct face))
- (htmlize-attrlist-to-fstruct face))))
+ (let ((fstruct (htmlize-face-to-fstruct face)))
(setf (gethash face face-map) fstruct)
(let* ((css-name (htmlize-fstruct-css-name fstruct))
(new-name css-name)
- [nongnu] elpa/htmlize 61760b4 075/134: Implement the `htmlize-link' property to embed links in the HTML., (continued)
- [nongnu] elpa/htmlize 61760b4 075/134: Implement the `htmlize-link' property to embed links in the HTML., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 296b18e 033/134: Extract a bit of code outside buffer-substring-no-invisible., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize e3d020e 059/134: Remove explicit references to MULE., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5dbea0b 079/134: Convert the auto-link-creation machinery to use the `htmlize-link' property., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize bad6391 082/134: Look for PROP., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 380ba4b 084/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5b29cde 090/134: Update NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7eb326a 099/134: Fix package header format, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 4570d0a 103/134: Add README., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 8f46e10 105/134: Use htmlpreview., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 78318a2 114/134: Support face-remapping-alist. (#13),
ELPA Syncer <=
- [nongnu] elpa/htmlize 9b49540 133/134: Replace cl with cl-lib, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a040bdd 127/134: Don't try to call color-instance-rgb-components., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 0a73b2b 043/134: Change `insert-text' method to `text-markup', so that the text can be, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ec862a1 049/134: Get rid of byte-compiler warnings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3308bf9 052/134: Preserve the `display' property during untabification., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 62020d5 054/134: Fix erroneous comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ef8b865 055/134: Add some docs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 148ac7d 061/134: Consistently eliminate unnecessary string creation in (apply #'concat ...)., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3faeac8 069/134: Explicitly mark sort as stable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize af69752 062/134: Consistently handle the multitude of ways to specify the `face' property., ELPA Syncer, 2021/08/07