* encoding in *compilation-buffer*
@ 2011-02-15 22:03 tlanglois
2011-02-16 20:23 ` Peter Dyballa
0 siblings, 1 reply; 20+ messages in thread
From: tlanglois @ 2011-02-15 22:03 UTC (permalink / raw)
To: Help-gnu-emacs
Hello,
I am using :
GNU Emacs 22.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-03-31 on
crested, modified by Ubuntu
I use it a lot remotely with a xterm.
In compilation buffers it seems that non 8bit characters are used which
truns error messages very hard to read :
javatolatex.lex:93: error: expected �[39;49m\200\230;�[39;49m\200\231 before
�[39;49m\200\230}�[39;49m\200\231 token
Is there a way to fix this ?
Thanks.
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30934972.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-15 22:03 encoding in *compilation-buffer* tlanglois
@ 2011-02-16 20:23 ` Peter Dyballa
2011-02-17 13:55 ` tlanglois
0 siblings, 1 reply; 20+ messages in thread
From: Peter Dyballa @ 2011-02-16 20:23 UTC (permalink / raw)
To: tlanglois; +Cc: Help-gnu-emacs
Am 15.02.2011 um 23:03 schrieb tlanglois:
> Is there a way to fix this ?
Use xterm in UTF-8 mode (maybe uxterm) and set environment variables
LC_CTYPE (and LANG too) to some UTF-8 based value (for example
de_DE.UTF-8).
--
Greetings
Pete
Hard Disk, n.:
A device that allows users to delete vast quantities of data with
simple mnemonic commands.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-16 20:23 ` Peter Dyballa
@ 2011-02-17 13:55 ` tlanglois
2011-02-17 14:23 ` Peter Dyballa
0 siblings, 1 reply; 20+ messages in thread
From: tlanglois @ 2011-02-17 13:55 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Dyballa wrote:
>
>
> Am 15.02.2011 um 23:03 schrieb tlanglois:
>
>> Is there a way to fix this ?
>
> Use xterm in UTF-8 mode (maybe uxterm) and set environment variables
> LC_CTYPE (and LANG too) to some UTF-8 based value (for example
> de_DE.UTF-8).
>
Thanks for responding.
I've done what you suggest. In a uxterm I have :
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
but I get the same weird output in emacs.
If I issue the compilation command in a uxterm (o xterm with same locale
settings) the message is normal :
$ make -f make-javatolatex
gcc javatolatex.c -o javatolatex -lfl
javatolatex.lex:11: error: expected ‘,’ or ‘;’ before ‘void’
make: *** [javatolatex] Error 1
So it seems to be an emacs-related problem and not a problem related to the
terminal.
T.
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30949803.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-17 13:55 ` tlanglois
@ 2011-02-17 14:23 ` Peter Dyballa
2011-02-19 14:31 ` tlanglois
[not found] ` <mailman.1.1298125912.23047.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 20+ messages in thread
From: Peter Dyballa @ 2011-02-17 14:23 UTC (permalink / raw)
To: tlanglois; +Cc: Help-gnu-emacs
Am 17.02.2011 um 14:55 schrieb tlanglois:
> javatolatex.lex:11: error: expected ‘,’ or ‘;’ before ‘void’
Here you see the "typographic" quotes I recognised, but Stefan did not
overlook your second problem! ANSI Esc sequences are sent to make the
output look colourful. I haven't seen this. There are two options, I
can think of: set TERM to a reasonable value, maybe xterm-256color, in
case it's true (or smaller no. of colours or just xterm-color), and
enable inside GNU Emacs handling of these codes with:
(ansi-color-for-comint-mode-on)
This works, starting from *some* GNU Emacs 22.x, in shells. I'm not
sure whether it works in a *compilation* buffer. And I'n not sure if
it works when GNU Emacs runs without windows, i.e., when it depends on
what this terminal emulation can perform.
Which tool is actually emitting these codes? (I presume it's this
"javatolatex".) Does its documentation tell a bit about colours?
--
Greetings
Pete
The mathematician who pursues his studies without clear views of this
matter, must often have the uncomfortable feeling that his paper and
pencil surpass him in intelligence.
– Ernst Mach
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-17 14:23 ` Peter Dyballa
@ 2011-02-19 14:31 ` tlanglois
2011-02-19 15:08 ` Peter Dyballa
2011-02-19 15:09 ` Oleksandr Gavenko
[not found] ` <mailman.1.1298125912.23047.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 20+ messages in thread
From: tlanglois @ 2011-02-19 14:31 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Dyballa wrote:
>
>
> Which tool is actually emitting these codes? (I presume it's this
> "javatolatex".) Does its documentation tell a bit about colours?
>
>
no gcc is emiting those codes.
After a little googling I found a solution:
If I set export LC_ALL=C in a *shell* buffer, gcc emits normal ascii
characters.
But I don't know how to set that variable in *compilation* buffers
automatically.
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30966005.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 14:31 ` tlanglois
@ 2011-02-19 15:08 ` Peter Dyballa
2011-02-20 1:30 ` tlanglois
2011-02-19 15:09 ` Oleksandr Gavenko
1 sibling, 1 reply; 20+ messages in thread
From: Peter Dyballa @ 2011-02-19 15:08 UTC (permalink / raw)
To: tlanglois; +Cc: Help-gnu-emacs
Am 19.02.2011 um 15:31 schrieb tlanglois:
> But I don't know how to set that variable in *compilation* buffers
> automatically.
You can customise the make command (I don't know the exact variable's
name) and make it to something like:
env LC_ALL=C make ...
You can reach the customisation interfaces from the Options ->
Customize Emacs menu.
Another option is to launch GNU Emacs directly as 'env LC_ALL=C
emacs ...' and not setting any language-environment.
--
Greetings
Pete
»¿ʇı̣ əsnqɐ ʇ,uɐɔ noʎ ɟı̣
ɓuı̣ɥʇʎuɐ sı̣ pooɓ ʇɐɥʍ«
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 15:08 ` Peter Dyballa
@ 2011-02-20 1:30 ` tlanglois
2011-02-20 9:40 ` Peter Dyballa
0 siblings, 1 reply; 20+ messages in thread
From: tlanglois @ 2011-02-20 1:30 UTC (permalink / raw)
To: Help-gnu-emacs
So the problem is caused by environment settings that affect how gcc prints
messages.
Here is hello.c: void main() { int a = 3 }
M- x shell then:
~/code/c$ gcc hello.c
hello.c: In function âmainâ:
hello.c:1: error: expected â,â or â;â before â}â token
hello.c:1: error: expected declaration or statement at end of input
~/code/c$ export LC_CTYPE=C
~/code/c$ gcc hello.c
hello.c: In function 'main':
hello.c:1: error: expected ',' or ';' before '}' token
hello.c:1: error: expected declaration or statement at end of input
The solution is to set the variable when starting emacs. When I put (setenv
"LC_CTYPE" "C")
in my .emacs file everything is OK including when compiling with M-x compile
I don't know if setting this environment variable for the whole emacs
session may cause undesirable side effects.
Thibault
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30968731.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-20 1:30 ` tlanglois
@ 2011-02-20 9:40 ` Peter Dyballa
2011-02-20 12:58 ` tlanglois
0 siblings, 1 reply; 20+ messages in thread
From: Peter Dyballa @ 2011-02-20 9:40 UTC (permalink / raw)
To: tlanglois; +Cc: Help-gnu-emacs
Am 20.02.2011 um 02:30 schrieb tlanglois:
> The solution is to set the variable when starting emacs. When I put
> (setenv
> "LC_CTYPE" "C")
> in my .emacs file everything is OK including when compiling with M-x
> compile
> I don't know if setting this environment variable for the whole emacs
> session may cause undesirable side effects.
GNU Emacs will now interpret everything in 7-bit US-ASCII. Including
file names. Putting compilation only in this mode (env LC_CTYPE=C
<command>) should be sufficient.
--
Greetings
Pete
Atheism is a non prophet organization.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-20 9:40 ` Peter Dyballa
@ 2011-02-20 12:58 ` tlanglois
2011-02-20 13:15 ` tlanglois
2011-02-20 14:14 ` Peter Dyballa
0 siblings, 2 replies; 20+ messages in thread
From: tlanglois @ 2011-02-20 12:58 UTC (permalink / raw)
To: Help-gnu-emacs
Peter Dyballa wrote:
>
> GNU Emacs will now interpret everything in 7-bit US-ASCII. Including
> file names. Putting compilation only in this mode (env LC_CTYPE=C
> <command>) should be sufficient.
>
Well, once more I have to confess my ignorance... How can I do that ?
Is there a before-compilation-hook that I can customize ?
The is a compilation-finish-functions hook
(http://www.gnu.org/s/emacs/manual/html_node/elisp/Standard-Hooks.html) but
I don't think it is what I need.
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30970486.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-20 12:58 ` tlanglois
@ 2011-02-20 13:15 ` tlanglois
2011-02-20 13:22 ` Oleksandr Gavenko
2011-02-20 14:14 ` Peter Dyballa
1 sibling, 1 reply; 20+ messages in thread
From: tlanglois @ 2011-02-20 13:15 UTC (permalink / raw)
To: Help-gnu-emacs
tlanglois wrote:
>
> Is there a before-compilation-hook that I can customize ?
>
I found it finally !
All I have to do is put
(setq compilation-environment "LC_CTYPE=C")
in .emacs
T.
--
View this message in context: http://old.nabble.com/encoding-in-*compilation-buffer*-tp30934972p30970570.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-20 12:58 ` tlanglois
2011-02-20 13:15 ` tlanglois
@ 2011-02-20 14:14 ` Peter Dyballa
1 sibling, 0 replies; 20+ messages in thread
From: Peter Dyballa @ 2011-02-20 14:14 UTC (permalink / raw)
To: tlanglois; +Cc: Help-gnu-emacs
Am 20.02.2011 um 13:58 schrieb tlanglois:
> Well, once more I have to confess my ignorance... How can I do that ?
> Is there a before-compilation-hook that I can customize ?
It's much simpler! This variable exists in GNU Emacs:
compile-command is a variable defined in `compile.el'.
Its value is "time nice +11 make -k bootstrap"
Original value was "make -k "
This variable is potentially risky when used as a file local
variable.
This variable is safe as a file local variable if its value
satisfies the predicate `(lambda (a) (and (stringp a) (or (not
(boundp (quote compilation-read-command))) compilation-read-command)))'.
Documentation:
Last shell command used to do a compilation; default for next
compilation.
Sometimes it is useful for files to supply local values for this
variable.
You might also use mode hooks to specify it in certain modes, like
this:
(add-hook 'c-mode-hook
(lambda ()
(unless (or (file-exists-p "makefile")
(file-exists-p "Makefile"))
(set (make-local-variable 'compile-command)
(concat "make -k "
(file-name-sans-extension buffer-file-name))))))
You can customize this variable.
I have it already customised, as you can see. To reach it you can use
the Options menu with the sub-menu Customize Emacs or look up the
documentation of compile-command per
C-h v compile-command RET
and then click at the /customize/ hyper-link.
--
Greetings
Pete
Only useless documentation transcends the first two laws.
– Arnold's Third Law of Documentation
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 14:31 ` tlanglois
2011-02-19 15:08 ` Peter Dyballa
@ 2011-02-19 15:09 ` Oleksandr Gavenko
1 sibling, 0 replies; 20+ messages in thread
From: Oleksandr Gavenko @ 2011-02-19 15:09 UTC (permalink / raw)
To: help-gnu-emacs
On 2011-02-19 14:31, tlanglois wrote:
> Peter Dyballa wrote:
>>
>> Which tool is actually emitting these codes? (I presume it's this
>> "javatolatex".) Does its documentation tell a bit about colours?
>
> no gcc is emiting those codes.
> After a little googling I found a solution:
> If I set export LC_ALL=C in a *shell* buffer, gcc emits normal ascii
> characters.
> But I don't know how to set that variable in *compilation* buffers
> automatically.
>
Not automatically but for this purpose I use:
M-x compile LANG=C make RET
when need output in EN locale (instead Russian). EN locale useful for
googling about occurred errors or if GCC lang settings misconfigured.
--
Best regards!
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <mailman.1.1298125912.23047.help-gnu-emacs@gnu.org>]
* Re: encoding in *compilation-buffer*
[not found] ` <mailman.1.1298125912.23047.help-gnu-emacs@gnu.org>
@ 2011-02-19 15:03 ` Alain Ketterlin
2011-02-19 16:04 ` Peter Dyballa
[not found] ` <mailman.6.1298131487.23047.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 20+ messages in thread
From: Alain Ketterlin @ 2011-02-19 15:03 UTC (permalink / raw)
To: help-gnu-emacs
tlanglois <tl@di.fc.ul.pt> writes:
> Peter Dyballa wrote:
>> Which tool is actually emitting these codes? (I presume it's this
>> "javatolatex".) Does its documentation tell a bit about colours?
> no gcc is emiting those codes.
Afaik, gcc doesn't do this. There must be some kind of "smart" wrapper
(usually named colorgcc) involved.
> After a little googling I found a solution:
> If I set export LC_ALL=C in a *shell* buffer, gcc emits normal ascii
> characters.
> But I don't know how to set that variable in *compilation* buffers
> automatically.
I've missed the start of the thread, but isn't
ansi-color-for-comint-mode supposed to solve this?
-- Alain.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 15:03 ` Alain Ketterlin
@ 2011-02-19 16:04 ` Peter Dyballa
[not found] ` <mailman.6.1298131487.23047.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 20+ messages in thread
From: Peter Dyballa @ 2011-02-19 16:04 UTC (permalink / raw)
To: Alain Ketterlin; +Cc: help-gnu-emacs
Am 19.02.2011 um 16:03 schrieb Alain Ketterlin:
> I've missed the start of the thread, but isn't
> ansi-color-for-comint-mode supposed to solve this?
As the function's name tell: It seems to be meant for comint-mode.
This does not seem to exist in *compilation* buffers.
Could /you/ make a test with this "colorgcc" wrapper? On my Mac OS X
system it does not exist. By temporarily commenting ansi-color-for-
comint-mode in your init file and launching a second GNU Emacs you
should be able to notice a difference...
--
Greetings
Pete
Encryption, n.:
A powerful algorithmic encoding technique employed in the creation of
computer manuals.
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <mailman.6.1298131487.23047.help-gnu-emacs@gnu.org>]
* Re: encoding in *compilation-buffer*
[not found] ` <mailman.6.1298131487.23047.help-gnu-emacs@gnu.org>
@ 2011-02-19 17:12 ` Alain Ketterlin
2011-02-19 20:30 ` Peter Dyballa
2011-02-19 21:02 ` Peter Dyballa
0 siblings, 2 replies; 20+ messages in thread
From: Alain Ketterlin @ 2011-02-19 17:12 UTC (permalink / raw)
To: help-gnu-emacs
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Am 19.02.2011 um 16:03 schrieb Alain Ketterlin:
>
>> I've missed the start of the thread, but isn't
>> ansi-color-for-comint-mode supposed to solve this?
>
> As the function's name tell: It seems to be meant for comint-mode.
> This does not seem to exist in *compilation* buffers.
Sorry, I was somehow assuming that the *compilation* buffer was in
comint mode. Actually, setting ansi-color-for-comint-mode to t and
invoking:
C-u M-x compile RET ls -l --color=always RET
uses comint and produces ansi-color-ful output. Omitting the prefix arg
shows ugly ansi sequences and no color.
> Could /you/ make a test with this "colorgcc" wrapper? On my Mac OS X
> system it does not exist. By temporarily commenting ansi-color-for-
> comint-mode in your init file and launching a second GNU Emacs you
> should be able to notice a difference...
I don't use colorgcc or any kind of wrapper. I have colorful messages in
the compilation buffer thanks to compilation-mode's own output parsing
and font-lock settings.
More precisely: if I launch a regular compile with
M-x compile RET gcc whatever.c
I get no ansi sequences in the output. That's why I said that gcc is not
responsible for the sequences.
The OP's "javatolatex" (iirc) probably pipes gcc's output through a
wrapper. Either he changes his script to not produces the ansi
sequences, or he switches to comint-based compilation and sets
ansi-color-for-comint-mode. Once this variable is set, he can also use
either M-x shell, or M-x term.
-- Alain.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 17:12 ` Alain Ketterlin
@ 2011-02-19 20:30 ` Peter Dyballa
2011-02-19 21:02 ` Peter Dyballa
1 sibling, 0 replies; 20+ messages in thread
From: Peter Dyballa @ 2011-02-19 20:30 UTC (permalink / raw)
To: Alain Ketterlin; +Cc: help-gnu-emacs
Am 19.02.2011 um 18:12 schrieb Alain Ketterlin:
> Sorry, I was somehow assuming that the *compilation* buffer was in
> comint mode. Actually, setting ansi-color-for-comint-mode to t and
> invoking:
>
> C-u M-x compile RET ls -l --color=always RET
I see now: The C-u uses a comint-shell to run compilation process in
it! (As the description states.) I simply did not knew this feature, a
simple M-x was OK for me. (And probably will continue to be.) Thanks
for this!
--
Greetings
Pete
A morning without coffee is like something without something else.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: encoding in *compilation-buffer*
2011-02-19 17:12 ` Alain Ketterlin
2011-02-19 20:30 ` Peter Dyballa
@ 2011-02-19 21:02 ` Peter Dyballa
1 sibling, 0 replies; 20+ messages in thread
From: Peter Dyballa @ 2011-02-19 21:02 UTC (permalink / raw)
To: Alain Ketterlin; +Cc: help-gnu-emacs
Am 19.02.2011 um 18:12 schrieb Alain Ketterlin:
> C-u M-x compile RET ls -l --color=always RET
This mode has one disadvantage: You can't type "g" to repeat the
compilation!
--
Greetings
Pete
One-Shot Case Study, n.:
The scientific equivalent of the four-leaf clover, from which it is
concluded all clovers possess four leaves and are sometimes green.
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <mailman.7.1297885528.10461.help-gnu-emacs@gnu.org>]
end of thread, other threads:[~2011-02-27 21:34 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 22:03 encoding in *compilation-buffer* tlanglois
2011-02-16 20:23 ` Peter Dyballa
2011-02-17 13:55 ` tlanglois
2011-02-17 14:23 ` Peter Dyballa
2011-02-19 14:31 ` tlanglois
2011-02-19 15:08 ` Peter Dyballa
2011-02-20 1:30 ` tlanglois
2011-02-20 9:40 ` Peter Dyballa
2011-02-20 12:58 ` tlanglois
2011-02-20 13:15 ` tlanglois
2011-02-20 13:22 ` Oleksandr Gavenko
2011-02-27 21:34 ` tlanglois
2011-02-20 14:14 ` Peter Dyballa
2011-02-19 15:09 ` Oleksandr Gavenko
[not found] ` <mailman.1.1298125912.23047.help-gnu-emacs@gnu.org>
2011-02-19 15:03 ` Alain Ketterlin
2011-02-19 16:04 ` Peter Dyballa
[not found] ` <mailman.6.1298131487.23047.help-gnu-emacs@gnu.org>
2011-02-19 17:12 ` Alain Ketterlin
2011-02-19 20:30 ` Peter Dyballa
2011-02-19 21:02 ` Peter Dyballa
[not found] <mailman.7.1297885528.10461.help-gnu-emacs@gnu.org>
2011-02-17 1:25 ` Stefan Monnier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).