From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: yet more term.el fixes #2 Date: Wed, 22 Sep 2004 19:14:02 -0700 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200409230214.i8N2E4GK024796@scanner2.ics.uci.edu> References: <200409220317.i8M3HEGK002410@scanner2.ics.uci.edu> <200409220418.i8M4IJGK005554@scanner2.ics.uci.edu> <200409221743.i8MHhSGK020804@scanner2.ics.uci.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1095905765 18253 80.91.229.6 (23 Sep 2004 02:16:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2004 02:16:05 +0000 (UTC) Cc: emacs-devel@gnu.org, Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 23 04:15:47 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CAJ99-00066d-00 for ; Thu, 23 Sep 2004 04:15:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAJF9-0007lP-Lk for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2004 22:21:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CAJF2-0007lK-H2 for emacs-devel@gnu.org; Wed, 22 Sep 2004 22:21:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CAJF0-0007l8-OF for emacs-devel@gnu.org; Wed, 22 Sep 2004 22:21:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAJF0-0007l5-KG for emacs-devel@gnu.org; Wed, 22 Sep 2004 22:21:50 -0400 Original-Received: from [128.195.1.36] (helo=scanner2.ics.uci.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CAJ8r-0003RU-Jk; Wed, 22 Sep 2004 22:15:29 -0400 Original-Received: from vino.ics.uci.edu (dann@vino.ics.uci.edu [128.195.11.198]) by scanner2.ics.uci.edu (8.12.10/8.12.10) with ESMTP id i8N2E4GK024796; Wed, 22 Sep 2004 19:14:04 -0700 (PDT) Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "Wed, 22 Sep 2004 16:23:52 -0400") Original-Lines: 42 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-99.4, required 5, J_CHICKENPOX_42, USER_IN_WHITELIST) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27470 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27470 Stefan Monnier writes: > > (insert (string-as-unibyte (substring str i funny))) > > I think string-as-unibyte is also an extremely poor choice here and will > likely lead to unexpected errors in some cases (it's a function that should > have big warning signs all around it, like string-as-multibyte). > > Also calling set-buffer-multibyte is to be avoided if possible. > > Can you try with > > (insert (decode-coding-string (substring str i funny) locale-coding-system)) > Also based on your above code, it seems that `str' is a multibyte string, > which sounds wrong. I think that the coding-system used for the process's > output should be `binary'. Can you see what coding-system is used for > the process? In term-exec-1: (coding-system-for-read 'unknown-unix) > I suggest a patch like the one below, [snip] Did not work. It can be made work by binding: (default-enable-multibyte-characters t) when creating the buffer in make-term (so as to do what set-buffer-multibyte used to do) and binding (default-enable-multibyte-characters nil) in term-exec-1. Now that this stuff work I found out that pasting non-ASCII text with the mouse does not work. Pasting works by doing process-send-string with the data from the kill ring. It seems that the string must be encoded in some way. Any idea how to deal with that?