summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorLars Hansen <larsh@soem.dk>2004-04-21 20:49:37 +0000
committerLars Hansen <larsh@soem.dk>2004-04-21 20:49:37 +0000
commit431f70e0790f95ef08e018d60bfd6a8cbb691df3 (patch)
treeee7f1b2ec9b272a4c3e2d321d6d6127265d3fa1a /lisp/mail
parentc4e2f5679fac46fddfb44535478e32ae07743b2e (diff)
downloademacs-431f70e0790f95ef08e018d60bfd6a8cbb691df3.tar.gz
(rmail-restore-desktop-buffer): Move from desktop.el. Add Parameters.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/rmail.el33
1 files changed, 24 insertions, 9 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 0dfa43d0cc8..a8a78abf01b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1666,15 +1666,7 @@ It returns t if it got any new messages."
(defun rmail-decode-region (from to coding)
(if (or (not coding) (not (coding-system-p coding)))
(setq coding 'undecided))
- ;; Use -dos decoding, to remove ^M characters left from base64 or
- ;; rogue qp-encoded text.
- (decode-coding-region from to
- (coding-system-change-eol-conversion coding 1))
- ;; Don't reveal the fact we used -dos decoding, as users generally
- ;; will not expect the RMAIL buffer to use DOS EOL format.
- (setq buffer-file-coding-system
- (setq last-coding-system-used
- (coding-system-change-eol-conversion coding 0))))
+ (decode-coding-region from to coding))
;; the rmail-break-forwarded-messages feature is not implemented
(defun rmail-convert-to-babyl-format ()
@@ -1759,6 +1751,9 @@ It returns t if it got any new messages."
(error nil))
;; Change "base64" to "8bit", to reflect the
;; decoding we just did.
+ (goto-char (1+ header-end))
+ (while (search-forward "\r\n" (point-max) t)
+ (replace-match "\n"))
(goto-char base64-header-field-end)
(delete-region (point) (search-backward ":"))
(insert ": 8bit"))))
@@ -1906,6 +1901,9 @@ It returns t if it got any new messages."
(point)))
t)
(error nil))
+ (goto-char header-end)
+ (while (search-forward "\r\n" (point-max) t)
+ (replace-match "\n"))
;; Change "base64" to "8bit", to reflect the
;; decoding we just did.
(goto-char base64-header-field-end)
@@ -3869,6 +3867,23 @@ encoded string (and the same mask) will decode the string."
(setq i (1+ i)))
(concat string-vector)))
+;;;; Desktop support
+
+;;;###autoload
+(defun rmail-restore-desktop-buffer (desktop-buffer-file-name
+ desktop-buffer-name
+ desktop-buffer-misc)
+ "Restore an rmail buffer specified in a desktop file."
+ (condition-case error
+ (progn
+ (rmail-input desktop-buffer-file-name)
+ (if (eq major-mode 'rmail-mode)
+ (current-buffer)
+ rmail-buffer))
+ (file-locked
+ (kill-buffer (current-buffer))
+ nil)))
+
(provide 'rmail)
;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c