From: Richard M. Stallman Date: Mon, 17 Sep 2012 11:49:10 +0000 (-0400) Subject: When toggling mime processing off, just don't do mime processing. X-Git-Tag: emacs-24.2.90~269^2~52 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0dee970c8850ab1c6334500011e36d530fc636c9;p=emacs.git When toggling mime processing off, just don't do mime processing. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6232886b88b..e89320a3c9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-09-17 Richard Stallman + * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert + only in the mime-shown mode, not in raw mode. + (rmail-mime): Toggle off mime by displaying the message without + mime processing. + * mail/rmail.el (rmail-retry-failure): Turn off mime processing first. * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 67b2e62275f..2cc57963ef7 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -389,13 +389,13 @@ Use `raw' for raw mode, and any other non-nil value for decoded mode." ;; Enter the raw mode. (rmail-mime-raw-mode entity) ;; Enter the shown mode. - (rmail-mime-shown-mode entity)) - (let ((inhibit-read-only t) - (modified (buffer-modified-p))) - (save-excursion - (goto-char (aref segment 1)) - (rmail-mime-insert entity) - (restore-buffer-modified-p modified))))) + (rmail-mime-shown-mode entity) + (let ((inhibit-read-only t) + (modified (buffer-modified-p))) + (save-excursion + (goto-char (aref segment 1)) + (rmail-mime-insert entity) + (restore-buffer-modified-p modified)))))) (defun rmail-mime-toggle-hidden () "Hide or show the body of the MIME-entity at point." @@ -1212,7 +1212,7 @@ available." (if (rmail-mime-display-header current) (delete-char (- (aref segment 2) (aref segment 1)))) (insert-buffer-substring rmail-mime-mbox-buffer - (aref header 0) (aref header 1))) + (aref header 0) (aref header 1))) ;; tagline (if (rmail-mime-display-tagline current) (delete-char (- (aref segment 3) (aref segment 2)))) @@ -1261,14 +1261,17 @@ The arguments ARG and STATE have no effect in this case." (interactive (list current-prefix-arg nil)) (if rmail-enable-mime (with-current-buffer rmail-buffer - (if (rmail-mime-message-p) - (let ((rmail-mime-mbox-buffer rmail-view-buffer) - (rmail-mime-view-buffer rmail-buffer) - (entity (get-text-property - (progn - (or arg (goto-char (point-min))) - (point)) 'rmail-mime-entity))) - (if (or (not arg) entity) (rmail-mime-toggle-raw state))) + (if (or (rmail-mime-message-p) + (get-text-property (point-min) 'rmail-mime-hidden)) + (let* ((hidden (get-text-property (point-min) 'rmail-mime-hidden)) + (desired-hidden (if state (eq state 'raw) (not hidden)))) + (unless (eq hidden desired-hidden) + (if (not desired-hidden) + (rmail-show-message rmail-current-message) + (let ((rmail-enable-mime nil) + (inhibit-read-only t)) + (rmail-show-message rmail-current-message) + (add-text-properties (point-min) (point-max) '(rmail-mime-hidden t)))))) (message "Not a MIME message, just toggling headers") (rmail-toggle-header))) (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string))