From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: emacs-devel@gnu.org
Subject: Re: Different (buffer-file-)coding-systems for different regions of one buffer? (for Rmail MIME)
Date: Sat, 24 May 2003 00:03:35 +0900 [thread overview]
Message-ID: <87wughogc8.fsf@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <E19JBH6-0006HV-2D@fencepost.gnu.org> (Richard Stallman's message of "Fri, 23 May 2003 08:03:52 -0400")
>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:
rms> It pretty much has to be an Emacs buffer, or part of one.
rms> There is no other natural or easy way to implement it in the
rms> context of Emacs. The question would be, is it a separate
rms> buffer, or a part of another buffer, or what?
If you want to preserve the original contents of the buffer, you must
copy them somewhere, because many of the transformations performed to
make text displayable are not invertible. For example, it is
perfectly legal in ISO 2022 coding systems to have two charset
designations with no intervening text. The first one will get lost.
Messages from older MUAs may contain the so-called abbreviated escape
sequences for Japanese and Chinese; a modern one would write them out
in the longer form. It is almost always possible to unify ISO 8859/1
and ISO 8859/15 to ISO 8859/15, yet with cut and paste under current
situation, Emacs will produce a buffer with multiple charsets.
However, Emacs may or may not attempt to unify those charsets on
write, depending, I believe, on user options.
Quoted-printable, division of MIME encoded-words, and so on all
present similar issues.
Of course all of these could be handled by setting a text property
saying "in the original this was ISO 8859/1 but it has been unified to
ISO 8859/2" or putting an invisible property on a redundant escape
sequence and leaving it in the buffer, but that's ugly and
fault-prone.
rms> In Rmail currently it is possible to type e and edit a
rms> message. Right now we do this through editing the buffer of
rms> the RMAIL file. With better MIME support, this may have to
rms> be implemented differently, but I hope we can keep it working
rms> somehow.
I think this will require a lot of work if you wish to preserve file
text verbatim unless explicitly edited (and this is essential for
signed messages, for example).
rms> If we copy the message into another buffer for viewing, that
rms> tends to lead to complications of the situation, because
rms> there are multiple buffers instead of just one. We could try
rms> adding features to hide that, or we could expose it and not
rms> hide anything.
I don't see how it gets complicated. You put a couple of markers in
the original buffer, copy the region to the presentation buffer, and
transform it. If you don't edit it, (erase-buffer) and go on to the
next message. If you want to edit, you edit the presentation buffer,
in exactly the same way that currently you would edit the Rmail
buffer. Once you've changed the presentation buffer, I see no reason
not to unify charsets, remove redundant escape sequences, and so on.
Once you're done, you simply replace the marked region in the original
buffer. Reversion is simple: you refresh from the original buffer, no
messing with undo etc. In this model, the only operations you perform
on the original buffer are (1) visible header movement, (2) setting
flags in Rmail-specific headers, and (3) replacement of the whole
message with an edited version.
--
Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp
Universi
next prev parent reply other threads:[~2003-05-23 15:03 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
[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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wughogc8.fsf@tleepslib.sk.tsukuba.ac.jp \
--to=stephen@xemacs.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.