]> git.eshelyaron.com Git - emacs.git/commitdiff
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
authorMiles Bader <miles@gnu.org>
Sun, 31 Jul 2005 00:12:23 +0000 (00:12 +0000)
committerMiles Bader <miles@gnu.org>
Sun, 31 Jul 2005 00:12:23 +0000 (00:12 +0000)
Merge from gnus--rel--5.10

Patches applied:

 * gnus--rel--5.10  (patch 99)

   - Update from CVS

2005-07-29  Katsumi Yamaoka  <yamaoka@jpl.org>

   * lisp/gnus/gnus-art.el (gnus-article-next-page-1): Reduce the number of
   lines to scroll rather than to stop it.

   * lisp/gnus/mml.el (mml-generate-default-type): Add doc string.
   (mml-generate-mime-1): Use mm-default-file-encoding or make it
   default to application/octet-stream when determining the content
   type if it is not specified for the part or the mml contents; add
   a comment about mml-generate-default-type.

2005-07-29  Reiner Steib  <Reiner.Steib@gmx.de>

   * lisp/gnus/mml.el (mml-generate-mime-1): Use mm-default-file-encoding or
   make it default to application/octet-stream when determining the
   content type if it is not specified for the external contents.

2005-07-27  Katsumi Yamaoka  <yamaoka@jpl.org>

   * lisp/gnus/mm-decode.el (mm-display-external): Delete temp file, directory
   and buffer immediately if the external process is exited.

lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el
lisp/gnus/mm-decode.el
lisp/gnus/mml.el

index 7bc733ad90f2a548fb2bc3a6de03006d05dcd599..6b25403e47b224355dc8bf96f17fef5a71352b42 100644 (file)
@@ -1,8 +1,30 @@
+2005-07-29  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-next-page-1): Reduce the number of
+       lines to scroll rather than to stop it.
+
+       * mml.el (mml-generate-default-type): Add doc string.
+       (mml-generate-mime-1): Use mm-default-file-encoding or make it
+       default to application/octet-stream when determining the content
+       type if it is not specified for the part or the mml contents; add
+       a comment about mml-generate-default-type.
+
+2005-07-29  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * mml.el (mml-generate-mime-1): Use mm-default-file-encoding or
+       make it default to application/octet-stream when determining the
+       content type if it is not specified for the external contents.
+
 2005-07-28  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * rfc2231.el (rfc2231-parse-string): Take care that not only a
        segmented parameter but also other parameters might be there.
 
+2005-07-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-decode.el (mm-display-external): Delete temp file, directory
+       and buffer immediately if the external process is exited.
+
 2005-07-26  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're
index f7e3420e92203185f56f7b6c82de8c996c26e349..9051554fdc725d6ad2a3f8a8593ecb61222a3ed8 100644 (file)
@@ -5197,17 +5197,23 @@ specifies."
                         1 0)))))))
 
 (defun gnus-article-next-page-1 (lines)
-  (unless (and (not (featurep 'xemacs))
-              (> (symbol-value 'scroll-margin) 0)
-              (<= (count-lines (window-start) (point-max))
-                  (symbol-value 'scroll-margin)))
-    (condition-case ()
-       (let ((scroll-in-place nil))
-         (scroll-up lines))
-      (end-of-buffer
-       ;; Long lines may cause an end-of-buffer error.
-       (goto-char (point-max))))
-    (gnus-article-beginning-of-window)))
+  (when (and (not (featurep 'xemacs))
+            (numberp lines)
+            (> lines 0)
+            (numberp (symbol-value 'scroll-margin))
+            (> (symbol-value 'scroll-margin) 0))
+    ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for
+    ;; too many number of lines if `scroll-margin' is set as two or greater.
+    (setq lines (min lines
+                    (max 0 (- (count-lines (window-start) (point-max))
+                              (symbol-value 'scroll-margin))))))
+  (condition-case ()
+      (let ((scroll-in-place nil))
+       (scroll-up lines))
+    (end-of-buffer
+     ;; Long lines may cause an end-of-buffer error.
+     (goto-char (point-max))))
+  (gnus-article-beginning-of-window))
 
 (defun gnus-article-prev-page (&optional lines)
   "Show previous page of current article.
index 601843dcf554b28ae8b606d336c83856ca232f97..c65d5f80ba46f9f03d39d46dd5580f434121a4c1 100644 (file)
@@ -817,11 +817,32 @@ external if displayed external."
            (let ((command (mm-mailcap-command
                            method file (mm-handle-type handle))))
              (unwind-protect
-                 (start-process "*display*"
-                                (setq buffer
-                                      (generate-new-buffer " *mm*"))
-                                shell-file-name
-                                shell-command-switch command)
+                 (progn
+                   (start-process "*display*"
+                                  (setq buffer
+                                        (generate-new-buffer " *mm*"))
+                                  shell-file-name
+                                  shell-command-switch command)
+                   (set-process-sentinel
+                    (get-buffer-process buffer)
+                    `(lambda (process state)
+                       (when (eq 'exit (process-status process))
+                         ;; Don't use `ignore-errors'.
+                         (condition-case nil
+                             (delete-file ,file)
+                           (error))
+                         (condition-case nil
+                             (delete-directory ,(file-name-directory file))
+                           (error))
+                         (condition-case nil
+                             (kill-buffer ,buffer)
+                           (error))
+                         (condition-case nil
+                             ,(macroexpand (list 'mm-handle-set-undisplayer
+                                                 (list 'quote handle)
+                                                 nil))
+                           (error))
+                         (message "Displaying %s...done" ,command)))))
                (mm-handle-set-external-undisplayer
                 handle (cons file buffer)))
              (message "Displaying %s..." command))
index 4c98b6eb687b030a1ef4965778ca20e087275418..57e2b54e73302981b6fc5f01a591e54151d6d6a5 100644 (file)
@@ -123,7 +123,13 @@ unknown encoding; `use-ascii': always use ASCII for those characters
 with unknown encoding; `multipart': always send messages with more than
 one charsets.")
 
-(defvar mml-generate-default-type "text/plain")
+(defvar mml-generate-default-type "text/plain"
+  "Content type by which the Content-Type header can be omitted.
+The Content-Type header will not be put in the MIME part if the type
+equals the value and there's no parameter (e.g. charset, format, etc.)
+and `mml-insert-mime-headers-always' is nil.  The value will be bound
+to \"message/rfc822\" when encoding an article to be forwarded as a MIME
+part.  This is for the internal use, you should never modify the value.")
 
 (defvar mml-buffer-list nil)
 
@@ -400,9 +406,12 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
       (mml-tweak-part cont)
       (cond
        ((or (eq (car cont) 'part) (eq (car cont) 'mml))
-       (let ((raw (cdr (assq 'raw cont)))
-             coded encoding charset filename type flowed)
-         (setq type (or (cdr (assq 'type cont)) "text/plain"))
+       (let* ((raw (cdr (assq 'raw cont)))
+              (filename (cdr (assq 'filename cont)))
+              (type (or (cdr (assq 'type cont))
+                        (and filename (mm-default-file-encoding filename))
+                        "application/octet-stream"))
+              coded encoding charset flowed)
          (if (and (not raw)
                   (member (car (split-string type "/")) '("text" "message")))
              (progn
@@ -414,7 +423,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
                  (cond
                   ((cdr (assq 'buffer cont))
                    (insert-buffer-substring (cdr (assq 'buffer cont))))
-                  ((and (setq filename (cdr (assq 'filename cont)))
+                  ((and filename
                         (not (equal (cdr (assq 'nofile cont)) "yes")))
                    (let ((coding-system-for-read charset))
                      (mm-insert-file-contents filename)))
@@ -434,6 +443,10 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
                  (cond
                   ((eq (car cont) 'mml)
                    (let ((mml-boundary (mml-compute-boundary cont))
+                         ;; It is necessary for the case where this
+                         ;; function is called recursively since
+                         ;; `m-g-d-t' will be bound to "message/rfc822"
+                         ;; when encoding an article to be forwarded.
                          (mml-generate-default-type "text/plain"))
                      (mml-to-mime))
                    (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
@@ -475,7 +488,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
                (insert (with-current-buffer (cdr (assq 'buffer cont))
                          (mm-with-unibyte-current-buffer
                            (buffer-string)))))
-              ((and (setq filename (cdr (assq 'filename cont)))
+              ((and filename
                     (not (equal (cdr (assq 'nofile cont)) "yes")))
                (let ((coding-system-for-read mm-binary-coding-system))
                  (mm-insert-file-contents filename nil nil nil nil t)))
@@ -516,15 +529,19 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
             "access-type=url"))
          (when parameters
            (mml-insert-parameter-string
-            cont '(expiration size permission))))
-       (insert "\n\n")
-       (insert "Content-Type: " (cdr (assq 'type cont)) "\n")
-       (insert "Content-ID: " (message-make-message-id) "\n")
-       (insert "Content-Transfer-Encoding: "
-               (or (cdr (assq 'encoding cont)) "binary"))
-       (insert "\n\n")
-       (insert (or (cdr (assq 'contents cont))))
-       (insert "\n"))
+            cont '(expiration size permission)))
+         (insert "\n\n")
+         (insert "Content-Type: "
+                 (or (cdr (assq 'type cont))
+                     (and name (mm-default-file-encoding name))
+                     "application/octet-stream")
+                 "\n")
+         (insert "Content-ID: " (message-make-message-id) "\n")
+         (insert "Content-Transfer-Encoding: "
+                 (or (cdr (assq 'encoding cont)) "binary"))
+         (insert "\n\n")
+         (insert (or (cdr (assq 'contents cont))))
+         (insert "\n")))
        ((eq (car cont) 'multipart)
        (let* ((type (or (cdr (assq 'type cont)) "mixed"))
               (mml-generate-default-type (if (equal type "digest")
@@ -560,7 +577,8 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
            (message-options-set 'message-sender sender))
          (if (setq recipients (cdr (assq 'recipients cont)))
              (message-options-set 'message-recipients recipients))
-         (let ((style (mml-signencrypt-style (first (or sign-item encrypt-item)))))
+         (let ((style (mml-signencrypt-style
+                       (first (or sign-item encrypt-item)))))
            ;; check if: we're both signing & encrypting, both methods
            ;; are the same (why would they be different?!), and that
            ;; the signencrypt style allows for combined operation.