all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* set input/output coding system for term-mode
@ 2007-06-12  2:37 William Xu
  2007-06-12  3:22 ` Eli Zaretskii
  2007-06-12  4:15 ` ssSslang
  0 siblings, 2 replies; 11+ messages in thread
From: William Xu @ 2007-06-12  2:37 UTC (permalink / raw
  To: help-gnu-emacs

How can i set input/output coding system for term-mode inside emacs? The
only way i can think of is starting emacs as `LC_ALL=coding emacs',
which is far from satisfactory.

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  2:37 set input/output coding system for term-mode William Xu
@ 2007-06-12  3:22 ` Eli Zaretskii
  2007-06-12  4:37   ` William Xu
  2007-06-12  4:15 ` ssSslang
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2007-06-12  3:22 UTC (permalink / raw
  To: help-gnu-emacs

> From: William Xu <william.xwl@gmail.com>
> Date: Tue, 12 Jun 2007 10:37:07 +0800
> 
> How can i set input/output coding system for term-mode inside emacs?

If you mean keyboard input and screen output, then the commands you
want are "C-x RET k" and "C-x RET t".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  2:37 set input/output coding system for term-mode William Xu
  2007-06-12  3:22 ` Eli Zaretskii
@ 2007-06-12  4:15 ` ssSslang
  2007-06-12  4:42   ` William Xu
  1 sibling, 1 reply; 11+ messages in thread
From: ssSslang @ 2007-06-12  4:15 UTC (permalink / raw
  To: William Xu; +Cc: help-gnu-emacs

William Xu <william.xwl@gmail.com> writes:

> How can i set input/output coding system for term-mode inside emacs? The
> only way i can think of is starting emacs as `LC_ALL=coding emacs',
> which is far from satisfactory.

What about "C-x RET c" stands for change the coding system for following
command? Then start the term mode.

-- 
ssSslang

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  3:22 ` Eli Zaretskii
@ 2007-06-12  4:37   ` William Xu
  2007-06-12  9:24     ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: William Xu @ 2007-06-12  4:37 UTC (permalink / raw
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

   > How can i set input/output coding system for term-mode inside emacs?

   If you mean keyboard input and screen output, 

Firstly, I have (prefer-coding-system 'utf-8) in .emacs. In *terminal*
buffer, suppose there's a file `foo' encoded with 'gb2312, at present
`cat foo' would display garbages, which is what i'm trying to solve.

   then the commands you want are "C-x RET k" and "C-x RET t".

Hmm, it has no effects. Just same as previous.

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  4:15 ` ssSslang
@ 2007-06-12  4:42   ` William Xu
  0 siblings, 0 replies; 11+ messages in thread
From: William Xu @ 2007-06-12  4:42 UTC (permalink / raw
  To: help-gnu-emacs

ssSslang <sssslang@163.com> writes:

   What about "C-x RET c" stands for change the coding system for following
   command? Then start the term mode.

Doesn't work either..

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  4:37   ` William Xu
@ 2007-06-12  9:24     ` Peter Dyballa
  2007-06-13  4:29       ` William Xu
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-06-12  9:24 UTC (permalink / raw
  To: William Xu; +Cc: help-gnu-emacs


Am 12.06.2007 um 06:37 schrieb William Xu:

> Firstly, I have (prefer-coding-system 'utf-8) in .emacs. In *terminal*
> buffer, suppose there's a file `foo' encoded with 'gb2312, at present
> `cat foo' would display garbages, which is what i'm trying to solve.

It does not work in any physical or emulated terminal to see the  
contents of a file which is not encoded in the terminal's default  
encoding in the file's proper encoding. Except this contents contains  
ANSI sequences to switch between character sets or writing directions.

The question is why you want to do such a silly thing in GNU Emacs!  
You can easily visit the file in some buffer using the correct  
encoding ... And you can prefer a few coding systems.

--
Greetings

   Pete

Think of XML as Lisp for COBOL programmers.
                               -- Tony-A (some guy on /.)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-12  9:24     ` Peter Dyballa
@ 2007-06-13  4:29       ` William Xu
  2007-06-13  8:35         ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: William Xu @ 2007-06-13  4:29 UTC (permalink / raw
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

   It does not work in any physical or emulated terminal to see the
   contents of a file which is not encoded in the terminal's default
   encoding in the file's proper encoding. 

So you mean that the terminal's default encoding can't be changed inside
Emacs?

   The question is why you want to do such a silly thing in GNU Emacs!  You
   can easily visit the file in some buffer using the correct  encoding
   ... And you can prefer a few coding systems.

Hehe.. Actually i'd like to use terminal to login some BBS system(by
ssh). Any better alternatives?

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-13  4:29       ` William Xu
@ 2007-06-13  8:35         ` Peter Dyballa
  2007-06-13  8:51           ` William Xu
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-06-13  8:35 UTC (permalink / raw
  To: William Xu; +Cc: help-gnu-emacs


Am 13.06.2007 um 06:29 schrieb William Xu:

>
>    The question is why you want to do such a silly thing in GNU  
> Emacs!  You
>    can easily visit the file in some buffer using the correct   
> encoding
>    ... And you can prefer a few coding systems.
>
> Hehe.. Actually i'd like to use terminal to login some BBS system(by
> ssh). Any better alternatives?

Use more than one *shell* or *terminal* buffer – each with a  
different encoding, suiting the BBS.

--
Greetings

   Pete

These are my principles and if you don't like them... well, I have  
others.
                                         - Groucho Marx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-13  8:35         ` Peter Dyballa
@ 2007-06-13  8:51           ` William Xu
  2007-06-13  9:19             ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: William Xu @ 2007-06-13  8:51 UTC (permalink / raw
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

[...]

   each with a different encoding,

Isn't this my original problem?

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-13  8:51           ` William Xu
@ 2007-06-13  9:19             ` Peter Dyballa
  2007-06-13  9:52               ` William Xu
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-06-13  9:19 UTC (permalink / raw
  To: William Xu; +Cc: help-gnu-emacs


Am 13.06.2007 um 10:51 schrieb William Xu:

>    each with a different encoding,
>
> Isn't this my original problem?

No – as far as I understood. You wanted to change the single buffer's  
encoding "on-the-fly," having in it segments in encoding a or  
encoding b or encoding c or ...

Check whether there is a hook that can set the encoding for a *shell*  
or *terminal* buffer when it is created and give it a unique name, too.

--
Greetings

   Pete

"We have to expect it, otherwise we would be surprised."

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: set input/output coding system for term-mode
  2007-06-13  9:19             ` Peter Dyballa
@ 2007-06-13  9:52               ` William Xu
  0 siblings, 0 replies; 11+ messages in thread
From: William Xu @ 2007-06-13  9:52 UTC (permalink / raw
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

   Am 13.06.2007 um 10:51 schrieb William Xu:

   >    each with a different encoding,
   >
   > Isn't this my original problem?

   No – as far as I understood. You wanted to change the single buffer's
   encoding "on-the-fly," having in it segments in encoding a or  encoding
   b or encoding c or ...

   Check whether there is a hook that can set the encoding for a *shell*
   or *terminal* buffer when it is created and give it a unique name, too.

It doesn't matter whether it can be set "on-the-fly" or not. i will
simply have one single *terminal* buffer. *terminal* has a
term-setup-hook, i add the following to it:

,----
| (defun xwl-term-setup-hook ()
|   (set-buffer-process-coding-system 'gb2312 'gb2312)
|   (set-buffer-file-coding-system 'gb2312 'gb2312)
|   (set-terminal-coding-system 'gb2312))
| 
| (add-hook 'term-setup-hook 'xwl-term-setup-hook)
`----

But still without luck..

-- 
William

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-13  9:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12  2:37 set input/output coding system for term-mode William Xu
2007-06-12  3:22 ` Eli Zaretskii
2007-06-12  4:37   ` William Xu
2007-06-12  9:24     ` Peter Dyballa
2007-06-13  4:29       ` William Xu
2007-06-13  8:35         ` Peter Dyballa
2007-06-13  8:51           ` William Xu
2007-06-13  9:19             ` Peter Dyballa
2007-06-13  9:52               ` William Xu
2007-06-12  4:15 ` ssSslang
2007-06-12  4:42   ` William Xu

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.