all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, Miles Bader <miles@gnu.org>
Subject: Re: yet more term.el fixes #2
Date: Thu, 23 Sep 2004 17:28:56 -0400	[thread overview]
Message-ID: <jwvfz58vgag.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m1wtylw6yt.fsf-monnier+emacs@gnu.org> (Stefan's message of "Thu, 23 Sep 2004 07:44:50 -0400")

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

      reply	other threads:[~2004-09-23 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-22  3:17 yet more term.el fixes #2 Dan Nicolaescu
2004-09-22  3:42 ` Miles Bader
2004-09-22  4:18   ` Dan Nicolaescu
2004-09-22  4:47     ` Miles Bader
2004-09-22 13:16       ` Stefan Monnier
2004-09-22 17:43         ` Dan Nicolaescu
2004-09-22 20:23           ` Stefan Monnier
2004-09-23  2:14             ` Dan Nicolaescu
2004-09-23 11:44               ` Stefan
2004-09-23 21:28                 ` Stefan Monnier [this message]

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=jwvfz58vgag.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /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.