emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs-diffs Digest, Vol 2, Issue 28


From: Richard Stallman
Subject: Re: Emacs-diffs Digest, Vol 2, Issue 28
Date: Tue, 21 Jan 2003 13:18:26 -0500

    If we want a multibyte sequence but each character contained
    is one of ascii, eight-bit-control, and eight-bit-graphic
    corresponding to the original bytes, we must read by
    no-conversion, and insert characters one by one as below:
      (apply 'insert (string-to-list UNIBYTE-STRING))
    Perhaps, we must have a function, say, string-to-multibyte,
    and make this enable.
      (insert (string-to-multibyte UNIBYTE-STRING))

I think we do need this function string-to-multibyte, and its doc
string should carefully explain how it differs from
string-make-multibyte.

    I don't remember why the current code does as above.  I
    think the behaviour what Eli wrote is more consistent with
    the behaviour of file reading.

    Shall I change the code as what Eli wrote (by introducing
    the new function string-to-multibyte)?

Please do introduce string-to-multibyte.  What other change do
you propose?  I am not sure how what Eli wrote differs from the
current behavior.

    By the way, it may be clean to have all these functions in
    parallel, and spare one section describing the difference of
    MAKE, AS, TO conversions in info.

    string-make-multibyte
    string-as-multibyte
    string-to-multibyte

These three are all useful.

    string-make-unibyte
    string-as-unibyte
    string-to-unibyte (perpaps the same as string-as-unibyte, or
                      it should signal an error if non-ascii,
                      non-eight-bit-XXX is contained).

I don't see a need to add string-to-unibyte.

    buffer-make-multibyte
    buffer-as-multibyte (same as (set-buffer-multibyte BUFFER t))
    buffer-to-multibyte

I don't think buffer-make-multibyte and buffer-to-multibyte are
useful.  What is useful is to have functions to operate on a region in
a multibyte buffer, transforming the text between these three
different representations.  (Some of the 6 transformations may be
meaningless or impossible; we should only support the meaningful
ones.)

    buffer-make-unibyte
    buffer-as-unibyte (same as (set-buffer-multibyte BUFFER nil))
    buffer-to-nuibyte

I don't think any change here is worth making.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]