From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: Different (buffer-file-)coding-systems for different regions of one buffer? (for Rmail MIME) Date: Thu, 22 May 2003 15:16:56 +0200 Organization: University of Duisburg, Germany Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84addf15pz.fsf@lucy.is.informatik.uni-duisburg.de> References: <200305211953.h4LJr9Iq000699@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053611039 23094 80.91.224.249 (22 May 2003 13:43:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 22 May 2003 13:43:59 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 22 15:43:58 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19IqKW-0005nK-00 for ; Thu, 22 May 2003 15:42:00 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19IqVn-0004kk-00 for ; Thu, 22 May 2003 15:53:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IqJd-0004xW-Mg for emacs-devel@quimby.gnus.org; Thu, 22 May 2003 09:41:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IqGy-0003VX-Ro for emacs-devel@gnu.org; Thu, 22 May 2003 09:38:20 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Ipz6-0005KC-Lt for emacs-devel@gnu.org; Thu, 22 May 2003 09:20:23 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Ipz6-0005J0-Ak for emacs-devel@gnu.org; Thu, 22 May 2003 09:19:52 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19Ipw1-0003kM-00 for ; Thu, 22 May 2003 15:16:41 +0200 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19Ipul-0003dC-00 for ; Thu, 22 May 2003 15:15:23 +0200 Original-Lines: 32 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:boFg1es4i9fRkvqTaO0Jekw4kOQ= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14090 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14090 "Stefan Monnier" writes: >> 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. Actually, an mbox-coding-system sounds rather attractive to me. I think there are existing encodings that use escape sequences so that an application reads ascii, then comes an escape sequence that says "Japanese from here on", then comes another escape sequence that says "ascii again". Is this true? Emacs-mule uses a similar mechanism, except that the escape sequences are always applied to one character only. So \201 means to read one character in Latin-1, and so on. And, conceptually, the charset specs in Content-Type headers are just such escape sequences. I guess it would be difficult to implement the encoding, but it would be just what RMAIL needs. You can then just find the file and then narrow to certain regions. I understand that Richard likes this way of working with mailboxes. (Reading the file into the buffer is comparatively easy, but I'm not sure how to make sure that read-then-write doesn't change the file.) -- This line is not blank.