[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: aplus mode

From: Rustom Mody
Subject: Re: aplus mode
Date: Thu, 16 Aug 2012 22:55:03 +0530

On Tue, Aug 14, 2012 at 8:17 PM, Stefan Monnier <address@hidden> 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"
  (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+*")
  (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

Thanks. I was looking for such functions.  I will of course have to study code that uses them.  Any suggestions where to start?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]