From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4623: 23.1.50; rmail changes encoding of characters on save Date: Sun, 06 Dec 2009 23:34:55 -0500 Message-ID: References: <831vjalmrl.fsf@gnu.org> <83y6lik0ug.fsf@gnu.org> <83hbs5k4q6.fsf@gnu.org> Reply-To: Stefan Monnier , 4623@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260161269 5614 80.91.229.12 (7 Dec 2009 04:47:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 04:47:49 +0000 (UTC) Cc: 4623@emacsbugs.donarmstrong.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 05:47:42 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHVVd-0002iL-BI for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 05:47:41 +0100 Original-Received: from localhost ([127.0.0.1]:47041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHVVc-0002IZ-69 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2009 23:47:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHVVW-0002F4-M6 for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 23:47:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHVVS-0002Al-7r for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 23:47:34 -0500 Original-Received: from [199.232.76.173] (port=45552 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHVVR-0002AJ-Gr for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 23:47:29 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:53287) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHVVR-0003Tm-2t for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 23:47:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB74lPVn006313; Sun, 6 Dec 2009 20:47:26 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB74eHoZ005623; Sun, 6 Dec 2009 20:40:17 -0800 Resent-Date: Sun, 6 Dec 2009 20:40:17 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 07 Dec 2009 04:40:16 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4623 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4623-submit@emacsbugs.donarmstrong.com id=B4623.12601605055057 (code B ref 4623); Mon, 07 Dec 2009 04:40:16 +0000 Original-Received: (at 4623) by emacsbugs.donarmstrong.com; 7 Dec 2009 04:35:05 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB74Z1ac005018 for <4623@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 20:35:03 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEAIcUHEtMCrV1/2dsb2JhbACBTNRhg0ppBIoe X-IronPort-AV: E=Sophos;i="4.47,352,1257138000"; d="scan'208";a="50818505" Original-Received: from 76-10-181-117.dsl.teksavvy.com (HELO pastel.home) ([76.10.181.117]) by ironport2-out.pppoe.ca with ESMTP; 06 Dec 2009 23:34:55 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 0C5A180B4; Sun, 6 Dec 2009 23:34:55 -0500 (EST) In-Reply-To: <83hbs5k4q6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Dec 2009 14:03:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sun, 06 Dec 2009 23:47:34 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33346 Archived-At: > Several reasons off the top of my head: > . It gives you an easily visible indication of how the message was > encoded. (We hide the relevant mail headers by default, so they > are not visible unless you invoke rmail-toggle-header.) So it's abusing buffer-file-coding-system for "message-coding-system" (which of course is only meaningful is the message is not made up of various parts using different coding-systems). > . It is useful when saving the current message to a file. Good point. > . When replying to a message, rmail-reply uses it to set the > encoding of the *mail* buffer where you compose the reply, which > takes care of 99.99% of situations where the response needs to > have some non-trivial encoding that is not your system's native > one. rmail-replay doesn't need to use buffer-file-coding-system for that, but could just as well use some other variable for it, right? > The last one of these is by far the most important reason, at least in > my use pattern. Then it's easy to fix. > Maybe we need to set up an after-save-hook to restore the original > encoding after saving the message collection? That would be fine, yes. I'd suggest to use an rmail-coding-system variable as the canonical place to store the coding system used for the currently shown message, use it in rmail-reply in preference to buffer-file-coding-system, and simply copy rmail-coding-system to buffer-file-coding-system whenever necessary, such as in after-save-hook. > Btw, I find rmail-swap-buffers incomplete in its handling of encoding > and the modified flag. It looks like it works by sheer luck, unless > I'm missing something. Could be. I really think the first thing that needs to be done is to get rid of Rmail's constant swapping of those buffers. There should be one swap when entering rmail-mode and one more when(if) leaving it, no more. That will get us rid of most of that insanity. Stefan