From: Miles Bader Date: Sun, 31 Jul 2005 00:12:23 +0000 (+0000) Subject: Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505 X-Git-Tag: emacs-pretest-22.0.90~7828 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b91459a2990a86fb557ddf8119e740233368dd1;p=emacs.git Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 99) - Update from CVS 2005-07-29 Katsumi Yamaoka * 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 * 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 * lisp/gnus/mm-decode.el (mm-display-external): Delete temp file, directory and buffer immediately if the external process is exited. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7bc733ad90f..6b25403e47b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,8 +1,30 @@ +2005-07-29 Katsumi Yamaoka + + * 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 + + * 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 * 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 + + * mm-decode.el (mm-display-external): Delete temp file, directory + and buffer immediately if the external process is exited. + 2005-07-26 Katsumi Yamaoka * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index f7e3420e922..9051554fdc7 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -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. diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 601843dcf55..c65d5f80ba4 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -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)) diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 4c98b6eb687..57e2b54e733 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -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.