[Top][All Lists]

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

Re: [HELP] (bug?) Saving a buffer without any conversion?

From: Kenichi Handa
Subject: Re: [HELP] (bug?) Saving a buffer without any conversion?
Date: Fri, 17 Jan 2003 20:07:36 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:
>     If the process' input coding system is no-conversion or raw-text, the
>     string argument to the filter function is a unibyte string; otherwise
>     it is a multibyte string.  Use `string-as-multibyte' on a unibyte
>     string before inserting it in a multibyte buffer.

> You might or might no want to use string-as-multibyte, depending
> on what results you want to get.


>     In any case, I have just confirmed that if you DON'T use a filter
>     function, but rather relies on emacs itself to insert received data
>     into the buffer, it works nicely even with a multibyte buffer.

> Does that mean it does the equivalent of using string-as-multibyte?

Yes.   This is the relevant code (in read_process_output).

      /* Adjust the multibyteness of TEXT to that of the buffer.  */
      if (NILP (current_buffer->enable_multibyte_characters)
          != ! STRING_MULTIBYTE (text))
        text = (STRING_MULTIBYTE (text)
                ? Fstring_as_unibyte (text)
                : Fstring_as_multibyte (text));
      nbytes = SBYTES (text);
      nchars = SCHARS (text);
      /* Insert before markers in case we are inserting where
         the buffer's mark is, and the user's next command is Meta-y.  */
      insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0);

Ken'ichi HANDA

reply via email to

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