summaryrefslogtreecommitdiff
path: root/lisp/htmlfontify.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-04-05 21:00:18 +0200
committerAndrea Corallo <akrl@sdf.org>2021-04-05 21:00:18 +0200
commit74b58f28ecbc6fe9d7a60c96c79acfdf2329ff73 (patch)
treeb1e99508f836a1d12d17eb3072e14b0cfb2ba407 /lisp/htmlfontify.el
parent0a3e715e1f5e13874139b4678375b8f5704b800b (diff)
parent14d295871a93c37a33d558ec4e8d49a93b787d8e (diff)
downloademacs-74b58f28ecbc6fe9d7a60c96c79acfdf2329ff73.tar.gz
emacs-74b58f28ecbc6fe9d7a60c96c79acfdf2329ff73.tar.bz2
emacs-74b58f28ecbc6fe9d7a60c96c79acfdf2329ff73.zip
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'lisp/htmlfontify.el')
-rw-r--r--lisp/htmlfontify.el29
1 files changed, 13 insertions, 16 deletions
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 0c8d5348247..b453061388f 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -523,22 +523,10 @@ therefore no longer care about) will be invalid at any time.\n
(defvar hfy-tmpfont-stack nil
"An alist of derived fonts resulting from overlays.")
-(defconst hfy-hex-regex "[[:xdigit:]]")
-
(defconst hfy-triplet-regex
- (concat
- "\\(" hfy-hex-regex hfy-hex-regex "\\)"
- "\\(" hfy-hex-regex hfy-hex-regex "\\)"
- "\\(" hfy-hex-regex hfy-hex-regex "\\)"))
-
-(defun hfy-interq (set-a set-b)
- "Return the intersection (using `eq') of two lists SET-A and SET-B."
- (let ((sa set-a) (interq nil) (elt nil))
- (while sa
- (setq elt (car sa)
- sa (cdr sa))
- (if (memq elt set-b) (setq interq (cons elt interq))))
- interq))
+ (rx (group xdigit xdigit)
+ (group xdigit xdigit)
+ (group xdigit xdigit)))
(defun hfy-color-vals (color)
"Where COLOR is a color name or #XXXXXX style triplet, return a
@@ -887,7 +875,9 @@ See also `hfy-display-class' for details of valid values for CLASS."
(setq score 0) (ignore "t match"))
((not (cdr (assq key face-class))) ;Neither good nor bad.
nil (ignore "non match, non collision"))
- ((setq x (hfy-interq val (cdr (assq key face-class))))
+ ((setq x (nreverse
+ (seq-intersection val (cdr (assq key face-class))
+ #'eq)))
(setq score (+ score (length x)))
(ignore "intersection"))
(t ;; nope.
@@ -2355,6 +2345,13 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'."
(let ((file (hfy-initfile)))
(load file 'NOERROR nil nil) ))
+;; Obsolete.
+
+(defun hfy-interq (set-a set-b)
+ "Return the intersection (using `eq') of two lists SET-A and SET-B."
+ (declare (obsolete seq-intersection "28.1"))
+ (nreverse (seq-intersection set-a set-b #'eq)))
+
(provide 'htmlfontify)
;;; htmlfontify.el ends here