[Top][All Lists]

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

Re: yet more term.el fixes #2

From: Stefan Monnier
Subject: Re: yet more term.el fixes #2
Date: Thu, 23 Sep 2004 17:28:56 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

> Sorry I miss that term-exec-1.
> Please add to my previous patch the one below.

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)
    (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)))

and in term-mode we need to (setq buffer-display-table term-display-table).


--- orig/lisp/term.el
+++ mod/lisp/term.el
@@ -1398,9 +1396,10 @@
           (format "COLUMNS=%d" term-width))
        (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) 
                            (setq term-current-column (current-column)
                                  columns (- term-current-column old-column))
                            (when (not (or (eobp) term-insert-mode))

reply via email to

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