From: morioka Date: Thu, 25 Sep 1997 15:11:34 +0000 (+0000) Subject: (emh-highlight-header): Don't use `assoc-if' and `second'. X-Git-Tag: XEmacs-20_3-b27-viet~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=753dc78dbd342013da69415fea836cb4427565cc;p=elisp%2Femh.git (emh-highlight-header): Don't use `assoc-if' and `second'. --- 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) ))