From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68665 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: Sending attachments Date: Tue, 07 Jul 2009 09:59:56 +0900 Message-ID: References: <87k52rzyn1.fsf@benthic.rattlesnake.com> <873a9fw6dt.fsf@catnip.gol.com> <87y6r7yp1y.fsf@stupidchicken.com> <0922916E-B9DD-41C4-8A3D-8550CDD56B62@mit.edu> <83r5ww1m3k.fsf@gnu.org> <871vovsvi8.fsf@catnip.gol.com> <83ljn324xd.fsf@gnu.org> <87skhbrdz3.fsf@catnip.gol.com> <83hbxr0zc6.fsf@gnu.org> <87hbxqrha4.fsf@catnip.gol.com> <83d48e1oz6.fsf@gnu.org> <837hyl1spu.fsf@gnu.org> <87y6r1san7.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246928466 12635 80.91.229.12 (7 Jul 2009 01:01:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jul 2009 01:01:06 +0000 (UTC) Cc: eliz@gnu.org, ding@gnus.org, emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 07 03:00:59 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MNz3K-0004OX-5u for ged-emacs-devel@m.gmane.org; Tue, 07 Jul 2009 03:00:59 +0200 Original-Received: from localhost ([127.0.0.1]:55092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNz3J-0004mO-HV for ged-emacs-devel@m.gmane.org; Mon, 06 Jul 2009 21:00:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MNz2Z-0004Y1-RC for emacs-devel@gnu.org; Mon, 06 Jul 2009 21:00:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MNz2V-0004UW-5a for emacs-devel@gnu.org; Mon, 06 Jul 2009 21:00:11 -0400 Original-Received: from [199.232.76.173] (port=39093 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNz2V-0004UQ-03 for emacs-devel@gnu.org; Mon, 06 Jul 2009 21:00:07 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:51233) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MNz2P-0001Xj-IM; Mon, 06 Jul 2009 21:00:02 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n670xv7I018041; Tue, 7 Jul 2009 09:59:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n670xvOK003693; Tue, 7 Jul 2009 09:59:57 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id n670xuYV026205; Tue, 7 Jul 2009 09:59:56 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MNz2K-0006Fo-Rj; Tue, 07 Jul 2009 09:59:56 +0900 In-Reply-To: <87y6r1san7.fsf@catnip.gol.com> (message from Miles Bader on Tue, 07 Jul 2009 07:35:08 +0900) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:112115 gmane.emacs.gnus.general:68665 Archived-At: In article <87y6r1san7.fsf@catnip.gol.com>, Miles Bader writes: > Eli Zaretskii writes: >>> In the case non-ASCII character case mentioned above, he may not even >>> _know_ that he needs to do anything or look at any documentation -- >>> he'll just send incorrect mail. > > > > Did you actually try that? Mail mode will not let you send such > > messages, it will prompt for a proper encoding. > You may be thinking of a different case. > I did test sending a message with non-ASCII text in the header, which > mail-mode sent incorrectly, without any prompting or warning (you can't > just encode header text using the body's encoding, you need to use the > special "?=" encoding stuff). I've been believed that mail-mode (and the new rmail code) supports non-ASCII Subject: correctly, but it was not. I've just noticed that I'm using these setups in my .emacs. The similar codes should be installed (of course, not as hooks). (require 'rfc2047) (defun rmail-decode-header () (save-excursion (goto-char (point-min)) (search-forward "\n\n") (if (re-search-backward "^subject:" nil t) (let ((buffer-read-only nil) (pos (match-end 0))) (forward-line 1) (while (looking-at "[ \t]") (forward-line 1)) (rfc2047-decode-region pos (1- (point))))))) (add-hook 'rmail-show-message-hook 'rmail-decode-header) (require 'rmailsum) (defun mail-decode-summary-line (line) (rfc2047-decode-string line)) (setq rmail-summary-line-decoder 'mail-decode-summary-line) (require 'sendmail) (defun mail-encode-header () (save-excursion (goto-char (point-min)) (search-forward mail-header-separator nil 'move) (let ((case-fold-search t) pos) (when (re-search-backward "^subject:" nil t) (setq pos (point)) (forward-line 1) (while (looking-at "[ \t][^ \t\n]") (forward-line 1)) (rfc2047-encode-region pos (1- (point))))))) (add-hook 'mail-send-hook 'mail-encode-header) (defun mail-decode-header () (save-excursion (mail-position-on-field "Subject" t) (if (not (bobp)) (let ((pos (point))) (beginning-of-line) (while (looking-at "[ \t]") (forward-line -1)) (rfc2047-decode-region (point) pos))))) (add-hook 'mail-setup-hook 'mail-decode-header) --- Kenichi Handa handa@m17n.org