unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 4623@emacsbugs.donarmstrong.com
Subject: bug#4623: 23.1.50; rmail changes encoding of characters on save
Date: Sun, 06 Dec 2009 23:34:55 -0500	[thread overview]
Message-ID: <jwv1vj7jtuc.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <83hbs5k4q6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Dec 2009 14:03:29 +0200")

> 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





  parent reply	other threads:[~2009-12-07  4:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 16:36 bug#4623: 23.1.50; rmail changes encoding of characters on save Eli Zaretskii
2009-12-04 17:16 ` Glenn Morris
2009-12-04 18:42 ` Stefan Monnier
2009-12-04 19:15   ` Eli Zaretskii
2009-12-04 19:48     ` Stefan Monnier
2009-12-05 12:03       ` Eli Zaretskii
2009-12-05 20:10         ` Markus Rost
2009-12-05 21:52           ` Eli Zaretskii
2009-12-05 22:37             ` Markus Rost
2009-12-06  4:10               ` Eli Zaretskii
2009-12-06 14:40                 ` Markus Rost
2009-12-06 19:17             ` Eli Zaretskii
2009-12-06 20:23               ` Markus Rost
2009-12-07  4:04                 ` Eli Zaretskii
2009-12-07 19:22                   ` Eli Zaretskii
2009-12-07 19:50                     ` Markus Rost
2009-12-07 19:51                       ` Eli Zaretskii
2009-12-07  4:34         ` Stefan Monnier [this message]
2009-12-07 18:59           ` Eli Zaretskii
2009-12-07 19:25             ` Stefan Monnier
2009-12-07 19:53               ` Eli Zaretskii
2009-12-07 21:44                 ` Stefan Monnier
2009-12-08  4:14                   ` Eli Zaretskii
2009-12-08 13:47                     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-10-03 14:54 Markus Rost
2009-10-13  1:21 ` Glenn Morris
2009-10-13  2:16   ` Markus Rost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv1vj7jtuc.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=4623@emacsbugs.donarmstrong.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).