Hi,
I'm working on a simple web app whose source contains utf-8 characters, and I try to configure my environment so that everything plays nicely.
What works:
- when using emacs in utf-8 environment, I can properly use the REPL and compile functions with C-c C-c. They play nicely together.
What does not work:
- when I use C-c C-k, the functions seem to be compiled as if the source code was in latin-1 I think.
How can I configure slime to behave similarly whether it compiles a file or a function?
The only slime config I have is:
(setq slime-net-coding-system 'utf-8-unix)
I'm using:
- sbcl 0.9.2 - slime CVS
Thanks for your help,
Frédéric
frederic.gobry@epfl.ch (Frédéric Gobry) writes:
What does not work:
- when I use C-c C-k, the functions seem to be compiled as if the source code was in latin-1 I think.
How can I configure slime to behave similarly whether it compiles a file or a function?
I added a bit support for this. If you add
-*- slime-coding: utf-8-unix -*-
to your file, SLIME will pass it as :external-format argument to COMPILE-FILE. It only works for C-c C-k and only for a few backends. There may be problems with source locations which use byte offsets or ASDF or other code which opens source files without specifying the encoding. Maybe CL:OPEN should be smarter about encodings and not SLIME.
Helmut.
I added a bit support for this. If you add
-*- slime-coding: utf-8-unix -*-
to your file, SLIME will pass it as :external-format argument to COMPILE-FILE. It only works for C-c C-k and only for a few backends.
Thanks a lot.
Just a naive question: are there cases where slime-coding and coding would be different?
Frédéric
frederic.gobry@epfl.ch (Frédéric Gobry) writes:
Just a naive question: are there cases where slime-coding and coding would be different?
Probably not, but I guess a common value for coding is "utf-8" which does not specify the eol convention. Emacs fills the eol convention in with some heuristics. Unfortunately it's a bit boring to implement the same heuristic in SLIME that does the same in all the different Emacsen. So I went the simple route and made a fresh variable which can only have very few values (e.g. utf-8 is not allowed, only utf-8-unix) which results is much less code.
Helmut.
I'm coming back to this issue after spending some time away from my lisp project.
In the current CVS code, the function compile-file-for-emacs seems to lack an &optional coding parameter in (I get an error when using C-c C-k)
Frédéric
frederic.gobry@epfl.ch (Frédéric Gobry) writes:
In the current CVS code, the function compile-file-for-emacs seems to lack an &optional coding parameter in (I get an error when using C-c C-k)
Right. I forgot to commit that file. Done now.
Helmut.