branch: elpa/htmlize
commit aa6e2f6dba6fdfa200c7c55efe29ff63380eac8f
Author: Hrvoje Niksic <[email protected]>
Commit: Hrvoje Niksic <[email protected]>
Removed support for GNU Emacs 21.
---
NEWS | 5 +++++
htmlize.el | 35 ++++++-----------------------------
2 files changed, 11 insertions(+), 29 deletions(-)
diff --git a/NEWS b/NEWS
index ea488a8..484fc7a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
htmlize NEWS -- history of user-visible changes.
+* Changes in htmlize 1.47
+
+** GNU Emacs 21 is no longer supported.
+
+
* Changes in htmlize 1.45
** Correctly handle :inherit specifying a list of faces. (This bug
diff --git a/htmlize.el b/htmlize.el
index ef7acba..f613cfa 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -336,8 +336,7 @@ output.")
(next-property-change pos nil (or limit (point-max)))))
(defun htmlize-next-face-change (pos &optional limit)
(htmlize-next-change pos 'face limit)))
- ((fboundp 'next-single-char-property-change)
- ;; GNU Emacs 21+
+ (t
(defun htmlize-next-change (pos prop &optional limit)
(if prop
(next-single-char-property-change pos prop nil limit)
@@ -938,19 +937,7 @@ If no rgb.txt file is found, return nil."
;; `default' and the color is unspecified, look up the color in
;; frame parameters.
(let* ((function (if fg #'face-foreground #'face-background))
- color)
- (if (>= emacs-major-version 22)
- ;; For GNU Emacs 22+ set INHERIT to get the inherited values.
- (setq color (funcall function face nil t))
- (setq color (funcall function face))
- ;; For GNU Emacs 21 (which has `face-attribute'): if the color
- ;; is nil, recursively check for the face's parent.
- (when (and (null color)
- (fboundp 'face-attribute)
- (face-attribute face :inherit)
- (not (eq (face-attribute face :inherit) 'unspecified)))
- (setq color (htmlize-face-color-internal
- (face-attribute face :inherit) fg))))
+ (color (funcall function face nil t)))
(when (and (eq face 'default) (null color))
(setq color (cdr (assq (if fg 'foreground-color 'background-color)
(frame-parameters)))))
@@ -1043,7 +1030,7 @@ If no rgb.txt file is found, return nil."
css-name ; CSS name of face
)
-(defun htmlize-face-emacs21-attr (fstruct attr value)
+(defun htmlize-face-set-from-keyword-attr (fstruct attr value)
;; For ATTR and VALUE, set the equivalent value in FSTRUCT.
(case attr
(:foreground
@@ -1140,19 +1127,9 @@ If no rgb.txt file is found, return nil."
(face-underline-p face)))
;; GNU Emacs
(dolist (attr '(:weight :slant :underline :overline :strike-through))
- (let ((value (if (>= emacs-major-version 22)
- ;; Use the INHERIT arg in GNU Emacs 22.
- (face-attribute face attr nil t)
- ;; Otherwise, fake it.
- (let ((face face))
- (while (and (eq (face-attribute face attr)
- 'unspecified)
- (not (eq (face-attribute face :inherit)
- 'unspecified)))
- (setq face (face-attribute face :inherit)))
- (face-attribute face attr)))))
+ (let ((value (face-attribute face attr nil t)))
(when (and value (not (eq value 'unspecified)))
- (htmlize-face-emacs21-attr fstruct attr value))))
+ (htmlize-face-set-from-keyword-attr fstruct attr value))))
(let ((size (htmlize-face-size face)))
(unless (eql size 1.0) ; ignore non-spec
(setf (htmlize-fstruct-size fstruct) size))))
@@ -1226,7 +1203,7 @@ If no rgb.txt file is found, return nil."
(let ((attr (pop attrlist))
(value (pop attrlist)))
(when (and value (not (eq value 'unspecified)))
- (htmlize-face-emacs21-attr fstruct attr value))))))
+ (htmlize-face-set-from-keyword-attr fstruct attr value))))))
(setf (htmlize-fstruct-css-name fstruct) "ATTRLIST")
fstruct))