From 04717999d979335e5dfd66ade42d283131ec5eba Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 20 Jan 2011 23:39:24 +0000 Subject: [PATCH] mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill the temp buffer. message.el (message-mailer-swallows-blank-line): Use with-temp-buffer. --- lisp/ChangeLog | 6 ++++++ lisp/message.el | 13 +++++-------- lisp/mm-util.el | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c34c4ea57..2ff2d9a85 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-01-20 Stefan Monnier + + * mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill + the temp buffer. + * message.el (message-mailer-swallows-blank-line): Use with-temp-buffer. + 2011-01-20 Julien Danjou * mm-decode.el (mm-inline-media-tests): Add text/x-sh. diff --git a/lisp/message.el b/lisp/message.el index f514fd795..7f83f0ae3 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1228,14 +1228,11 @@ called and its result is inserted." (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)" system-configuration) (file-readable-p "/etc/sendmail.cf") - (let ((buffer (get-buffer-create " *temp*"))) - (unwind-protect - (with-current-buffer buffer - (insert-file-contents "/etc/sendmail.cf") - (goto-char (point-min)) - (let ((case-fold-search nil)) - (re-search-forward "^OR\\>" nil t))) - (kill-buffer buffer)))) + (with-temp-buffer + (insert-file-contents "/etc/sendmail.cf") + (goto-char (point-min)) + (let ((case-fold-search nil)) + (re-search-forward "^OR\\>" nil t)))) ;; According to RFC822, "The field-name must be composed of printable ;; ASCII characters (i. e., characters that have decimal values between ;; 33 and 126, except colon)", i. e., any chars except ctl chars, diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 99766e644..4012a7f5c 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -1604,7 +1604,7 @@ gzip, bzip2, etc. are allowed." (insert decomp) (setq filename (file-name-sans-extension filename))) (goto-char (point-min)) - (prog1 + (unwind-protect (cond ((boundp 'set-auto-coding-function) ;; Emacs (if filename -- 2.25.1