]> git.eshelyaron.com Git - emacs.git/commitdiff
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
authorMiles Bader <miles@gnu.org>
Wed, 25 Jan 2006 06:47:24 +0000 (06:47 +0000)
committerMiles Bader <miles@gnu.org>
Wed, 25 Jan 2006 06:47:24 +0000 (06:47 +0000)
Merge from gnus--rel--5.10

Patches applied:

 * gnus--rel--5.10  (patch 4-7)

   - Update from CVS

lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/mailcap.el
lisp/gnus/mm-uu.el
lisp/gnus/mm-view.el
lisp/gnus/mml.el

index fb99c71c9c8e5533182b81b58d6c2352222cc6cf..fbbf7281b69f863f7bf43c041fbe43d13d00bb6c 100644 (file)
@@ -1,3 +1,41 @@
+2006-01-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-uu.el (mm-uu-dissect-text-parts): Ignore it if a given part
+       is dissected into a single part of which the type is the same as
+       the given one.
+
+2006-01-21  Kevin Ryde  <user42@zip.com.au>
+
+       * mailcap.el (mailcap-parse-mailcap-extras): "test" key must go
+       into alists as symbol not string, since that's what
+       mailcap-viewer-passes-test and mailcap-mailcap-entry-passes-test
+       look for.
+
+2006-01-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-uu.el (mm-uu-dissect-text-parts): Reduce the number of
+       recursive calls.
+
+2006-01-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-view.el (mm-w3m-standalone-supports-m17n-p): New variable.
+       (mm-w3m-standalone-supports-m17n-p): New function.
+       (mm-inline-text-html-render-with-w3m-standalone): Use it to alter
+       w3m usage.
+
+       * gnus-art.el (gnus-article-wash-html-with-w3m-standalone): Use
+       mm-w3m-standalone-supports-m17n-p to alter w3m usage.
+
+2006-01-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-uu.el (mm-uu-dissect-text-parts): Decode content transfer
+       encoding.
+
+2006-01-20  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * mml.el (mml-attach-file): Describe `description' in doc string.
+       (mml-menu): Add Emacs MIME manual and PGG manual.
+
 2006-01-19  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * spam.el (spam-group-ham-mark-p, spam-group-spam-mark-p)
index 92a4f09ded3bcd2e2b74c4f36ef2000d18c1410c..b51ceff29a9fa9b536840a25c7e2ab44912223b7 100644 (file)
@@ -2541,15 +2541,18 @@ charset defined in `gnus-summary-show-article-charset-alist' is used."
 
 (defun gnus-article-wash-html-with-w3m-standalone ()
   "Wash the current buffer with w3m."
-  (unless (mm-coding-system-p charset)
-    ;; The default.
-    (setq charset 'iso-8859-1))
-  (let ((coding-system-for-write charset)
-       (coding-system-for-read charset))
-    (call-process-region
-     (point-min) (point-max)
-     "w3m" t t nil "-dump" "-T" "text/html"
-     "-I" (symbol-name charset) "-O" (symbol-name charset))))
+  (if (mm-w3m-standalone-supports-m17n-p)
+      (progn
+       (unless (mm-coding-system-p charset) ;; Bound by `article-wash-html'.
+         ;; The default.
+         (setq charset 'iso-8859-1))
+       (let ((coding-system-for-write charset)
+             (coding-system-for-read charset))
+         (call-process-region
+          (point-min) (point-max)
+          "w3m" t t nil "-dump" "-T" "text/html"
+          "-I" (symbol-name charset) "-O" (symbol-name charset))))
+    (mm-inline-wash-with-stdin nil "w3m" "-dump" "-T" "text/html")))
 
 (defun article-hide-list-identifiers ()
   "Remove list identifies from the Subject header.
index 166edb60f7a76803660f475dc3216cffbacd7651..8015364581905cf0c727a9678a14b157f18c8761 100644 (file)
@@ -528,7 +528,12 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus
                    (skip-chars-forward ";"))
                (setq done t))))
          (setq value (buffer-substring val-pos (point))))
-       (setq results (cons (cons name value) results))
+       ;; `test' as symbol, others like "copiousoutput" and "needsx11" as
+       ;; strings
+       (setq results (cons (cons (if (string-equal name "test")
+                                      'test
+                                    name)
+                                  value) results))
        (skip-chars-forward " \";\n\t"))
       results)))
 
index 2bebede4bfc2676cd85fd6c1789c6c6b1ed58695..fa36582af010dbfb96126487ccb80ad3b0d5a9f2 100644 (file)
@@ -511,25 +511,40 @@ value of `mm-uu-text-plain-type'."
 
 (defun mm-uu-dissect-text-parts (handle)
   "Dissect text parts and put uu handles into HANDLE."
-  (let ((buffer (mm-handle-buffer handle))
-       (case-fold-search t)
-       type children)
+  (let ((buffer (mm-handle-buffer handle)))
     (cond ((stringp buffer)
           (dolist (elem (cdr handle))
             (mm-uu-dissect-text-parts elem)))
          ((bufferp buffer)
-          (when (and (setq type (mm-handle-media-type handle))
-                     (stringp type)
-                     ;; Mutt still uses application/pgp even though
-                     ;; it has already been withdrawn.
-                     (string-match "\\`text/\\|\\`application/pgp\\'" type)
-                     (with-current-buffer buffer
-                       (setq children
-                             (mm-uu-dissect t (mm-handle-type handle)))))
-            (kill-buffer buffer)
-            (setcar handle (car children))
-            (setcdr handle (cdr children))
-            (mm-uu-dissect-text-parts handle)))
+          (let ((type (mm-handle-media-type handle))
+                (case-fold-search t) ;; string-match
+                encoding children)
+            (when (and
+                   (stringp type)
+                   ;; Mutt still uses application/pgp even though
+                   ;; it has already been withdrawn.
+                   (string-match "\\`text/\\|\\`application/pgp\\'" type)
+                   (setq children
+                         (with-current-buffer buffer
+                           (if (setq encoding (mm-handle-encoding handle))
+                               ;; Inherit the multibyteness of the `buffer'.
+                               (with-temp-buffer
+                                 (insert-buffer-substring buffer)
+                                 (mm-decode-content-transfer-encoding
+                                  encoding type)
+                                 (mm-uu-dissect t (mm-handle-type handle)))
+                             (mm-uu-dissect t (mm-handle-type handle))))))
+              ;; Ignore it if a given part is dissected into a single
+              ;; part of which the type is the same as the given one.
+              (if (and (<= (length children) 2)
+                       (string-equal (mm-handle-media-type (cadr children))
+                                     type))
+                  (kill-buffer (mm-handle-buffer (cadr children)))
+                (kill-buffer buffer)
+                (setcdr handle (cdr children))
+                (setcar handle (car children)) ;; "multipart/mixed"
+                (dolist (elem (cdr children))
+                  (mm-uu-dissect-text-parts elem))))))
          (t
           (dolist (elem handle)
             (mm-uu-dissect-text-parts elem))))))
index 645e960b53533414736f67feacbb2c02291670f4..73cab0a56765e037031399a22c5df25d058d9a0d 100644 (file)
              (delete-region ,(point-min-marker)
                             ,(point-max-marker)))))))))
 
+(defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
+  "*T means the w3m command supports the m17n feature.")
+
+(defun mm-w3m-standalone-supports-m17n-p ()
+  "Say whether the w3m command supports the m17n feature."
+  (cond ((eq mm-w3m-standalone-supports-m17n-p t) t)
+       ((eq mm-w3m-standalone-supports-m17n-p nil) nil)
+       ((not (featurep 'mule)) (setq mm-w3m-standalone-supports-m17n-p nil))
+       ((condition-case nil
+            (let ((coding-system-for-write 'iso-2022-jp)
+                  (coding-system-for-read 'iso-2022-jp)
+                  (str (mm-decode-coding-string "\
+\e$B#D#o#e#s!!#w#3#m!!#s#u#p#p#o#r#t#s!!#m#1#7#n!)\e(B" 'iso-2022-jp)))
+              (mm-with-multibyte-buffer
+                (insert str)
+                (call-process-region
+                 (point-min) (point-max) "w3m" t t nil "-dump"
+                 "-T" "text/html" "-I" "iso-2022-jp" "-O" "iso-2022-jp")
+                (goto-char (point-min))
+                (search-forward str nil t)))
+          (error nil))
+        (setq mm-w3m-standalone-supports-m17n-p t))
+       (t
+        ;;(message "You had better upgrade your w3m command")
+        (setq mm-w3m-standalone-supports-m17n-p nil))))
+
 (defun mm-inline-text-html-render-with-w3m-standalone (handle)
   "Render a text/html part using w3m."
-  (let ((source (mm-get-part handle))
-       (charset (mail-content-type-get (mm-handle-type handle) 'charset))
-       cs)
-    (unless (and charset
-                (setq cs (mm-charset-to-coding-system charset))
-                (not (eq cs 'ascii)))
-      ;; The default.
-      (setq charset "iso-8859-1"
-           cs 'iso-8859-1))
-    (mm-insert-inline
-     handle
-     (mm-with-unibyte-buffer
-       (insert source)
-       (mm-enable-multibyte)
-       (let ((coding-system-for-write 'binary)
-            (coding-system-for-read cs))
-        (call-process-region
-         (point-min) (point-max)
-         "w3m" t t nil "-dump" "-T" "text/html"
-         "-I" charset "-O" charset))
-       (buffer-string)))))
+  (if (mm-w3m-standalone-supports-m17n-p)
+      (let ((source (mm-get-part handle))
+           (charset (mail-content-type-get (mm-handle-type handle) 'charset))
+           cs)
+       (unless (and charset
+                    (setq cs (mm-charset-to-coding-system charset))
+                    (not (eq cs 'ascii)))
+         ;; The default.
+         (setq charset "iso-8859-1"
+               cs 'iso-8859-1))
+       (mm-insert-inline
+        handle
+        (mm-with-unibyte-buffer
+          (insert source)
+          (mm-enable-multibyte)
+          (let ((coding-system-for-write 'binary)
+                (coding-system-for-read cs))
+            (call-process-region
+             (point-min) (point-max)
+             "w3m" t t nil "-dump" "-T" "text/html"
+             "-I" charset "-O" charset))
+          (buffer-string))))
+    (mm-inline-render-with-stdin handle nil "w3m" "-dump" "-T" "text/html")))
 
 (defun mm-links-remove-leading-blank ()
   ;; Delete the annoying three spaces preceding each line of links
index 8b00313fb92e1eca6ff778db7bc6712bba0ced27..90f7c5f09dd0b87a4b54f4d234cda5dade7ef73b 100644 (file)
@@ -38,6 +38,7 @@
   (autoload 'gnus-add-minor-mode "gnus-ems")
   (autoload 'gnus-make-local-hook "gnus-util")
   (autoload 'message-fetch-field "message")
+  (autoload 'message-info "message")
   (autoload 'fill-flowed-encode "flow-fill")
   (autoload 'message-posting-charset "message"))
 
@@ -917,7 +918,14 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
     ;;["Narrow" mml-narrow-to-part t]
     ["Quote MML" mml-quote-region t]
     ["Validate MML" mml-validate t]
-    ["Preview" mml-preview t]))
+    ["Preview" mml-preview t]
+    "----"
+    ["Emacs MIME manual" (lambda () (interactive) (message-info 4))
+     ,@(if (featurep 'xemacs) '(t)
+        '(:help "Display the Emacs MIME manual"))]
+    ["PGG manual" (lambda () (interactive) (message-info 16))
+     ,@(if (featurep 'xemacs) '(t)
+        '(:help "Display the PGG manual"))]))
 
 (defvar mml-mode nil
   "Minor mode for editing MML.")
@@ -1036,9 +1044,12 @@ See Info node `(emacs-mime)Composing'.
 The file is not inserted or encoded until you send the message with
 `\\[message-send-and-exit]' or `\\[message-send]'.
 
-FILE is the name of the file to attach.  TYPE is its content-type, a
-string of the form \"type/subtype\".  DESCRIPTION is a one-line
-description of the attachment."
+FILE is the name of the file to attach.  TYPE is its
+content-type, a string of the form \"type/subtype\".  DESCRIPTION
+is a one-line description of the attachment.  The DISPOSITION
+specifies how the attachment is intended to be displayed.  It can
+be either \"inline\" (displayed automatically within the message
+body) or \"attachment\" (separate from the body)."
   (interactive
    (let* ((file (mml-minibuffer-read-file "Attach file: "))
          (type (mml-minibuffer-read-type file))