Synch with emiko-1_13
[elisp/semi.git] / emy.texi
index ef2e65c..8440473 100644 (file)
--- a/emy.texi
+++ b/emy.texi
@@ -1,6 +1,6 @@
 \input texinfo.tex              @c -*- texinfo -*-
 
-@setfilename emy
+@setfilename emy.info
 
 @set VERSION 1.13
 
@@ -71,7 +71,7 @@ EMY is a MIME interface for Emacs. EMY provides SEMI API, which
 is specified in a separate document.
 @c @xref{(semi-api)Top}.
 
-This manual correspond to EMY version @value{VERSION}.
+This manual corresponds to EMY version @value{VERSION}.
 @end ifnottex
 
 @menu
@@ -122,7 +122,7 @@ try persuading me.  Warning: `It's de facto standard' is not enough.
 @end menu
 
 @node Content-Type
-@subsection How things are interpretes with each types
+@subsection How things are interpreted with each types
 
 @node Overview
 @chapter Some basic things about EMY
@@ -134,17 +134,39 @@ try persuading me.  Warning: `It's de facto standard' is not enough.
 @end menu
 
 @node Customize
-@section What you should care
+@section What you should care about
+
+You can change how EMY works by setting various variables.  Normally you
+should change values after EMY is loaded.  However, there are some
+varaibles which should be set before anything has done.
+
+(Not yet fully documented.)
+
+@table @code
+@c @vindex mime-setup-enable-inline-image
+@item mime-setup-enable-inline-image
+
+@item mime-setup-enable-inline-html
+
+@item mime-setup-enable-pgp
+
+@item mime-setup-use-signature
+
+@c before signature.el is loaded.
+@item mime-setup-default-signature-key
+@item mime-setup-signature-key-alist
+@end table
 
 @node MIME-View
 @chapter Viewing MIME messages
 
-Right now only differences between SEMI and EMY are documented.
+Right now, only differences between SEMI and EMY are documented.
 
 @menu
-* Manipulating an Entity::     Changing representation of the part
-* Changing Entity Button::      Where to add button indicating that entity.
+* Manipulating an Entity::      Changing representation of a part.
+* Changing Entity Buttons::     Where to add button indicating that entity.
 * Adding Buttons::              Where you want to see buttons.
+* How to deal with broken MUA:: Some MUA sends totally broken messages.
 @end menu
 
 @node Manipulating an Entity
@@ -200,10 +222,36 @@ Unbuttonize article (@code{mime-preview-unbuttonize}).
 
 @end table
 
-@node Changing Entity Button
+@table @code
+
+@item C-c C-t C-h
+@kindex C-c C-t C-h (MIME-View)
+@findex mime-preview-toggle-header
+
+Toggle display of entity header.
+
+@item C-c C-t C-c
+@kindex C-c C-t C-c (MIME-View)
+@findex mime-preview-toggle-content
+
+Toggle display of entity body.
+
+@end table
+
+@node Changing Entity Buttons
 @section How buttons look like
 
-Not yet written.
+@vindex mime-use-widget
+Before EMY 1.13.6, you need W- variants of SEMI to show wigdet buttons
+From now on, you only need to set @code{mime-use-widget}
+to @code{t}.
+
+A button is a place where information about a given part is displayed.
+Its contents is already defined.
+
+[You should be able to customize button with format string.
+ This might be implemented in later versions.  If you
+ want it, speak up!]
 
 @node Adding Buttons
 @section Add button before, after or around an entity
@@ -214,7 +262,7 @@ You can customize where to add buttons and where to not with
 to change content of the button. It must be an alist of type or
 type/subtype vs. keywords.
 
-Three legal keywords are:
+Three valid keywords are:
 
 @table @code
 @item before
@@ -256,8 +304,99 @@ Default value is:
 This means you will have buttons around message/* and
 multipart/alternative, and before application/*.
 
+@node How to deal with broken MUA
+@section Invalid MIME messages
+
+Some MUAs send totally broken MIME messages.  According to the standard,
+it's perfectly fine for EMY not to grok those message.  However, EMY
+tries to extract as much information as possible.  Here's some functions
+that might help you.
+
+Some MUAs localized to Japanese sends these strings as a filename
+parameter of Content-Disposition.
+
+@example
+=?ISO-2022-JP?B?GyRCRnxLXDhsGyhC?=
+@end example
+
+It looks like encoded-words. This usage is strictly prohibited by RFC
+2047.  Instead, you should use mechanism described in RFC 2231.
+If you really want to ``decode'' it when saving it to file, you can use
+something like this.
+
+@lisp
+(mime-add-condition
+ 'action
+ '((mode . "extract")
+   (method . mime-save-content-for-broken-message)))
+@end lisp
+
+Unfortunately, there's no easy way to customize looking of buttons.
+It's on EMY's TODO list.
+
+If you are desperate, you can redefine
+@code{mime-view-insert-entity-button}.
+
+@lisp
+(defun mime-view-insert-entity-button (entity &optional body-is-invisible)
+  "Insert entity-button of ENTITY."
+  (let ((entity-node-id (mime-entity-node-id entity))
+       (params (mime-entity-parameters entity))
+       (subject (eword-decode-string (mime-view-entity-title entity))))
+    (mime-insert-button
+     (concat
+      (let ((access-type (assoc "access-type" params))
+           (num (or (cdr (assoc "x-part-number" params))
+                    (if (consp entity-node-id)
+                        (mapconcat (function
+                                    (lambda (num)
+                                      (format "%s" (1+ num))))
+                                   (reverse entity-node-id) ".")
+                      "0"))))
+       (cond (access-type
+              (let ((server (assoc "server" params)))
+                (setq access-type (cdr access-type))
+                (if server
+                    (format "%s %s ([%s] %s)"
+                            num subject access-type (cdr server))
+                  (let ((site (cdr (assoc "site" params)))
+                        (dir (cdr (assoc "directory" params)))
+                        (url (cdr (assoc "url" params))))
+                    (if url
+                        (format "%s %s ([%s] %s)"
+                                num subject access-type url)
+                      (format "%s %s ([%s] %s:%s)"
+                              num subject access-type site dir))))))
+             (t
+              (let ((media-type (mime-entity-media-type entity))
+                    (media-subtype (mime-entity-media-subtype entity))
+                    (charset (cdr (assoc "charset" params)))
+                    (encoding (mime-entity-encoding entity)))
+                (concat
+                 num " " subject
+                 (let ((rest
+                        (format " <%s/%s%s%s>"
+                                media-type media-subtype
+                                (if charset
+                                    (concat "; " charset)
+                                  "")
+                                (if encoding
+                                    (concat " (" encoding ")")
+                                  ""))))
+                   (if (>= (+ (current-column)(length rest))(window-width))
+                       "\n\t")
+                   rest))))))
+      (if body-is-invisible
+         " ..."
+       ""))
+     (function mime-preview-play-current-entity))))
+@end lisp
+
+@strong{Note:} These settings are unsupported until a better way is
+implemented.
+
 @node MIME-Edit
-@chapter Composing MIME messages.
+@chapter Composing MIME messages
 
 @vindex mime-edit-attach-at-end-type (MIME-Edit)
 When you are editing MIME message, you might want to insert some part at