From: morioka Date: Wed, 6 May 1998 11:47:06 +0000 (+0000) Subject: (eword-decode-encoded-word-error-handler): New variable. X-Git-Tag: flim-1_2_0~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a4c5550837cdfb5bb9cfc746587de486f8df4106;p=elisp%2Fflim.git (eword-decode-encoded-word-error-handler): New variable. (eword-decode-encoded-word-default-error-handler): New function. (eword-decode-encoded-word): Use 'eword-decode-encoded-word-error-handler. --- diff --git a/eword-decode.el b/eword-decode.el index 93976fd..0bf4f54 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -258,7 +258,18 @@ If SEPARATOR is not nil, it is used as header separator." ;;; @ encoded-word decoder ;;; -(defvar eword-warning-face nil "Face used for invalid encoded-word.") +(defvar eword-decode-encoded-word-error-handler + 'eword-decode-encoded-word-default-error-handler) + +(defvar eword-warning-face nil + "Face used for invalid encoded-word.") + +(defun eword-decode-encoded-word-default-error-handler (word signal) + (and (add-text-properties 0 (length word) + (and eword-warning-face + (list 'face eword-warning-face)) + word) + word)) (defun eword-decode-encoded-word (word &optional must-unfold) "Decode WORD if it is an encoded-word. @@ -283,12 +294,8 @@ as a version of Net$cape)." (condition-case err (eword-decode-encoded-text charset encoding text must-unfold) (error - (and - (add-text-properties 0 (length word) - (and eword-warning-face - (list 'face eword-warning-face)) - word) - word))) + (funcall eword-decode-encoded-word-error-handler word err) + )) )) word))