all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: What does `undecided' do for encoding text?
Date: Tue, 10 Feb 2009 20:16:53 +0900	[thread overview]
Message-ID: <E1LWqbl-0006Ox-Rx@etlken> (raw)
In-Reply-To: <u63jisl2w.fsf@gnu.org> (message from Eli Zaretskii on Tue, 10 Feb 2009 11:22:15 +0200)

In article <u63jisl2w.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> > I don't think so because it is just a fallback behavior, and
> > Elisp programmer should avoid specifying `undecided' on
> > encoding.

> This may have nothing to do with what the programmer did.  My use case
> was in Rmail: if the original message had non-ASCII text encoded with
> QP or B64, Rmail would (correctly) return `undecided' when it detects
> the message encoding.  Suppose you then edit the message and add
> non-ASCII characters as raw bytes, e.g. by base64-decode-region, and
> type "C-c C-c".  rmail-cease-edit now needs to encode the text and put
> it back into the mbox buffer, and the immediate choice it has for the
> pertinent coding-system is to use buffer-file-coding-system of the
> buffer where the message was edited.  But the value of
> buffer-file-coding-system in that buffer is `undecided'...

The situation is the same as visiting an ASCII only file,
entering some non-ASCII characters, and saving it.  In that
case, we use selecte-safe-coding-system to decide the coding
system to encode the buffer contents.  As I wrote before,
rmail-cease-edit should do the same or the similar thing.

> If you say that using `undecided' in encoding is ``considered
> harmful'', we should at least say that in the ELisp manual.  Although
> in the use case I described `undecided' did exactly what's right, and
> the only other correct choice is `raw-text'.

For a buffer that contains raw bytes, `raw-text' is the only
correct choice.

---
Kenichi Handa
handa@m17n.org




  reply	other threads:[~2009-02-10 11:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 15:32 What does `undecided' do for encoding text? Eli Zaretskii
2009-02-10  7:01 ` Kenichi Handa
2009-02-10  9:22   ` Eli Zaretskii
2009-02-10 11:16     ` Kenichi Handa [this message]
2009-02-10 11:47       ` Eli Zaretskii
2009-02-11  9:20         ` Kenichi Handa
2009-02-10 22:04   ` Stefan Monnier
2009-02-16 11:44     ` Kenichi Handa
2009-02-16 13:47       ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=E1LWqbl-0006Ox-Rx@etlken \
    --to=handa@m17n.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 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.