On Tue, Aug 14, 2012 at 8:17 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> Trying to make an 'inside-emacs' version of the same hack I discovered that
> the following does the trick of removing the need for LANG=C.
> (setq coding-system-for-write 'iso-latin-1)
> (setq coding-system-for-read 'iso-latin-1)
> Obviously this is not a proper solution.
> Firstly these variables should not be globally assigned. Whats the best
> way of scoping these assignments or should some other variables be used I
> am not sure.
You should let-bind them around the `start-process' call.
I now have
(defun run-apl()
"Major mode for running APlus under emacs"
(interactive)
(if (not (comint-check-proc "*a+*"))
(let ((coding-system-for-write 'iso-latin-1)
(coding-system-for-read 'iso-latin-1))
(set-buffer (make-comint "a+" "a+"))))
(setq apl-buffer "*a+*")
(inferior-apl-mode)
(pop-to-buffer "*a+*"))
Is this (use of let) the appropriate way?
> The second point is that iso-latin-1 just works by saying so-to-speak
> "Not-UTF" but it is obviously wrong.
Yes, if it works, it's probably by accident. It might be preferable to
create a proper `apl' coding-system (use define-charset and then
define-coding-system).