From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: yet more term.el fixes #2 Date: Thu, 23 Sep 2004 17:28:56 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200409220317.i8M3HEGK002410@scanner2.ics.uci.edu> <200409220418.i8M4IJGK005554@scanner2.ics.uci.edu> <200409221743.i8MHhSGK020804@scanner2.ics.uci.edu> <200409230214.i8N2E4GK024796@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 1095975014 2861 80.91.229.6 (23 Sep 2004 21:30:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2004 21:30:14 +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 23:29:57 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 1CAbA5-0005VB-00 for ; Thu, 23 Sep 2004 23:29:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAbG7-0003Wb-Uz for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2004 17:36:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CAbG1-0003WG-DK for emacs-devel@gnu.org; Thu, 23 Sep 2004 17:36:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CAbG0-0003Vq-Ff for emacs-devel@gnu.org; Thu, 23 Sep 2004 17:36:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAbG0-0003Vg-8i for emacs-devel@gnu.org; Thu, 23 Sep 2004 17:36:04 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CAb9n-0007cw-N1; Thu, 23 Sep 2004 17:29:39 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 2697DB30284; Thu, 23 Sep 2004 17:29:01 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7BF0A4AC5BA; Thu, 23 Sep 2004 17:28:56 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 3820F8CA23; Thu, 23 Sep 2004 17:28:56 -0400 (EDT) Original-To: Dan Nicolaescu In-Reply-To: (Stefan's message of "Thu, 23 Sep 2004 07:44:50 -0400") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner: Found to be clean, Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5), n'est pas un polluriel (inscrit sur la liste blanche), SpamAssassin (score=0, requis 5) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-MailScanner-From: monnier@iro.umontreal.ca 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:27513 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27513 > Sorry I miss that term-exec-1. > Please add to my previous patch the one below. Duh! Alright, just try the patch below. But in any case I don't really understand your problem. I don't see any call to `char-width', so I guess you're probably not referring to the `char-width' function but just to the on-screen width of some characters in the 128-25 range. Most likely it's 4 because they are displayed as "\NNN". When I try M-x term and then I cat a file with latin-1 accents they get displayed correctly. Is that the case for you as well? If not can you better describe your setup (things like locale and stuff)? As for those \NNN thingies, we should indeed get rid of them in term-mode because they screw things up. For that, we need something like: (defvar term-display-table (let ((dt (or (copy-sequence standard-display-table) (make-display-table))) i) (setq i 0) (while (< i 32) (aset dt i (vector i)) (setq i (1+ i))) (setq i 128) (while (< i 256) (aset dt i (vector i)) (setq i (1+ i))) dt)) and in term-mode we need to (setq buffer-display-table term-display-table). Stefan --- orig/lisp/term.el +++ mod/lisp/term.el @@ -1398,9 +1396,10 @@ (format "COLUMNS=%d" term-width)) process-environment)) (process-connection-type t) - ;; inhibit-eol-conversion doesn't seem to do the job, but this does. - (coding-system-for-read 'binary) - ) + ;; The process's output contains not just chars but also binary + ;; escape codes, so we need to see the raw output. We will have to + ;; do the decoding by hand on the parts that are made of chars. + (coding-system-for-read 'binary)) (apply 'start-process name buffer "/bin/sh" "-c" (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ @@ -2720,7 +2718,8 @@ ;; following point if not eob nor insert-mode. (let ((old-column (current-column)) columns pos) - (insert (substring str i funny)) + (insert (decode-coding-string + (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (when (not (or (eobp) term-insert-mode))