all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: storm@cua.dk
Subject: Re: [HELP] (bug?) Saving a buffer without any conversion?
Date: Fri, 17 Jan 2003 20:07:36 +0900 (JST)	[thread overview]
Message-ID: <200301171107.UAA13147@etlken.m17n.org> (raw)
In-Reply-To: <E18ZSiR-0007vD-00@fencepost.gnu.org> (message from Richard Stallman on Fri, 17 Jan 2003 04:23:07 -0500)

In article <E18ZSiR-0007vD-00@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> 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.

Right.

>     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
handa@m17n.org

  reply	other threads:[~2003-01-17 11:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13 17:52 [HELP] (bug?) Saving a buffer without any conversion? Mario Lang
2003-01-14  1:00 ` Kim F. Storm
2003-01-14  6:06   ` Eli Zaretskii
2003-01-14  6:46     ` Mario Lang
2003-01-14 18:37       ` Eli Zaretskii
2003-01-14 16:19   ` Stefan Monnier
2003-01-15  1:16 ` Kenichi Handa
2003-01-15 11:02   ` Kim F. Storm
2003-01-15 10:59     ` Kenichi Handa
2003-01-15 13:27       ` Kim F. Storm
2003-01-15 16:30         ` Eli Zaretskii
2003-01-16 22:52           ` Kim F. Storm
2003-01-17  2:35             ` Kenichi Handa
2003-01-16  1:18         ` Kenichi Handa
2003-01-17  9:23         ` Richard Stallman
2003-01-17 11:07           ` Kenichi Handa [this message]
2003-01-15 16:59       ` Mario Lang
2003-01-15 23:27       ` Richard Stallman
2003-01-16  6:45         ` Kenichi Handa

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=200301171107.UAA13147@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=storm@cua.dk \
    /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.