(message-use-idna): Use mm-coding-system-p.
authorDave Love <fx@gnu.org>
Fri, 2 May 2003 17:54:04 +0000 (17:54 +0000)
committerDave Love <fx@gnu.org>
Fri, 2 May 2003 17:54:04 +0000 (17:54 +0000)
(message-tokenize-header, message-make-organization)
(message-make-from):  Use with-temp-buffer.
(message-set-work-buffer): Deleted.
(message-fill-paragraph): Use `if' not `and' for compiler warning.
(message-check-news-header-syntax): Remove useless lambda.
(message-forward-make-body): Use mm-disable-multibyte,
mm-with-unibyte-current-buffer, mm-enable-multibyte.
(message-replace-chars-in-string): Deleted.

lisp/message.el

index af5aed1..b374ae5 100644 (file)
@@ -303,6 +303,8 @@ few false positives here."
   :group 'message-various
   :type 'regexp)
 
+;; Fixme: Why are all these things autoloaded?
+
 ;;; marking inserted text
 
 ;;;###autoload
@@ -1305,8 +1307,7 @@ no, only reply back to the author."
 
 (defcustom message-use-idna (and (condition-case nil (require 'idna)
                                   (file-error))
-                                (fboundp 'coding-system-p)
-                                (coding-system-p 'utf-8)
+                                (mm-coding-system-p 'utf-8)
                                 'ask)
   "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
   :group 'message-headers
@@ -1494,8 +1495,8 @@ is used by default."
          (beg 1)
          (first t)
          quoted elems paren)
-      (save-excursion
-       (message-set-work-buffer)
+      (with-temp-buffer
+       (mm-enable-multibyte)
        (insert header)
        (goto-char (point-min))
        (while (not (eobp))
@@ -1588,15 +1589,6 @@ is used by default."
       (mail-narrow-to-head)
       (message-fetch-field header))))
 
-(defun message-set-work-buffer ()
-  (if (get-buffer " *message work*")
-      (progn
-       (set-buffer " *message work*")
-       (erase-buffer))
-    (set-buffer (get-buffer-create " *message work*"))
-    (kill-all-local-variables)
-    (mm-enable-multibyte)))
-
 (defun message-functionp (form)
   "Return non-nil if FORM is funcallable."
   (or (and (symbolp form) (fboundp form))
@@ -2722,7 +2714,7 @@ Prefix arg means justify as well."
 (defun message-fill-paragraph (&optional arg)
   "Like `fill-paragraph'."
   (interactive (list (if current-prefix-arg 'full)))
-  (if (and (boundp 'filladapt-mode) filladapt-mode)
+  (if (if (boundp 'filladapt-mode) filladapt-mode)
       nil
     (message-newline-and-reformat arg t)
     t))
@@ -3928,7 +3920,7 @@ Otherwise, generate and save a value for `canlock-password' first."
                    (length
                     (setq to (completing-read
                               "Followups to (default: no Followup-To header) "
-                              (mapcar (lambda (g) (list g))
+                              (mapcar #'list
                                       (cons "poster"
                                             (message-tokenize-header
                                              newsgroups)))))))))
@@ -4411,8 +4403,8 @@ If NOW, use that time instead."
            (if (message-functionp message-user-organization)
                (funcall message-user-organization)
              message-user-organization))))
-    (save-excursion
-      (message-set-work-buffer)
+    (with-temp-buffer
+      (mm-enable-multibyte)
       (cond ((stringp organization)
             (insert organization))
            ((and (eq t organization)
@@ -4496,8 +4488,8 @@ If NOW, use that time instead."
              (user-full-name))))
     (when (string= fullname "&")
       (setq fullname (user-login-name)))
-    (save-excursion
-      (message-set-work-buffer)
+    (with-temp-buffer
+      (mm-enable-multibyte)
       (cond
        ((or (null style)
            (equal fullname ""))
@@ -5944,11 +5936,11 @@ Optional DIGEST will use digest to forward."
               (not message-forward-decoded-p))
          (insert
           (with-temp-buffer
-            (mm-disable-multibyte-mule4)
+            (mm-disable-multibyte)
             (insert
              (with-current-buffer forward-buffer
-               (mm-with-unibyte-current-buffer-mule4 (buffer-string))))
-            (mm-enable-multibyte-mule4)
+               (mm-with-unibyte-current-buffer (buffer-string))))
+            (mm-enable-multibyte)
             (mime-to-mml)
             (goto-char (point-min))
             (when (looking-at "From ")
@@ -6396,11 +6388,6 @@ regexp varstr."
                (cdr local)))))
      locals)))
 
-;;; Miscellaneous functions
-
-(defsubst message-replace-chars-in-string (string from to)
-  (mm-subst-char-in-string from to string))
-
 ;;;
 ;;; MIME functions
 ;;;