From 753dc78dbd342013da69415fea836cb4427565cc Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 25 Sep 1997 15:11:34 +0000 Subject: [PATCH] (emh-highlight-header): Don't use `assoc-if' and `second'. --- emh-face.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/emh-face.el b/emh-face.el index 3d6f42a..2014d23 100644 --- a/emh-face.el +++ b/emh-face.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Created: 1997/3/4 -;; Version: $Id: emh-face.el,v 0.4 1997-05-22 03:24:36 morioka Exp $ +;; Version: $Id: emh-face.el,v 0.5 1997-09-25 15:11:34 morioka Exp $ ;; Keywords: header, highlighting ;; This file is part of emh. @@ -130,17 +130,22 @@ (med (match-end 0)) (end (std11-field-end)) (field-name (buffer-substring beg med)) - (rule (cdr (or (assoc-if (function - (lambda (key) - (and (stringp key) - (string-match key field-name) - ))) - emh-header-face) - (assq t emh-header-face) - ))) + (rule (catch 'found + (let ((rest emh-header-face)) + (while rest + (let* ((rule (car rest)) + (key (car rule))) + (if (and (stringp key) + (string-match key field-name)) + (throw 'found (cdr rule)) + )) + (setq rest (cdr rest)) + ) + (cdr (assq t emh-header-face)) + ))) ) (overlay-put (make-overlay beg med) 'face (car rule)) - (overlay-put (make-overlay med end) 'face (second rule)) + (overlay-put (make-overlay med end) 'face (cadr rule)) ) (forward-char) )) -- 1.7.10.4