Don't close the tag in mml-insert-tag. Define new function
authorHrvoje Niksic <hniksic@xemacs.org>
Fri, 3 Dec 1999 14:45:50 +0000 (14:45 +0000)
committerHrvoje Niksic <hniksic@xemacs.org>
Fri, 3 Dec 1999 14:45:50 +0000 (14:45 +0000)
mml-insert-empty-tag that does that, and use it throughout.

lisp/ChangeLog
lisp/mml.el

index 4f1c069..3895cc3 100644 (file)
@@ -1,3 +1,13 @@
+1999-11-11  Hrvoje Niksic  <hniksic@iskon.hr>
+
+       * mml.el (mml-insert-tag): Don't close the tag.
+       (mml-insert-empty-tag): New function.
+       (mml-attach-file): Use mml-insert-empty-tag instead of
+       mml-insert-tag.
+       (mml-attach-buffer): Ditto.
+       (mml-attach-external): Ditto.
+       (mml-insert-multipart): Ditto.
+
 1999-12-03 08:49:53  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * nnfolder.el (nnfolder-request-article): Return -1 if not find
index b90fc26..9203465 100644 (file)
@@ -654,7 +654,14 @@ called for this message.")
        (when (string-match "[\"\\~/* \t\n]" value)
          (setq value (prin1-to-string value)))
        (insert (format " %s=%s" key value)))))
-  (insert ">\n<#/" name ">\n"))
+  (insert ">\n"))
+
+(defun mml-insert-empty-tag (name &rest plist)
+  "Insert an empty MML tag described by NAME and PLIST."
+  (when (symbolp name)
+    (setq name (symbol-name name)))
+  (apply #'mml-insert-tag name plist)
+  (insert "<#/" name ">\n"))
 
 ;;; Attachment functions.
 
@@ -671,8 +678,8 @@ description of the attachment."
          (type (mml-minibuffer-read-type file))
          (description (mml-minibuffer-read-description)))
      (list file type description)))
-  (mml-insert-tag 'part 'type type 'filename file 'disposition "attachment"
-                 'description description))
+  (mml-insert-empty-tag 'part 'type type 'filename file
+                       'disposition "attachment" 'description description))
 
 (defun mml-attach-buffer (buffer &optional type description)
   "Attach a buffer to the outgoing MIME message.
@@ -682,8 +689,8 @@ See `mml-attach-file' for details of operation."
          (type (mml-minibuffer-read-type buffer "text/plain"))
          (description (mml-minibuffer-read-description)))
      (list buffer type description)))
-  (mml-insert-tag 'part 'type type 'buffer buffer 'disposition "attachment"
-                 'description description))
+  (mml-insert-empty-tag 'part 'type type 'buffer buffer
+                       'disposition "attachment" 'description description))
 
 (defun mml-attach-external (file &optional type description)
   "Attach an external file into the buffer.
@@ -694,8 +701,8 @@ TYPE is the MIME type to use."
          (type (mml-minibuffer-read-type file))
          (description (mml-minibuffer-read-description)))
      (list file type description)))
-  (mml-insert-tag 'external 'type type 'name file 'disposition "attachment"
-                 'description description))
+  (mml-insert-empty-tag 'external 'type type 'name file
+                       'disposition "attachment" 'description description))
 
 (defun mml-insert-multipart (&optional type)
   (interactive (list (completing-read "Multipart type (default mixed): "
@@ -704,7 +711,7 @@ TYPE is the MIME type to use."
                     nil nil "mixed")))
   (or type
       (setq type "mixed"))
-  (mml-insert-tag "multipart" 'type type)
+  (mml-insert-empty-tag "multipart" 'type type)
   (forward-line -1))
 
 (defun mml-preview (&optional raw)