* font or face problem in emacs
@ 2006-06-29 20:50 H.S.
2006-06-29 22:18 ` Peter Dyballa
0 siblings, 1 reply; 10+ messages in thread
From: H.S. @ 2006-06-29 20:50 UTC (permalink / raw)
Hello,
When I compile a program in emacs, I notice that I get some strange
escape sequences in the compiler output window of emacs. For example, if
my program is:
----------------------------------------------------------------
#include<iostream>
int main(){
int i,j;
std::cout << "Hellow Wrold!" << std::endl;
return 0;
}
----------------------------------------------------------------
and I compile it with:
g++ -Wall -ansi -o testprog testprog.cc
I get the following in my emacs compiler message window (notice the
strange characters around the variables and function names):
----------------------------------------------------------------
g++ -Wall -ansi -o testprog testprog.cc
testprog.cc: In function âint main()â:
testprog.cc:6: warning: unused variable âiâ
testprog.cc:6: warning: unused variable âjâ
Compilation finished at Thu Jun 29 15:01:30
----------------------------------------------------------------
The strange characters around a variable are(I have typed the
backslashes and numbers so that they are displayed properly here):
on left hand side: â\200\230
on right hand side: â\200\231
I guess this has something to do with the face of those strings in the
compiler output in emacs. And that I may not have proper fonts
installed. Am I on the right track? All inputs are welcome in solving
this little problem.
BTW, this started happening only after I reintalled Debian Etch a few
weeks ago.
I have:
> dpkg -l *emacs* | grep ^ii
ii emacs-goodies-el 26.6-1 Miscellaneous add-ons for Emacs
ii emacs21 21.4a-3 The GNU Emacs editor
ii emacs21-bin-common 21.4a-3 The GNU Emacs editor's shared, architecture
ii emacs21-common 21.4a-3 The GNU Emacs editor's shared, architecture
ii emacsen-common 1.4.17 Common facilities for all emacsen
thanks,
->HS
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 20:50 font or face problem in emacs H.S.
@ 2006-06-29 22:18 ` Peter Dyballa
2006-06-29 22:37 ` H.S.
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Peter Dyballa @ 2006-06-29 22:18 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 29.06.2006 um 22:50 schrieb H.S.:
> g++ -Wall -ansi -o testprog testprog.cc
> testprog.cc: In function ‘int main()’:
> testprog.cc:6: warning: unused variable ‘i’
> testprog.cc:6: warning: unused variable ‘j’
>
> Compilation finished at Thu Jun 29 15:01:30
> ----------------------------------------------------------------
>
> The strange characters around a variable are(I have typed the
> backslashes and numbers so that they are displayed properly here):
> on left hand side: â\200\230
> on right hand side: â\200\231
What you see here is UTF-8 represented as 8bit:
U+2018 = E2 80 98 : LEFT SINGLE QUOTATION MARK = ‘
U+2019 = E2 80 99 : RIGHT SINGLE QUOTATION MARK = ’
â is E2 in hex
200 oct is 80 in hex
230 oct and 231 oct are 98 resp. 99 in hex.
Make the *compilation* buffer be encoded in UTF-8 or make your LANG
or LC_CTYPE environment variables 8 bit -- could be there is some
option in your g++ to stay in 8 bit when printing some message.
--
Greetings
Pete
“Computers are good at following instructions, but not at reading
your mind.”
- D. E. Knuth, The TeXbook, Addison-Wesley 1984, 1986, 1996, p. 9
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 22:18 ` Peter Dyballa
@ 2006-06-29 22:37 ` H.S.
2006-06-30 8:41 ` Peter Dyballa
2006-06-29 22:47 ` Peter Dyballa
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: H.S. @ 2006-06-29 22:37 UTC (permalink / raw)
Peter Dyballa wrote:
>
> Am 29.06.2006 um 22:50 schrieb H.S.:
>
>> g++ -Wall -ansi -o testprog testprog.cc
>> testprog.cc: In function ‘int main()’:
>> testprog.cc:6: warning: unused variable ‘i’
>> testprog.cc:6: warning: unused variable ‘j’
>>
>> Compilation finished at Thu Jun 29 15:01:30
>> ----------------------------------------------------------------
>>
>> The strange characters around a variable are(I have typed the
>> backslashes and numbers so that they are displayed properly here):
>> on left hand side: â\200\230
>> on right hand side: â\200\231
>
>
> What you see here is UTF-8 represented as 8bit:
>
> U+2018 = E2 80 98 : LEFT SINGLE QUOTATION MARK = ‘
> U+2019 = E2 80 99 : RIGHT SINGLE QUOTATION MARK = ’
>
> â is E2 in hex
> 200 oct is 80 in hex
> 230 oct and 231 oct are 98 resp. 99 in hex.
>
> Make the *compilation* buffer be encoded in UTF-8 or make your LANG or
> LC_CTYPE environment variables 8 bit -- could be there is some option
> in your g++ to stay in 8 bit when printing some message.
>
> --
> Greetings
>
> Pete
>
> “Computers are good at following instructions, but not at reading your
> mind.”
> - D. E. Knuth, The TeXbook, Addison-Wesley 1984, 1986, 1996, p. 9
Yup, you are right. I just discovered another post in this newsgroup.
This seems to have worked:
M-x prefer-coding-system RET utf-8 RET
which is from:
http://groups.google.ca/group/gnu.emacs.help/browse_thread/thread/49787de21a638740/d3fdc305681db276?lnk=st&q=%22%5C200%5C230%22+emacs&rnum=2&hl=en#d3fdc305681db276
So, do I need to use the above command everything or is there a problem
with the way emacs treats various locales? I have:
$> set | grep -i lang
LANG=en_CA.UTF-8
LANGUAGE=en_CA:en_US:en_GB:en
->HS
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 22:18 ` Peter Dyballa
2006-06-29 22:37 ` H.S.
@ 2006-06-29 22:47 ` Peter Dyballa
2006-06-29 23:34 ` H.S.
2006-06-30 12:03 ` Eli Zaretskii
3 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2006-06-29 22:47 UTC (permalink / raw)
Cc: emacs mailing list
Am 30.06.2006 um 00:18 schrieb Peter Dyballa:
> Make the *compilation* buffer be encoded in UTF-8 or make your LANG
> or LC_CTYPE environment variables 8 bit -- could be there is some
> option in your g++ to stay in 8 bit when printing some message.
Could be it's easier to make at least for GNU Emacs the environment
to be UTF-8 -- it it's modern enough it will switch buffers into
UTF-8 encoding.
--
Mit friedvollen Grüßen
Pete
Remember: use logout to logout.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 22:18 ` Peter Dyballa
2006-06-29 22:37 ` H.S.
2006-06-29 22:47 ` Peter Dyballa
@ 2006-06-29 23:34 ` H.S.
2006-06-30 9:03 ` Peter Dyballa
2006-06-30 12:03 ` Eli Zaretskii
3 siblings, 1 reply; 10+ messages in thread
From: H.S. @ 2006-06-29 23:34 UTC (permalink / raw)
Peter Dyballa wrote:
> Make the *compilation* buffer be encoded in UTF-8 or make your LANG or
> LC_CTYPE environment variables 8 bit -- could be there is some option
> in your g++ to stay in 8 bit when printing some message.
Yes, that is one method. But with all this talk of systems being utf-8
compatible and such these days, I was expecting that applications are
getting better at this. If Emacs is not UTF-8 complaint, I would like to
know for sure so that I can accomodate other applications I use. On the
other hand, if Emacs is expected to recognize UTF-8, then there ought to
be a way to make it do so by default. All I want to know is which way is it?
thanks for your explanations,
->HS
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 22:37 ` H.S.
@ 2006-06-30 8:41 ` Peter Dyballa
2006-06-30 16:13 ` H.S.
0 siblings, 1 reply; 10+ messages in thread
From: Peter Dyballa @ 2006-06-30 8:41 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 30.06.2006 um 00:37 schrieb H.S.:
> Yup, you are right. I just discovered another post in this
> newsgroup. This seems to have worked:
> M-x prefer-coding-system RET utf-8 RET
You can set in .emacs for example:
(setq default-buffer-file-coding-system 'utf-8-unix)
(set-default-coding-systems 'utf-8)
(prefer-coding-system 'utf-8)
(modify-coding-system-alist 'process "\\*shell\\*\\'" 'utf-8)
and exceptions like these:
(setq file-coding-system-alist
(append
'(("\\.tex\\'" iso-latin-9-unix . iso-latin-9-unix))
; '(("\\.el\\'" iso-latin-9-unix . iso-latin-9-unix))
file-coding-system-alist))
In GNU Emacsen 21 and 22 the UTF-8 support is not perfect yet.
--
Greetings
Pete
"Let's face it; we don't want a free market economy either."
James Farley, president, Coca-Cola Export Corp., 1959
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 23:34 ` H.S.
@ 2006-06-30 9:03 ` Peter Dyballa
0 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2006-06-30 9:03 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 30.06.2006 um 01:34 schrieb H.S.:
> Peter Dyballa wrote:
>
>> Make the *compilation* buffer be encoded in UTF-8 or make your
>> LANG or LC_CTYPE environment variables 8 bit -- could be there is
>> some option in your g++ to stay in 8 bit when printing some message.
>
> Yes, that is one method. But with all this talk of systems being
> utf-8 compatible and such these days, I was expecting that
> applications are getting better at this. If Emacs is not UTF-8
> complaint, I would like to know for sure so that I can accomodate
> other applications I use. On the other hand, if Emacs is expected
> to recognize UTF-8, then there ought to be a way to make it do so
> by default. All I want to know is which way is it?
>
GNU Emacs 21.4 is probably missing a lot (I don't use it, I 21.3.50
from CVS around), version 22.0.50 is far away from an UTF-8
application, at least with my customisation. GNU Emacs 23.0.0
performs better, but has problems, too.
In 21.3.50 and 22.0.50 *shell* and dired buffers seem to have
problems with UTF-8 file names, although in *shell* I can 'cat'
kermit's utf_8.txt and some 10K glyphs are displayed. *compilation*
or *Completions* work fine. It depends on your demands ...
Sometime in GNU Emacs 21.x code was introduced to read LANG and/or
LC_CTYPE and prepare some default encoding of buffers based an these
environment variables. Since then it's not necessary to set terminal
or keyboard or clipboard or ... coding systems. There is much code
that outputs only 7bit or 8bit messages. You can see from my *shell*
example that most things work, but some don't. In GNU Emacs 23 for
example the method of Mac OS X's HFS+ file system to store UTF-8 file
names as decomposed characters leads to file names that look ugly
because some mechanism builds from a and ¨ an ä. And somehow the
combining modifier ¨ is not positioned correctly ... When the
character is prêt-à-porter, "composed," as in kermit's utf_8.txt,
then it looks fine -- but the fonts to display these characters
change to so that the glyphs used do not fit in size and other
parameters.
If there were a monospaced Unicode encoded font without gaps to span
from SPACE to REPLACEMENT CHARACTER ([�] at FFFD) it wouldn't be so
ugly. (There are two more PLANES with each 64K characters defined in
Unicode 4.x.)
--
Greetings
Pete
There are two major products that come out of Berkeley: LSD and UNIX.
We don't believe this to be a coincidence.
- Jeremy S. Anderson
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-29 22:18 ` Peter Dyballa
` (2 preceding siblings ...)
2006-06-29 23:34 ` H.S.
@ 2006-06-30 12:03 ` Eli Zaretskii
2006-06-30 21:41 ` Peter Dyballa
3 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2006-06-30 12:03 UTC (permalink / raw)
> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Fri, 30 Jun 2006 00:18:34 +0200
> Cc: help-gnu-emacs@gnu.org
>
> Make the *compilation* buffer be encoded in UTF-8
In the interests of not getting users confused, and also to make the
terminology right, let me note that buffers in Emacs are not encoded,
neither in UTF-8 or Latin-1, nor in any other similar encoding.
Characters are only encoded by Emacs when it writes the buffer to a
file or sends it to some program.
What you probably wanted to say was ``make Emacs decode the compiler's
output as UTF-8''. That is, things need to be set up so that Emacs
interprets the byte stream from the compiler as UTF-8 encoding of
Unicode characters. It will then decode those bytes into the internal
representation used to store characters within Emacs buffers.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-30 8:41 ` Peter Dyballa
@ 2006-06-30 16:13 ` H.S.
0 siblings, 0 replies; 10+ messages in thread
From: H.S. @ 2006-06-30 16:13 UTC (permalink / raw)
Peter Dyballa wrote:
>
> Am 30.06.2006 um 00:37 schrieb H.S.:
>
>> Yup, you are right. I just discovered another post in this newsgroup.
>> This seems to have worked:
>> M-x prefer-coding-system RET utf-8 RET
>
>
> You can set in .emacs for example:
>
> (setq default-buffer-file-coding-system 'utf-8-unix)
> (set-default-coding-systems 'utf-8)
> (prefer-coding-system 'utf-8)
> (modify-coding-system-alist 'process "\\*shell\\*\\'" 'utf-8)
>
> and exceptions like these:
>
> (setq file-coding-system-alist
> (append
> '(("\\.tex\\'" iso-latin-9-unix . iso-latin-9-unix))
> ; '(("\\.el\\'" iso-latin-9-unix . iso-latin-9-unix))
> file-coding-system-alist))
Great, this is one of the options I was looking for.
> In GNU Emacsen 21 and 22 the UTF-8 support is not perfect yet.
And this explains a lot.
Thanks,
regards,
->HS
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: font or face problem in emacs
2006-06-30 12:03 ` Eli Zaretskii
@ 2006-06-30 21:41 ` Peter Dyballa
0 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2006-06-30 21:41 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 30.06.2006 um 14:03 schrieb Eli Zaretskii:
>> From: Peter Dyballa <Peter_Dyballa@Web.DE>
>> Date: Fri, 30 Jun 2006 00:18:34 +0200
>> Cc: help-gnu-emacs@gnu.org
>>
>> Make the *compilation* buffer be encoded in UTF-8
>
> In the interests of not getting users confused, and also to make the
> terminology right, let me note that buffers in Emacs are not encoded,
> neither in UTF-8 or Latin-1, nor in any other similar encoding.
> Characters are only encoded by Emacs when it writes the buffer to a
> file or sends it to some program.
>
> What you probably wanted to say was ``make Emacs decode the compiler's
> output as UTF-8''. That is, things need to be set up so that Emacs
> interprets the byte stream from the compiler as UTF-8 encoding of
> Unicode characters. It will then decode those bytes into the internal
> representation used to store characters within Emacs buffers.
>
Probably the way you put your words is what I meant to write -- but
somehow I lost track of cause and effect! It's hard to find a
difference between them in a world of quanta with German flags
everywhere. Actually I haven't yet seen one coming out of a ... ahem,
point in the back!
--
Greetings
Pete
Sometimes I think the surest sign that intelligent life exists
elsewhere in the universe is that none of it has tried to contact us.
-- Bill Watterson, in his comic strip Calvin and
Hobbes
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-06-30 21:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-29 20:50 font or face problem in emacs H.S.
2006-06-29 22:18 ` Peter Dyballa
2006-06-29 22:37 ` H.S.
2006-06-30 8:41 ` Peter Dyballa
2006-06-30 16:13 ` H.S.
2006-06-29 22:47 ` Peter Dyballa
2006-06-29 23:34 ` H.S.
2006-06-30 9:03 ` Peter Dyballa
2006-06-30 12:03 ` Eli Zaretskii
2006-06-30 21:41 ` Peter Dyballa
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.