(eword-decode-version): Use `mime-module-version' instead of
[elisp/semi.git] / eword-decode.el
index 5fa3aed..6d86b00 100644 (file)
@@ -1,6 +1,6 @@
 ;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs
 
-;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
 
 ;; Author: ENAMI Tsugutomo <enami@sys.ptg.sony.co.jp>
 ;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;     Renamed: 1993/06/03 to tiny-mime.el
 ;;     Renamed: 1995/10/03 from tiny-mime.el (split off encoder)
 ;;     Renamed: 1997/02/22 from tm-ew-d.el
-;; Version: $Revision: 1.10 $
 ;; Keywords: encoded-word, MIME, multilingual, header, mail, news
 
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of SEMI (Spadework for Emacs MIME Interfaces).
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
   "Encoded-word decoding"
   :group 'mime)
 
-
-;;; @ version
-;;;
-
-(defconst eword-decode-RCS-ID
-  "$Id: eword-decode.el,v 1.10 1998-02-25 13:28:53 morioka Exp $")
-(defconst eword-decode-version (get-version-string eword-decode-RCS-ID))
+(defconst eword-decode-version
+  `,(mapconcat #'number-to-string (cddr mime-module-version) "."))
 
 
 ;;; @ MIME encoded-word definition
@@ -460,7 +454,7 @@ be the result."
                          (null (setq r (funcall func string must-unfold)))
                          )
                (setq rest (cdr rest)))
-             (or r '((error) . ""))
+             (or r `((error . ,string) . ""))
              ))
       (setq dest (cons (car ret) dest))
       (setq string (cdr ret))
@@ -514,11 +508,11 @@ such as a version of Net$cape)."
       (setq max-column fill-column))
   (let ((c start-column)
        (tokens (eword-lexical-analyze string must-unfold))
-       (result ""))
-    (while tokens
-      (let* ((token (car tokens))
-            (type (car token)))
-       (setq tokens (cdr tokens))
+       (result "")
+       token)
+    (while (and (setq token (car tokens))
+               (setq tokens (cdr tokens)))
+      (let* ((type (car token)))
        (if (eq type 'spaces)
            (let* ((next-token (car tokens))
                   (next-str (eword-decode-token next-token))
@@ -535,7 +529,9 @@ such as a version of Net$cape)."
            (setq result (concat result str)
                  c (+ c (string-width str)))
            ))))
-    result))
+    (if token
+       (concat result (eword-decode-token token))
+      result)))
 
 (defun eword-decode-and-unfold-structured-field (string)
   "Decode and unfold STRING as structured field body.