unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Different (buffer-file-)coding-systems for different regions of one buffer? (for Rmail MIME)
Date: Wed, 21 May 2003 15:53:09 -0400	[thread overview]
Message-ID: <200305211953.h4LJr9Iq000699@rum.cs.yale.edu> (raw)
In-Reply-To: i563cj8kz7e.fsf@mao.acc.umu.se

> Would it be possible to have different coding-systems (the decoding of
> octets from a file into characters in a buffer) for different ranges
> of octets in a file?

Of course, it's possible: coding systems are operations, not data.
Emacs offers straightforward ways to apply those operations to whole
files when reading and saving them, as well as straightforward
ways to apply those operations to parts of a buffer.

> For example: in a file of 2000 octets, octet 1-1000 would be decoded
> using ISO-8859-1, octet 1001-1500 with UTF-8, 1501-2000 with
> (currently non-existent?)  Quoted-Printable and so on.  This would in
> my opinion allow a pretty way of handling MIME messages.

quoted-printable is not a coding-system.  As for the rest, I don't
see what's preventing you from doing it.  After all Gnus does is.
I.e. load the raw undecoded file, parse its content to figure out
where parts begin and end and what coding-system to use for them
(and maybe also un-base64 or un-qp them) and then apply
decode-coding-region.
Upon saving, just do the opposite.

> Though I can't come up with any other uses except for the proposed
> Rmail usage for different coding-systems for different regions, I
> don't see how it is nonsense.  It is like opening a file constructed
> by concatenating several files with different character encodings (and
> knowledge of what part of the file uses what encoding qould be
> extracted from the MIME data).  Do you see what I'm trying to
> accomplish?

I still don't understand what you want that's not already present.

> Unless I have overlooked something, I *do* think it would be possible
> to handle MIME messages nicely without replacing the encoded data, if
> the facilities for decoding different parts of a file (which is done
> with a coding-system, right?) with different character encodings
> exist.

I don't understand what you mean by "replacing".


	Stefan

  parent reply	other threads:[~2003-05-21 19:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <i56wugl13qq.fsf@mao.acc.umu.se>
2003-05-21  2:43 ` Different (buffer-file-)coding-systems for different regions of one buffer? (for Rmail MIME) Kenichi Handa
2003-05-22  8:33   ` Richard Stallman
     [not found] ` <i563cj8kz7e.fsf@mao.acc.umu.se>
2003-05-21 19:53   ` Stefan Monnier [this message]
     [not found]     ` <i56smr8j8lk.fsf@mao.acc.umu.se>
2003-05-21 22:29       ` Stefan Monnier
     [not found]         ` <i56u1bnn567.fsf@mao.acc.umu.se>
2003-05-22  3:41           ` Stephen J. Turnbull
     [not found]             ` <i56ptmateuj.fsf@mao.acc.umu.se>
2003-05-23 10:56               ` Stephen J. Turnbull
2003-05-23 12:03             ` Richard Stallman
2003-05-23 15:03               ` Stephen J. Turnbull
2003-05-24 23:19                 ` Richard Stallman
2003-05-25 18:28                   ` Kai Großjohann
2003-05-27 12:44                     ` Richard Stallman
2003-05-26  5:20                   ` Stephen J. Turnbull
2003-05-26 17:30                     ` Eli Zaretskii
2003-05-27 10:03                       ` Stephen J. Turnbull
2003-05-27 12:44                     ` Richard Stallman
2003-05-27 15:12                       ` Stephen J. Turnbull
2003-05-28 23:57                         ` Richard Stallman
2003-05-29  8:20                           ` Stephen J. Turnbull
2003-05-22  1:32       ` Kenichi Handa
2003-05-22 13:16     ` Kai Großjohann

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=200305211953.h4LJr9Iq000699@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --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 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).