[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize a4569e3 092/134: Correctly handle :inherit specify
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize a4569e3 092/134: Correctly handle :inherit specifying a list of faces. |
Date: |
Sat, 7 Aug 2021 09:17:14 -0400 (EDT) |
branch: elpa/htmlize
commit a4569e3392f37491e0e3e0d466f9b41270eafe21
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>
Correctly handle :inherit specifying a list of faces.
---
NEWS | 6 ++++++
htmlize.el | 27 ++++++++++++++++++++-------
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/NEWS b/NEWS
index 0a984ac..ea488a8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
htmlize NEWS -- history of user-visible changes.
+* Changes in htmlize 1.45
+
+** Correctly handle :inherit specifying a list of faces. (This bug
+would cause an error in AUX TeX buffers.)
+
+
* Changes in htmlize 1.44
** Faces specified in the `face' property are now prioritized the same
diff --git a/htmlize.el b/htmlize.el
index de22383..1ed0356 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -1072,13 +1072,26 @@ If no rgb.txt file is found, return nil."
(defun htmlize-face-size (face)
;; The size (height) of FACE, taking inheritance into account.
;; Only works in Emacs 21 and later.
- (let ((size-list
- (loop
- for f = face then (face-attribute f :inherit)
- until (or (not f) (eq f 'unspecified))
- for h = (face-attribute f :height)
- collect (if (eq h 'unspecified) nil h))))
- (reduce 'htmlize-merge-size (cons nil size-list))))
+ (let* ((face-list (list face))
+ (head face-list)
+ (tail face-list))
+ (while head
+ (let ((inherit (face-attribute (car head) :inherit)))
+ (cond ((listp inherit)
+ (setcdr tail (copy-list inherit))
+ (setq tail (last tail)))
+ ((eq inherit 'unspecified))
+ (t
+ (setcdr tail (list inherit))
+ (setq tail (cdr tail)))))
+ (pop head))
+ (message "%s" face-list)
+ (let ((size-list
+ (loop
+ for f in face-list
+ for h = (face-attribute f :height)
+ collect (if (eq h 'unspecified) nil h))))
+ (reduce 'htmlize-merge-size (cons nil size-list)))))
(defun htmlize-face-css-name (face)
;; Generate the css-name property for the given face. Emacs places
- [nongnu] elpa/htmlize ef8b865 055/134: Add some docs., (continued)
- [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
- [nongnu] elpa/htmlize 0ba773b 067/134: Specify some `rgb.txt' locations that actually exist!, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 6baf891 070/134: Implement customizable image transformation, htmlize-force-inline-images, and image alt text., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ba5ddf3 073/134: Enable edebug stepping into htmlize-lexlet., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 6b3b3b6 077/134: Purge asterisks from variable docstrings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7947b8b 074/134: Don't generate ALT text larger than 100 chars or containing control chars., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 93294ff 091/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a4569e3 092/134: Correctly handle :inherit specifying a list of faces.,
ELPA Syncer <=
- [nongnu] elpa/htmlize 31bc1a8 094/134: Remove stray debugging print., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 8c09264 097/134: Bump version and copyright., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a95e591 107/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 2c41d79 101/134: Update mail address., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 9d4ad62 102/134: Set type and group attribute for custom variable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 88e2cb6 109/134: Update copyright info., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5ea2cc3 113/134: Let `overlays-at' sort the overlays. (#9), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 1bc2f1b 118/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 726c77b 120/134: Correctly sort overlays in Emacs 24., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a8b73f1 122/134: New option htmlize-untabify. (#21), ELPA Syncer, 2021/08/07