all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#4623: 23.1.50; rmail changes encoding of characters on save
@ 2009-12-04 16:36 Eli Zaretskii
  2009-12-04 17:16 ` Glenn Morris
  2009-12-04 18:42 ` Stefan Monnier
  0 siblings, 2 replies; 28+ messages in thread
From: Eli Zaretskii @ 2009-12-04 16:36 UTC (permalink / raw)
  To: 4623

The cure for this bug, viz.

  *** rmail.el   6 Oct 2009 06:40:40 -0000  1.554
  --- rmail.el   13 Oct 2009 01:17:20 -0000
  ***************
  *** 4176,4181 ****
  --- 4176,4182 ----
    (defun rmail-write-region-annotate (start end)
      (when (and (null start) (rmail-buffers-swapped-p))
        (set-buffer rmail-view-buffer)
  +     (set (make-local-variable 'coding-system-for-write) 'no-conversion)
        (widen)
        nil))

is IMO not much better than the disease: now C-x C-s _always_ leaves
the RMAIL buffer in no-conversion state, until you display a message,
e.g., with "M-n".

I think this happens because the above sets the encoding of
rmail-view-buffer, where we display the messages, to no-conversion.

I'm not sure how to solve this.  What is needed is bind
coding-system-for-write to no-conversion just for the duration of
save-buffer or write-region that it calls eventually.  But because we
use annotations to switch the buffer behind save-buffer's back,
there's no easy way of doing that.

Perhaps we should special-case RMAIL in save-buffer, or maybe do
something in buffer-swap-text.

Any ideas are welcome.  If no better idea pops up very soon, I suggest
the following band-aid for Emacs 23.2:

  . don't set coding-system-for-write in rmail-write-region-annotate

  . bind C-x C-s in Rmail mode to a special command, like rmail-save,
    which will bind coding-system-for-write to no-conversion

  . wrap all instances of save-buffer in Rmail with a form that
    let-binds coding-system-for-write to no-conversion

This will at least plumb the problem in 99% of use cases, I think.





^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2009-12-08 13:47 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <22r5t2emso.fsf@fencepost.gnu.org>
2009-10-03 14:54 ` bug#4623: 23.1.50; rmail changes encoding of characters on save Markus Rost
2009-10-13  1:21   ` Glenn Morris
2009-10-13  2:16     ` Markus Rost
2009-10-17  3:20   ` bug#4623: marked as done (23.1.50; rmail changes encoding of characters on save) Emacs bug Tracking System
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.