all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Coding system in compilation buffer
@ 2007-11-26  9:36 Enno Fennema
  2007-11-26 13:03 ` Peter Dyballa
  0 siblings, 1 reply; 5+ messages in thread
From: Enno Fennema @ 2007-11-26  9:36 UTC (permalink / raw)
  To: help-gnu-emacs

I am using GNU Emacs 22.1.1 part of SuSE Linux 10.3 x86_64.
When doing a compile gcc writes its messages/warnings using utf-8 which 
does not help readability when the buffers assumes latin-1.

Trying the get the compilation buffer to accept utf-8 I tried

 >>
(defun compile-utf ()
   "Set compilation buffer for UTF-8"
   ( save-current-buffer
     (set-buffer compilation-buffer)
     (set-buffer-process-coding-system "utf-8" "utf-8")))

(setq compilation-process-setup-function 'compile-utf)
<<

Now doing a compile appears to call the function compile-utf but then 
moans that compilation buffer is a void variable.

That appears to contradict the description of 
compilation-process-setup-function which says that compilation-buffer 
should be bound by the time that function is called.

I am no elisp expert at all and appreciate help.

Does the above idea make sense or is there a better approach?

If the above, then how should I get it to work properly.

Regards,
Enno Fennema

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

* Re: Coding system in compilation buffer
  2007-11-26  9:36 Coding system in compilation buffer Enno Fennema
@ 2007-11-26 13:03 ` Peter Dyballa
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2007-11-26 13:03 UTC (permalink / raw)
  To: Enno Fennema; +Cc: help-gnu-emacs


Am 26.11.2007 um 10:36 schrieb Enno Fennema:

> If the above, then how should I get it to work properly.


For me it works to have environment variables LANG and LC_CTYPE set  
some UTF-8 value, not setting a language environment in my user init  
file, but having

	(prefer-coding-system 'utf-8)

Well, on Mac OS X ...

Check also by launching GNU Emacs with -Q, i.e. no customisation  
neither from your system not from you. Last resort might be the  
variable process-coding-system-alist. It *might* be successfully  
manipulated with

	(modify-coding-system-alist 'process "\\*compilation\\*\\'"   'utf-8)


--
Greetings

   Pete

"engineer: a mechanism for converting caffeine into designs"

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

* Coding system in compilation buffer
@ 2007-12-04 20:32 Enno Fennema
  2007-12-05 18:12 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Enno Fennema @ 2007-12-04 20:32 UTC (permalink / raw)
  To: bug-gnu-emacs

I am using GNU Emacs 22.1.1 part of SuSE Linux 10.3 x86_64.
When doing a compile gcc writes its messages/warnings using utf-8 which 
does not help readability when the buffers assumes latin-1.

According to the documentation compilation-process-setup-function is 
called with compilation-buffer bound. I think that variable is actually 
called outbuf in compile.el That would be a documentation bug, however 
minor; the rest is a question.

I tried emacs initialization with:
 >>
(defun compile-utf ()
   "Set compilation buffer for UTF-8"
   ( save-current-buffer
     (set-buffer outbuf)
     (set-buffer-process-coding-system "utf-8" "utf-8")))

(setq compilation-process-setup-function 'compile-utf)
<<

That doesn't work either complaining that there is no process yet.

I don't want to set a global utf-8 preference as normally I prefer
latin-1, which works fine for a West-European (for years I worked with 
ASCII only).

Does the above idea make sense, if so how do I make it work, or is there 
an alternative better approach?

Regards,
Enno Fennema




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

* Re: Coding system in compilation buffer
  2007-12-04 20:32 Enno Fennema
@ 2007-12-05 18:12 ` Eli Zaretskii
  2007-12-06 22:06   ` Enno Fennema
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2007-12-05 18:12 UTC (permalink / raw)
  To: Enno Fennema; +Cc: bug-gnu-emacs

> Date: Tue, 04 Dec 2007 21:32:21 +0100
> From: Enno Fennema <e.fennema@tiscali.nl>
> 
> (defun compile-utf ()
>    "Set compilation buffer for UTF-8"
>    ( save-current-buffer
>      (set-buffer outbuf)
>      (set-buffer-process-coding-system "utf-8" "utf-8")))
> 
> (setq compilation-process-setup-function 'compile-utf)
> <<
> 
> That doesn't work either complaining that there is no process yet.

You need to bind coding-system-for-read to utf-8 prior to invoking the
compilation.  Try it interactively with

  C-x RET c utf-8 RET M-x compile RET ...

and if it does what you want, define a function that binds
coding-system-for-read and then invokes compile.




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

* Re: Coding system in compilation buffer
  2007-12-05 18:12 ` Eli Zaretskii
@ 2007-12-06 22:06   ` Enno Fennema
  0 siblings, 0 replies; 5+ messages in thread
From: Enno Fennema @ 2007-12-06 22:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-gnu-emacs


Eli Zaretskii wrote:
> 
> You need to bind coding-system-for-read to utf-8 prior to invoking the
> compilation.

Works like a charm. Many thanks.

Enno Fennema




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

end of thread, other threads:[~2007-12-06 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26  9:36 Coding system in compilation buffer Enno Fennema
2007-11-26 13:03 ` Peter Dyballa
  -- strict thread matches above, loose matches on Subject: below --
2007-12-04 20:32 Enno Fennema
2007-12-05 18:12 ` Eli Zaretskii
2007-12-06 22:06   ` Enno Fennema

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.