all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Font Interaction
@ 2010-04-21  7:35 Paulo J. Matos
  2010-04-21 16:20 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Paulo J. Matos @ 2010-04-21  7:35 UTC (permalink / raw
  To: help-gnu-emacs

Hi,

I am trying to understand how the font settings interact between each
other in other to solve unicode issues.
For example, I tend to run emacs-23.1 in a console both in windows and
linux. The windows combination is Putty/Emacs and the Linux is
GnomeShell/Emacs. Now, both the GnomeShell and Putty have its font
setting. Emacs also has a font setting. If I don't set a font in emacs
but I do set a font in GnomeShell and Putty to one that supports
unicode, emacs still doesn't render that (obviously doesn't know about
the font). 

So, what's the best way to handle this interaction? Should I configure
the terminal and Emacs to use the same font? What's the best solution
around for this? 

Cheers,

--
PMatos


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom




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

* Re: Font Interaction
  2010-04-21  7:35 Font Interaction Paulo J. Matos
@ 2010-04-21 16:20 ` Eli Zaretskii
  2010-04-22  9:04   ` pocmatos
  2010-04-23  7:07   ` Paulo J. Matos
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2010-04-21 16:20 UTC (permalink / raw
  To: help-gnu-emacs

> From: pocmatos@gmail.com (Paulo J. Matos)
> Date: Wed, 21 Apr 2010 08:35:55 +0100
> 
> For example, I tend to run emacs-23.1 in a console both in windows and
> linux. The windows combination is Putty/Emacs and the Linux is
> GnomeShell/Emacs. Now, both the GnomeShell and Putty have its font
> setting. Emacs also has a font setting. If I don't set a font in emacs
> but I do set a font in GnomeShell and Putty to one that supports
> unicode, emacs still doesn't render that (obviously doesn't know about
> the font). 

In addition to setting up PuTTY (in the Translation page) to use
UTF-8, you need to tell Emacs that this is what the terminal supports,
like this:

   C-x RET t utf-8 RET

That's all!  You don't need to set up fonts in Emacs, because,
obviously, fonts are not used by Emacs for displaying TTY frames.  I
don't know about GnomeShell, but I would guess you don't need to
configure its font, either.




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

* Re: Font Interaction
  2010-04-21 16:20 ` Eli Zaretskii
@ 2010-04-22  9:04   ` pocmatos
  2010-04-22  9:16     ` Juanma Barranquero
  2010-04-23  7:07   ` Paulo J. Matos
  1 sibling, 1 reply; 11+ messages in thread
From: pocmatos @ 2010-04-22  9:04 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:
>
> In addition to setting up PuTTY (in the Translation page) to use
> UTF-8, you need to tell Emacs that this is what the terminal supports,
> like this:
>
>    C-x RET t utf-8 RET
>

Great, thanks. Can I actually enable this on my .emacs?


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom




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

* Re: Font Interaction
  2010-04-22  9:04   ` pocmatos
@ 2010-04-22  9:16     ` Juanma Barranquero
  0 siblings, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2010-04-22  9:16 UTC (permalink / raw
  To: pocmatos; +Cc: help-gnu-emacs

On Thu, Apr 22, 2010 at 11:04,  <pocmatos@gmail.com> wrote:

> Great, thanks. Can I actually enable this on my .emacs?

Use the function `set-terminal-coding-system' (which is what C-x <RET>
t is bound to).

    Juanma




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

* Re: Font Interaction
  2010-04-21 16:20 ` Eli Zaretskii
  2010-04-22  9:04   ` pocmatos
@ 2010-04-23  7:07   ` Paulo J. Matos
  2010-04-23  8:19     ` Eli Zaretskii
  2010-04-23  8:27     ` Peter Dyballa
  1 sibling, 2 replies; 11+ messages in thread
From: Paulo J. Matos @ 2010-04-23  7:07 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>
> In addition to setting up PuTTY (in the Translation page) to use
> UTF-8, you need to tell Emacs that this is what the terminal supports,
> like this:
>
>    C-x RET t utf-8 RET
>
> That's all!  You don't need to set up fonts in Emacs, because,
> obviously, fonts are not used by Emacs for displaying TTY frames.  I
> don't know about GnomeShell, but I would guess you don't need to
> configure its font, either.
>
>

Unfortunately, after setting Putty and emacs 23.1 to utf-8 my emacs gets
completely screwed up. Check this out:
http://twitpic.com/1hp3os

Is this, somehow, to be expected?

-- 
PMatos




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

* Re: Font Interaction
  2010-04-23  7:07   ` Paulo J. Matos
@ 2010-04-23  8:19     ` Eli Zaretskii
  2010-04-23  8:27     ` Peter Dyballa
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2010-04-23  8:19 UTC (permalink / raw
  To: help-gnu-emacs

> From: pocmatos@gmail.com (Paulo J. Matos)
> Cc: help-gnu-emacs@gnu.org
> Date: Fri, 23 Apr 2010 08:07:32 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >
> > In addition to setting up PuTTY (in the Translation page) to use
> > UTF-8, you need to tell Emacs that this is what the terminal supports,
> > like this:
> >
> >    C-x RET t utf-8 RET
> >
> > That's all!  You don't need to set up fonts in Emacs, because,
> > obviously, fonts are not used by Emacs for displaying TTY frames.  I
> > don't know about GnomeShell, but I would guess you don't need to
> > configure its font, either.
> >
> >
> 
> Unfortunately, after setting Putty and emacs 23.1 to utf-8 my emacs gets
> completely screwed up. Check this out:
> http://twitpic.com/1hp3os
> 
> Is this, somehow, to be expected?

No, of course not.  The above recipe is what I use, and it "works for
me".

Can you describe what exactly did you do to "set Putty and emacs 23.1
to utf-8", on the Unix side, in Emacs, and on Windows with PuTTY?

Also, do you see the same problems if you start with "emacs -Q", then
set PuTTY to UTF-8, and type "C-x RET t utf-8 RET"?




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

* Re: Font Interaction
  2010-04-23  7:07   ` Paulo J. Matos
  2010-04-23  8:19     ` Eli Zaretskii
@ 2010-04-23  8:27     ` Peter Dyballa
  2010-04-23  8:59       ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2010-04-23  8:27 UTC (permalink / raw
  To: Paulo J. Matos; +Cc: help-gnu-emacs


Am 23.04.2010 um 09:07 schrieb Paulo J. Matos:

> Unfortunately, after setting Putty and emacs 23.1 to utf-8 my emacs  
> gets
> completely screwed up.


So it might be worth to set an UTF-8 encoding only for some buffers or  
processes, or, when the terminal is definitely set up for UTF-8 and  
GNU Emacs is by default in UTF-8 mood (via environment variable  
LC_CTYPE, LC_LANG, LC_ALL, or other means), then set these "screwed  
up" processes/buffers into some 8- or 7-bit encoding.

--
Greetings

   Pete

Work is the curse of the drinking class.
				– Oscar Wilde





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

* Re: Font Interaction
  2010-04-23  8:27     ` Peter Dyballa
@ 2010-04-23  8:59       ` Eli Zaretskii
  2010-04-23 10:19         ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2010-04-23  8:59 UTC (permalink / raw
  To: help-gnu-emacs

> Cc: Eli Zaretskii <eliz@gnu.org>,
>  help-gnu-emacs@gnu.org
> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Fri, 23 Apr 2010 10:27:06 +0200
> 
> So it might be worth to set an UTF-8 encoding only for some buffers or  
> processes, or, when the terminal is definitely set up for UTF-8 and  
> GNU Emacs is by default in UTF-8 mood (via environment variable  
> LC_CTYPE, LC_LANG, LC_ALL, or other means), then set these "screwed  
> up" processes/buffers into some 8- or 7-bit encoding.

What? why?

The way Emacs encodes terminal output on text terminals is entirely
independent of the buffer contents.  Characters in the buffer are held
in the internal Emacs representation, and Emacs explicitly encodes
them when it sends them to the screen.  So there's no dependency
whatsoever between the buffer contents and the terminal encodings that
could be used with it.  (Of course, some characters will be sent as
`?' if the terminal encoding cannot represent them, but UTF-8 can
represent all characters, and `?' on display is not the OP's problem
anyway.)

Also, "C-x RET t" overrides any settings determined by LC_* variables,
so that also should be irrelevant.

Am I missing something?




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

* Re: Font Interaction
  2010-04-23  8:59       ` Eli Zaretskii
@ 2010-04-23 10:19         ` Peter Dyballa
  2010-04-23 14:25           ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2010-04-23 10:19 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs


Am 23.04.2010 um 10:59 schrieb Eli Zaretskii:

> Am I missing something?


Yes: the source which feeds the buffers. Paul's screen-shot seems to  
show output from some process. When this is some ANSI or MS/IBM code  
page encoding it's likely that particular 8-bit characters will be  
misinterpreted in UTF-8. Do you remember posts in which the senders  
ask why in *compilation* buffer strange codes appear? They represent “  
or ” for example, possibly UTF-8 contents from GCC fed into some  
presumed 7- or 8-bit encoded stream (completely OK for file names and  
their source code). Similar problems exist with TeX output in  
*compilation* like buffers, which is internally a 7- or 8-bit  
application.

Therefore I recommend to set different encodings for different process  
output. This works for me...

--
Greetings

   Pete

Remember: use logout to logout.





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

* Re: Font Interaction
  2010-04-23 10:19         ` Peter Dyballa
@ 2010-04-23 14:25           ` Eli Zaretskii
  2010-04-23 19:01             ` Paulo J. Matos
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2010-04-23 14:25 UTC (permalink / raw
  To: help-gnu-emacs

> Cc: help-gnu-emacs@gnu.org
> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Fri, 23 Apr 2010 12:19:01 +0200
> 
> > Am I missing something?
> 
> 
> Yes: the source which feeds the buffers. Paul's screen-shot seems to  
> show output from some process.

I thought it was Gnus.




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

* Re: Font Interaction
  2010-04-23 14:25           ` Eli Zaretskii
@ 2010-04-23 19:01             ` Paulo J. Matos
  0 siblings, 0 replies; 11+ messages in thread
From: Paulo J. Matos @ 2010-04-23 19:01 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>
> I thought it was Gnus.

Yes, my screenshot was definitely Gnus! 

--
PMatos




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

end of thread, other threads:[~2010-04-23 19:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21  7:35 Font Interaction Paulo J. Matos
2010-04-21 16:20 ` Eli Zaretskii
2010-04-22  9:04   ` pocmatos
2010-04-22  9:16     ` Juanma Barranquero
2010-04-23  7:07   ` Paulo J. Matos
2010-04-23  8:19     ` Eli Zaretskii
2010-04-23  8:27     ` Peter Dyballa
2010-04-23  8:59       ` Eli Zaretskii
2010-04-23 10:19         ` Peter Dyballa
2010-04-23 14:25           ` Eli Zaretskii
2010-04-23 19:01             ` Paulo J. Matos

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.