From: shuhei Date: Wed, 2 May 2001 12:03:15 +0000 (+0000) Subject: (eword-decode-encoded-word): Don't use `let'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1ee76cc560b4e94c4c96a6963374a467cbc32c67;p=elisp%2Fflim.git (eword-decode-encoded-word): Don't use `let'. --- diff --git a/eword-decode.el b/eword-decode.el index 1c5ce86..328cc28 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -528,32 +528,32 @@ If SEPARATOR is not nil, it is used as header separator." word)) (defun eword-decode-encoded-word (word &optional must-unfold) - "Decode WORD if it is an encoded-word. - -If your emacs implementation can not decode the charset of WORD, it -returns WORD. Similarly the encoded-word is broken, it returns WORD. - -If MUST-UNFOLD is non-nil, it unfolds and eliminates line-breaks even -if there are in decoded encoded-word (generated by bad manner MUA such -as a version of Net$cape)." - (or (if (string-match eword-encoded-word-regexp word) - (let ((charset - (substring word (match-beginning 1)(match-end 1))) - (language - (when (match-beginning 2) - (intern - (downcase - (substring word (1+ (match-beginning 2))(match-end 2)))))) - (encoding - (upcase - (substring word (match-beginning 3)(match-end 3)))) - (text - (substring word (match-beginning 4)(match-end 4)))) - (condition-case err - (eword-decode-encoded-text - charset language encoding text must-unfold) - (error - (funcall eword-decode-encoded-word-error-handler word err))))) + "Decode WORD as an encoded-word. + +If charset is unknown or unsupported, return WORD. +If encoding is unknown, or some error occurs while decoding, +`eword-decode-encoded-word-error-handler' is called with WORD and an +error condition. + +If MUST-UNFOLD is non-nil, unfold decoded WORD." + (or (and (string-match eword-encoded-word-regexp word) + (condition-case err + (eword-decode-encoded-text + ;; charset + (substring word (match-beginning 1)(match-end 1)) + ;; language + (when (match-beginning 2) + (intern + (downcase + (substring word (1+ (match-beginning 2))(match-end 2))))) + ;; encoding + (upcase + (substring word (match-beginning 3)(match-end 3))) + ;; encoded-text + (substring word (match-beginning 4)(match-end 4)) + must-unfold) + (error + (funcall eword-decode-encoded-word-error-handler word err)))) word))